///////////////////////////////////////////////////////////////////////////////
//
//  Vom Xbase++ FormDesigner erstellter Funktions Code
//    Erstellt am: 15.05.01 Zeit: 11:10:48
//
///////////////////////////////////////////////////////////////////////////////

#include "Gra.ch"
#include "Xbp.ch"
#include "Appevent.ch"
#include "Font.ch"

PROCEDURE Radio()
   LOCAL nEvent, mp1, mp2
   LOCAL oDlg, oXbp, drawingArea, aEditControlsR := {}, oXbp1, oXbp2		//24.06.2026 11:01 aEditControlsR
   LOCAL aSizeDesktop := AppDesktop():currentSize()
   LOCAL nBSb := aSizeDesktop[1]
   LOCAL nBSh := aSizeDesktop[2]
// folgende Zahlen-Werte basieren auf 800x600:
   LOCAL nV := nBSb/800         // Korrekturfaktor fr tats„chliche Aufl”sung
   LOCAL n5 := int(5*nV)
   LOCAL n10 := int(10*nV)
   LOCAL n15 := int(15*nV)
   LOCAL n20 := int(20*nV)
   LOCAL n30 := int(30*nV)
   LOCAL nRo := int(450*nV)     // oberstes Eingabefeld
   LOCAL nBo := nRo
   LOCAL nR1 := n10       // linker Rand Bezeichnungsfeld
   LOCAL nR2 := int((nBSb-5*nR1)/8)       // kleiner Abstand
   LOCAL nR3 := 2*nR2   //int(*nV)     // groáer Abstand
   LOCAL nBl1 := nR2-n5       // RadioButton-Breite inkl. Text
   LOCAL nBl2 := nR3-n5       // RadioButton-Breite inkl. Text
   LOCAL nBG := nBSb-3*nR1
   LOCAL nBh := n20
   LOCAL nBH1 := int(nBh*2)
   LOCAL nBH2 := int(nBh*3)
   LOCAL nBH3 := int(nBh*4)
   LOCAL nBH4 := int(nBh*5)

   LOCAL cSonst1 := 1->SONST1
   LOCAL cSonst2 := 1->SONST2
   LOCAL cSonst2a := substr( cSonst2,1,14 )
   LOCAL cSonst2b := substr( cSonst2,15,14 )
   LOCAL nG1a := Val(substr(cSonst1,2,1))
   LOCAL nG1b := Val(substr(cSonst1,3,1))
   LOCAL nG2 := Val(substr(cSonst1,4,1))
   LOCAL nG3 := Val(substr(cSonst1,5,1))
   LOCAL nG4 := Val(substr(cSonst1,6,1))
   LOCAL nG5 := Val(substr(cSonst1,7,1))
   LOCAL nG6 := Val(substr(cSonst1,8,1))
   LOCAL nAnf := Val(substr(cSonst1,9,5))
   LOCAL nEnd := Val(substr(cSonst1,14,5))
   LOCAL dDat := CtoD(substr(cSonst1,19,10))

   oDlg := XbpDialog():new( AppDesktop(), , {n5,n30}, {nBSb-n10,nBSh-n30}, , .F.)
   oDlg:taskList := .T.
   oDlg:title := "Statistik-Seite"
   oDlg:create()

   drawingArea := oDlg:drawingArea
   IF nBSb > 1000
      drawingArea:setFontCompoundName( "12.Arial" )
   ELSE
      drawingArea:setFontCompoundName( "8.Arial" )
   ENDIF

   oXbp1 := XbpStatic():new( drawingArea, , {nR1,nBo}, {nBG,nBH3} )
   oXbp1:caption := "Eine pers”nliche Frage an die Angeh”rigen"
   oXbp1:clipSiblings := .T.
   oXbp1:type := XBPSTATIC_TYPE_GROUPBOX
   oXbp1:create()

   nBo := 2*nBh
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := "OB"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1a==1,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1a := 1, nG1b := 0 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := "MH"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1a==2,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1a := 2, nG1b := 0 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := "DU"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1a==3,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1a := 3, nG1b := 0 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := "BOT"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1a==4,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1a := 4, nG1b := 0 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := "E"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1a==5,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1a := 5, nG1b := 0 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := "GE"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1a==6,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1a := 6, nG1b := 0 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := "GL"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1a==7,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1a := 7, nG1b := 0 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := "sonst."
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1a==8,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1a := 8, nG1b := 0 }

   nR1 := nBG-n20
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {n20,nBh} )
   oXbp:caption := ""
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( (nG1a==0 .AND. nG1b==0),.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1a := 0, nG1b := 0 }

   nBo := 1*nBh
   nR1 := n10
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := ""
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1b==1,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1b := 1, nG1a := 0 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := ""
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1b==2,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1b := 2, nG1a := 0 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := ""
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1b==3,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1b := 3, nG1a := 0 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := ""
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1b==4,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1b := 4, nG1a := 0 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := ""
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1b==5,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1b := 5, nG1a := 0 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := ""
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1b==6,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1b := 6, nG1a := 0 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := ""
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1b==7,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1b := 7, nG1a := 0 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp1, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := ""
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG1b==8,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG1b := 8, nG1a := 0 }

   nBo := nRo-3*nBh
   nR1 := n10
   oXbp2 := XbpStatic():new( drawingArea, , {nR1,nBo}, {nBG,nBH2} )
//   oXbp1:caption := "Auftrag"
   oXbp2:clipSiblings := .T.
   oXbp2:type := XBPSTATIC_TYPE_GROUPBOX
   oXbp2:create()

   nBo := 1*nBh
   nR1 := n10
   oXbp := XbpRadiobutton():new( oXbp2, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Beh”rdenauftrag"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG2==1,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG2 := 1 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp2, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Vorvertrag"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG2==2,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG2 := 2 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp2, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Empfehlung"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG2==3,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG2 := 3 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp2, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := "Hausbestatter"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG2==4,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG2 := 4 }

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp2, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := "Neukunde"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG2==5,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG2 := 5 }

   nR1 := nBG-n20
   oXbp := XbpRadiobutton():new( oXbp2, , {nR1,nBo}, {n20,nBh} )
   oXbp:caption := ""
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG2==0,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG2 := 0 }

   nBo := nRo-6*nBh

   nR1 := n10
   oXbp3 := XbpStatic():new( drawingArea, , {nR1,nBo}, {nBG,nBH2} )
//   oXbp1:caption := "Gespr„chszeit"
   oXbp3:clipSiblings := .T.
   oXbp3:type := XBPSTATIC_TYPE_GROUPBOX
   oXbp3:create()

   nBo := 1*nBh
   oXbp := XbpStatic():new( oXbp3, , {nR1,nBo}, {nBl1,nBh} )
   oXbp:caption := "Gespr„chszeit:"
   oXbp:clipSiblings := .T.
   oXbp:options := XBPSTATIC_TEXT_VCENTER+XBPSTATIC_TEXT_RIGHT
   oXbp:create()
   nR1 := nR1+nR3
   oXbp := XbpStatic():new( oXbp3, , {nR1,nBo}, {n30,nBh} )
   oXbp:caption := "von:"
   oXbp:clipSiblings := .T.
   oXbp:options := XBPSTATIC_TEXT_VCENTER+XBPSTATIC_TEXT_RIGHT
   oXbp:create()
   nFa := 5 
   oXbp := XbpSLE():new( oXbp3, , {nR1+n30,nBo}, {nBl1,nBh}, { { XBP_PP_BGCLR, XBPSYSCLR_ENTRYFIELD } } )
   oXbp:bufferLength := nFa
   oXbp:tabStop := .T.
   oXbp:clipSiblings := .T.
   oXbp:setInputFocus  := {|mp1,mp2,obj| HiliteSle( obj ) }
   oXbp:killInputFocus := {|mp1,mp2,obj| DeHiliteSle( obj ) }
   oXbp:group := XBP_WITHIN_GROUP
   oXbp:dataLink := {|x| IIf( PCOUNT()==0, Transform( nAnf, '99.99' ), nAnf := ;
                Val( IIf( ","$x, Stuff( x, At(",",x), 1, "." ), x ) ) ) }
   oXbp:create():setData( IIf( nAnf==0, Trim( " " ), str( nAnf,5,2 ) ) )
   AAdd ( aEditControlsR, oXbp )

   nR1 := nR1+nR3
   oXbp := XbpStatic():new( oXbp3, , {nR1,nBo}, {n30,nBh} )
   oXbp:caption := "bis:"
   oXbp:clipSiblings := .T.
   oXbp:options := XBPSTATIC_TEXT_VCENTER+XBPSTATIC_TEXT_RIGHT
   oXbp:create()
   nFa := 5 
   oXbp := XbpSLE():new( oXbp3, , {nR1+n30,nBo}, {nBl1,nBh}, { { XBP_PP_BGCLR, XBPSYSCLR_ENTRYFIELD } } )
   oXbp:bufferLength := nFa
   oXbp:tabStop := .T.
   oXbp:clipSiblings := .T.
   oXbp:setInputFocus  := {|mp1,mp2,obj| HiliteSle( obj ) }
   oXbp:killInputFocus := {|mp1,mp2,obj| DeHiliteSle( obj ) }
   oXbp:group := XBP_WITHIN_GROUP
   oXbp:dataLink := {|x| IIf( PCOUNT()==0, Transform( nEnd, '99.99' ), nEnd := ;
                Val( IIf( ","$x, Stuff( x, At(",",x), 1, "." ), x ) ) ) }
   oXbp:create():setData( IIf( nEnd==0, Trim( " " ), str( nEnd,5,2 ) ) )
   AAdd ( aEditControlsR, oXbp )

   nR1 := nR1+nR3
   oXbp := XbpStatic():new( oXbp3, , {nR1,nBo}, {n30,nBh} )
   oXbp:caption := "Dat:"
   oXbp:clipSiblings := .T.
   oXbp:options := XBPSTATIC_TEXT_VCENTER+XBPSTATIC_TEXT_RIGHT
   oXbp:create()
   nFa := 10 
   oXbp := XbpSLE():new( oXbp3, , {nR1+n30,nBo}, {nBl1,nBh}, { { XBP_PP_BGCLR, XBPSYSCLR_ENTRYFIELD } } )
   oXbp:bufferLength := nFa
   oXbp:tabStop := .T.
   oXbp:clipSiblings := .T.
   oXbp:setInputFocus  := {|mp1,mp2,obj| HiliteSle( obj ) }
   oXbp:killInputFocus := {|mp1,mp2,obj| DeHiliteSle( obj ) }
   oXbp:group := XBP_WITHIN_GROUP
   oXbp:dataLink := {|x| IIf( PCOUNT()==0, ;
                        IIf( DtoC( dDat )=" ", trim(" "), DtoC( dDat )), ;
                        IIf( len(x)<7, dDat := CtoD(x+str(year(date(),4,0))), ;
                        dDat := CtoD(x) ) ) }
   oXbp:create():setData( IIf( ValType(dDat)=="D", ;
                          IIf( DtoC(dDat)=" ", TRIM(" "), DtoC(dDat)), ) )
   AAdd ( aEditControlsR, oXbp )

   nBo := nRo-10*nBh
   nR1 := n10
   oXbp4 := XbpStatic():new( drawingArea, , {nR1,nBo}, {nBG,nBH3} )
//   oXbp1:caption := "Gespr„chsort"
   oXbp4:clipSiblings := .T.
   oXbp4:type := XBPSTATIC_TYPE_GROUPBOX
   oXbp4:create()

   nBo := 2*nBh
   nR1 := n10
   oXbp := XbpStatic():new( oXbp4, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Gespr„chsort:"
   oXbp:clipSiblings := .T.
   oXbp:create()

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp4, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Trauerhaus"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG3==1,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG3 := 1 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp4, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Zentrale"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG3==2,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG3 := 2 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp4, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Filiale"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG3==3,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG3 := 3 }

   nR1 := nBG-n20
   oXbp := XbpRadiobutton():new( oXbp4, , {nR1,nBo}, {n20,nBh} )
   oXbp:caption := ""
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG3==0,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG3 := 0 }

   nBo := nBh
   nR1 := 3*nR3
   nFa := 14
   oXbp := XbpSLE():new( oXbp4, , {nR1,nBo}, {nBl1,nBh}, { { XBP_PP_BGCLR, XBPSYSCLR_ENTRYFIELD } } )
   oXbp:bufferLength := nFa
   oXbp:tabStop := .T.
   oXbp:clipSiblings := .T.
   oXbp:setInputFocus  := {|mp1,mp2,obj| HiliteSle( obj ) }
   oXbp:killInputFocus := {|mp1,mp2,obj| DeHiliteSle( obj ) }
   oXbp:group := XBP_WITHIN_GROUP
   oXbp:dataLink := {|x| IIf( PCOUNT()==0, Trim( cSONST2a ), cSONST2a := x ) }
   oXbp:create():setData( Trim( cSonst2a ) )
   AAdd ( aEditControlsR, oXbp )

   nBo := nRo-13*nBh
   nR1 := n10
   oXbp5 := XbpStatic():new( drawingArea, , {nR1,nBo}, {nBG,nBH2} )
   oXbp5:caption := "Das Gespr„ch ist zustande gekommen, weil der Kunde:                        /         weil:"
   oXbp5:clipSiblings := .T.
   oXbp5:type := XBPSTATIC_TYPE_GROUPBOX
   oXbp5:create()

   nBo := 1*nBh
   nR1 := n10
   oXbp := XbpRadiobutton():new( oXbp5, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "angerufen hat"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG4==1,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG4 := 1 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp5, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "geklingelt hat"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG4==2,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG4 := 2 }

   nBo := nBh
   nR1 := nR1+nR2
   nFa := 14
   oXbp := XbpSLE():new( oXbp5, , {nR1,nBo}, {nBl1,nBh}, { { XBP_PP_BGCLR, XBPSYSCLR_ENTRYFIELD } } )
   oXbp:bufferLength := nFa
   oXbp:tabStop := .T.
   oXbp:clipSiblings := .T.
   oXbp:setInputFocus  := {|mp1,mp2,obj| HiliteSle( obj ) }
   oXbp:killInputFocus := {|mp1,mp2,obj| DeHiliteSle( obj ) }
   oXbp:group := XBP_WITHIN_GROUP
   oXbp:dataLink := {|x| IIf( PCOUNT()==0, Trim( cSONST2b ), cSONST2b := x ) }
   oXbp:create():setData( Trim( cSonst2b ) )
   AAdd ( aEditControlsR, oXbp )

   nR1 := nR1+nR2
   oXbp := XbpRadiobutton():new( oXbp5, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "KH/Heim angerufen hat"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG4==3,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG4 := 3 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp5, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Filiale besetzt war"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG4==4,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG4 := 4 }

   nR1 := nBG-n20
   oXbp := XbpRadiobutton():new( oXbp5, , {nR1,nBo}, {n20,nBh} )
   oXbp:caption := ""
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG4==0,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG4 := 0 }

   nBo := nRo-18*nBh
   nR1 := n10
   oXbp6 := XbpStatic():new( drawingArea, , {nR1,nBo}, {nBG,nBH4} )
   oXbp6:caption := "Wie wurden Sie auf uns aufmerksam?"
   oXbp6:clipSiblings := .T.
   oXbp6:type := XBPSTATIC_TYPE_GROUPBOX
   oXbp6:create()

   nBo := 3*nBh
   nR1 := n10
   oXbp := XbpRadiobutton():new( oXbp6, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Internet"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG5==1,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG5 := 1 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp6, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Tageszeitung"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG5==2,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG5 := 2 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp6, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Wochenanzeiger"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG5==3,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG5 := 3 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp6, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "sonstiges"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG5==4,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG5 := 4 }

   nR1 := nBG-n20
   oXbp := XbpRadiobutton():new( oXbp6, , {nR1,nBo}, {n20,nBh} )
   oXbp:caption := ""
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG5==0,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG5 := 0 }

   nBo := 2*nBh
   nR1 := n10
   oXbp := XbpRadiobutton():new( oXbp6, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Filialn„he"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG5==5,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG5 := 5 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp6, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "V-Karte"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG5==6,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG5 := 6 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp6, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "™rtliches"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG5==7,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG5 := 7 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp6, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Gelbe Seiten"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG5==8,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG5 := 8 }

   nBo := nBh
   nR1 := 3*nR3
   nFa := 28
   oXbp := XbpSLE():new( oXbp6, , {nR1,nBo}, {nBl2,nBh}, { { XBP_PP_BGCLR, XBPSYSCLR_ENTRYFIELD } } )
   oXbp:bufferLength := nFa
   oXbp:tabStop := .T.
   oXbp:clipSiblings := .T.
   oXbp:setInputFocus  := {|mp1,mp2,obj| HiliteSle( obj ) }
   oXbp:killInputFocus := {|mp1,mp2,obj| DeHiliteSle( obj ) }
   oXbp:group := XBP_WITHIN_GROUP
   oXbp:dataLink := {|x| IIf( PCOUNT()==0, Trim( 1->SONST3 ), 1->SONST3 := x ) }
   oXbp:create():setData()
   AAdd ( aEditControlsR, oXbp )

   nBo := nRo-22*nBh
   nR1 := n10
   oXbp7 := XbpStatic():new( drawingArea, , {nR1,nBo}, {nBG,nBH3} )
   oXbp7:caption := "Wo haben Sie unsere Telefonnummer gefunden?"
   oXbp7:clipSiblings := .T.
   oXbp7:type := XBPSTATIC_TYPE_GROUPBOX
   oXbp7:create()

   nBo := 2*nBh
   nR1 := n10
   oXbp := XbpRadiobutton():new( oXbp7, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Internet"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG6==1,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG6 := 1 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp7, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Tageszeitung"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG6==2,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG6 := 2 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp7, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Wochenanzeiger"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG6==3,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG6 := 3 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp7, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "kein Anr./bekannt"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG6==4,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG6 := 4 }

   nR1 := nBG-n20
   oXbp := XbpRadiobutton():new( oXbp7, , {nR1,nBo}, {n20,nBh} )
   oXbp:caption := ""
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG6==0,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG6 := 0 }

   nBo := 1*nBh
   nR1 := n10
   oXbp := XbpRadiobutton():new( oXbp7, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Filiale"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG6==5,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG6 := 5 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp7, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "V-Karte"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG6==6,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG6 := 6 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp7, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "™rtliches"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG6==7,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG6 := 7 }

   nR1 := nR1+nR3
   oXbp := XbpRadiobutton():new( oXbp7, , {nR1,nBo}, {nBl2,nBh} )
   oXbp:caption := "Gelbe Seiten"
   oXbp:clipSiblings := .T.
   oXbp:selection := IIf( nG6==8,.T.,.F. )
   oXbp:create()
   oXbp:selected := {|| nG6 := 8 }

   oDlg:show()
   oFocus := SetAppFocus( oDlg )

   oDlg:setModalState( XBP_DISP_APPMODAL )


   nEvent := xbe_None
   DO WHILE nEvent <> xbeP_Close
      nEvent := AppEvent( @mp1, @mp2, @oXbp )
      IF nEvent == xbeP_Keyboard
         DO CASE
            CASE mp1 == xbeK_ESC .or. mp1 == xbeK_F10
               PostAppEvent( xbeP_Close )
            CASE mp1 == xbeK_ALT_D
               StatistikSDr( nG1a, nG1b, nG2, nG3, nG4, nG5, nG6, cSonst2a, ;
                                cSonst2b, 1->Sonst3, nAnf, nEnd, dDat )
         ENDCASE
      ENDIF
      oXbp:handleEvent( nEvent, mp1, mp2 )
   ENDDO
   Satzsp()
   Gather( aEditcontrolsR )
   cSonst1 := "~"+str(nG1a,1,0)+str(nG1b,1,0)+str(nG2,1,0)+str(nG3,1,0)+ ;
                str(nG4,1,0)+str(nG5,1,0)+str(nG6,1,0)+str(nAnf,5,2)+ ;
                   str(nEnd,5,2)+DtoC(dDat)
   REPLACE 1->SONST1 with cSonst1
   cSonst2 := Padr(cSonst2a,14) + Padr(cSonst2b,14)
   REPLACE 1->SONST2 with cSonst2
   1->(DbCommit())	//24.06.2026 11:01
   1->(DbRUnlock())	//24.06.2026 11:01
   oDlg:setModalState( XBP_DISP_MODELESS )
   oDlg:destroy()
   SetAppFocus( oFocus )
RETURN

FUNCTION Dings()
   oXbp := XbpRadiobutton():new( oXbp1, , {8,32}, {128,24} )
   oXbp:caption := "Radiobutton"
   oXbp:clipSiblings := .T.
   oXbp:create()
   oXbp:selected := {|| NIL }

   oXbp := XbpRadiobutton():new( oXbp1, , {8,8}, {120,24} )
   oXbp:caption := "Radiobutton"
   oXbp:clipSiblings := .T.
   oXbp:create()
   oXbp:selected := {|| NIL }

   oXbp2 := XbpStatic():new( drawingArea, , {232,200}, {120,104} )
   oXbp2:caption := "Gruppe"
   oXbp2:clipSiblings := .T.
   oXbp2:type := XBPSTATIC_TYPE_GROUPBOX
   oXbp2:create()

   oXbp := XbpCheckbox():new( oXbp2, , {8,56}, {104,24} )
   oXbp:caption := "Checkbox"
   oXbp:clipSiblings := .T.
   oXbp:create()
   oXbp:selected := {|| NIL }

   oXbp := XbpCheckbox():new( oXbp2, , {8,32}, {104,24} )
   oXbp:caption := "Checkbox"
   oXbp:clipSiblings := .T.
   oXbp:create()
   oXbp:selected := {|| NIL }

   oXbp := XbpCheckbox():new( oXbp2, , {8,8}, {104,24} )
   oXbp:caption := "Checkbox"
   oXbp:clipSiblings := .T.
   oXbp:create()
   oXbp:selected := {|| NIL }

RETURN NIL

PROCEDURE StatistikSDr( nG1a, nG1b, nG2, nG3, nG4, nG5, nG6, cSonst2a, ;
                                cSonst2b, cSonst3, nAnf, nEnd, dDat )
   LOCAL nZei := 30 , nSpa := 10 , nP := 0 , n7 := 7, n14 := 14
   LOCAL aItem := {} , aWochtag := {}
   SET DEVICE TO PRINTER
   @ nZei,nSpa SAY "Eine pers”nliche Frage an die Angeh”rigen"
   aItem := { "OB", "MH", "DU", "BOT", "E", "GE", "GL", "sonst." }
   FOR nP = 0 TO 7
      nZei := KreuzDr( nZei, n7, nP, nG1a, aItem[nP+1] )
   NEXT
   aItem := { " ", " ", " ", " ", " ", " ", " ", " " }
   FOR nP = 0 TO 7
      nZei := KreuzDr( nZei, n7, nP, nG1b, aItem[nP+1] )
   NEXT
   ++nZei
   aItem := { "Beh”rde", "Vorvertr.", "Empf.", "Hausbestatter", "Neukunde" }
   FOR nP = 0 TO 4
      nZei := KreuzDr( nZei, n14, nP, nG2, aItem[nP+1] )
   NEXT
   ++nZei
   @ ++nZei,nSpa SAY "Gespr.zeit: "
   @ nZei,nSpa+n14 SAY "von: " + Str(nAnf,5,2)
   @ nZei,nSpa+2*n14 SAY "bis: " + Str(nEnd,5,2)
   @ nZei,nSpa+3*n14 SAY "Dat.: " + DtoC(dDat)
   ++nZei
   @ ++nZei,nSpa SAY "Gespr.ort: "
   aItem := { ,"Trauerhaus", "Zentrale", "Filiale" }
   FOR nP = 1 to 3
      nZei := KreuzDr( nZei, n14, nP, nG3, aItem[nP+1] )
   NEXT
   ++nZei
   @ nZei,nSpa+3*n14 SAY cSonst2a
   ++nZei
   @ ++nZei,nSpa SAY "Das Gespr„ch ist zustande gekommen, weil der Kunde"
   aItem := { "angerufen", "geklingelt", "KH/Heim", "Fil.besetzt" }
   FOR nP = 0 to 3
      nZei := KreuzDr( nZei, n14, nP, nG4, aItem[nP+1] )
   NEXT
   ++nZei
   @ nZei,nSpa+n14 SAY cSonst2b
   ++nZei
   @ ++nZei,nSpa SAY "Wie wurden Sie auf uns aufmerksam?"
   aItem := { "Internet", "Tageszeit.", "Wochenanz.", "sonstiges", ;
                "Filialn„he", "V-Karte", "™rtliches", "Gelbe Seiten" }
   FOR nP = 0 to 7
      nZei := KreuzDr( nZei, n14, nP, nG5, aItem[nP+1] )
   NEXT
   ++nZei
   @ nZei,nSpa+3*n14 SAY 1->sonst3
   ++nZei
   @ ++nZei,nSpa SAY "Wo haben Sie unsere Telefonnummer gefunden?"
   aItem := { "Internet", "Tageszeit.", "Wochenanz.", "keinAnr/bekannt", ;
                "Filialn„he", "V-Karte", "™rtliches", "Gelbe Seiten" }
   FOR nP = 0 to 7
      nZei := KreuzDr( nZei, n14, nP, nG5, aItem[nP+1] )
   NEXT
   ++nZei
   ++nZei
   @ ++nZei,nSpa SAY "Name: " + 1->name
   @ nZei,nSpa+2*n14 SAY "Nr.: " + Str( 1->auftrnr, 6, 0 )
   ++nZei
   IF DtoC( 1->gestorben ) <> " "
      aWochtag := { "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", ;
                    "Freitag", "Samstag" }
      @ ++nZei,nSpa SAY "Tag.: " + aWochtag[DoW( 1->gestorben )]
      @ nZei,nSpa+2*n14 SAY "Datum: " + DtoC( 1->gestorben )
   ENDIF
   EJECT
   SET DEVICE TO SCREEN
RETURN

FUNCTION KreuzDr( nZeile, nStep, nPosition, nItem, cItem )
   LOCAL cKreuz := IIf( nPosition+1==nItem, "x ", "o " )
   LOCAL nSpalte := 10 + nStep*(IIf( (nStep>10 .AND. nPosition>3), ;
                                (nPosition-4), nPosition ) )
   nZeile := IIf( nSpalte == 10, ++nZeile, nZeile )
   @ nZeile,nSpalte SAY cKreuz + cItem
RETURN nZeile


