//////////////////////////////////////////////////////////////////////
//  BlattFA1.PRG
//
//  BlattFA aus AKDialogVHs.PRG
//
//  Inhalt:
//      Klasse BlattFA
//////////////////////////////////////////////////////////////////////
///////////////////////////////////
#include "Gra.ch"
#include "Xbp.ch"
#include "Dmlb.ch"
#include "Common.ch"
#include "Appevent.ch"
#include "AKDialog.ch"
#include "Dll.ch"

//********************************************************************************
//********************************************************************************

CLASS BlattFA
   PROTECTED:
     VAR appendMode              // Wird ein neuer Datensatz angelegt?
     VAR appendControls          // XBPs, die nur bei APPEND
                                 // aktiv sind
     VAR keyControls             // Liste von XBPs fr Tastaturnavigation
     VAR keyboardBlock           // Codeblock fr xbeP_Keyboard Ereignisse
   EXPORTED:
     VAR editControls            // XBPs, die Daten „ndern
     VAR LeditC                  // L„nge des Arrays editControls
   VAR BEArea
   VAR BENr
   VAR TabSeite                  //+23.04.2009 12:04
   VAR TSNr                      //+23.04.2009 12:04
   VAR ScrollSeite               //+24.04.2009 11:15
   VAR SPNr                      //+24.04.2009 11:15
////   VAR BrowseFeld
////   VAR BFNr
//////   VAR BVariable
//////   VAR BVNr
   VAR GruppenBox
   VAR GBNr
   VAR TextZeile
   VAR TZNr
   VAR DruckKnopf
   VAR DKNr
   VAR MultiZeile
   VAR MZNr
   VAR SingleZeile
   VAR SZNr
   VAR aBlatt                    // Array, in dem die Blatt-Aufbau-Information steckt
   VAR aBlattZ
   VAR aSeite
   VAR aNa
   VAR aPrompt
   VAR aText
   VAR aTFont
   VAR aBereich
   VAR aFeld
   VAR aFFont
   VAR aZei
   VAR aSpa
   VAR aParam                    // Array, in dem die Blatt-Aufbau-Information steckt
   VAR aSeiteP
   VAR aNaP
   VAR aPromptP
   VAR aTextP
   VAR aTFontP
   VAR aBereichP
   VAR aFeldP
   VAR aFFontP
   VAR aZeiP
   VAR aSpaP
   VAR Vorschau
   METHOD INIT
   METHOD CREATE
   METHOD destroy
     METHOD addEditControl       // XBP fr Edit registrieren
     METHOD addAppendControl     // XBP fr Append registrieren
     METHOD addKeyControl        // XBP fr Keyboard handling registrieren
//     METHOD notify
   METHOD Such                   // „hnlich :Such() bei DialogFF  16.07.2006 10:12
ENDCLASS

METHOD BlattFA:INIT( oParent, oOwner, aPos, ASize, aPP, lVisible, nBz, aBlattG, aParamG )
   LOCAL aPPTxt := { { XBP_PP_FGCLR       , GRA_CLR_BLACK    } , ;
                     { XBP_PP_BGCLR       , XBPSYSCLR_DIALOGBACKGROUND } }
   DEFAULT aPP TO {{ XBP_PP_COMPOUNDNAME, IIf(nV>1.5,"12.Arial",IIf(nV>1,"10.Arial","8.Arial")) }}
   PRIVATE nLineSpace := nBz, nScrollPageHeight := 1500     //+23.04.2009 12:25
   AEval( aPP, {|a,x| AAdd(aPPTxt,a) } ) //23.03.2008 18:05
   
   ::BEArea := {}
   ::BENr := 0
   AAdd( ::BEArea, oParent )
   ::BENr := Len( ::BEArea )
   ::TabSeite := {}              //+23.04.2009 12:05
   ::TSNr := 0                   //+23.04.2009 12:05
   ::ScrollSeite := {}
   ::SPNr := 0
      // Erste TabPage ist maximiert
   IF !Upper(AppName())$"MUELLX.EXE-BLEINX.EXE-VELLX.EXE-GUDDX.EXE-NOLTEX.EXE" //+21.11.2010 13:34
      AAdd( ::BEArea, XbpTabPage():new( oParent, oOwner, aPos, aSize, aPPTxt, lVisible ) )
      ::BEArea[++::BENr]:caption   := "~Parameter"
      ::BEArea[::BENr]:clipSiblings  := .T.
      ::BEArea[::BENr]:tabStop  := .T.
      ::BEArea[::BENr]:tabHeight  := 20*nV   //07.04.2008 18:30
      ::BEArea[::BENr]:preOffset  := 0
      ::BEArea[::BENr]:postOffset := 80
      ::BEArea[::BENr]:create()
      ::BEArea[::BENr]:helpLink := MagicHelpLabel():New(707)
      ::BEArea[::BENr]:maximize()
      ::BEArea[::BENr]:minimize()
      ::BEArea[::BENr]:maximize()
      ::BEArea[::BENr]:minimized := .F.
      ::BEArea[::BENr]:TabActivate := {|m,n,o| n := AScan(::BEArea,o), ;
                                       ::BEArea[n+1]:minimize(), ::BEArea[n+2]:minimize(),;
                                       o:maximize(), IIf(Empty(o:childList()), SetAppFocus(o), ;
                                       SetAppFocus(o:childList()[1])) }
   ELSE
      AAdd( ::TabSeite, XbpTabPage():new( oParent, oOwner, aPos, aSize, aPPTxt, lVisible ) )
      ::TabSeite[++::TSNr]:caption   := "~Parameter"
      ::TabSeite[::TSNr]:clipSiblings  := .T.
      ::TabSeite[::TSNr]:tabStop  := .T.
      ::TabSeite[::TSNr]:tabHeight  := 20*nV   //07.04.2008 18:30
      ::TabSeite[::TSNr]:preOffset  := 0
      ::TabSeite[::TSNr]:postOffset := 80
      ::TabSeite[::TSNr]:create()
      ::TabSeite[::TSNr]:helpLink := MagicHelpLabel():New(707)
      ::TabSeite[::TSNr]:maximize()
      ::TabSeite[::TSNr]:minimize()
      ::TabSeite[::TSNr]:maximize()
      ::TabSeite[::TSNr]:minimized := .F.
      ::TabSeite[::TSNr]:TabActivate := {|m,n,o| n := AScan(::TabSeite,o), ;
                                       ::TabSeite[n+1]:minimize(), ::TabSeite[n+2]:minimize(),;
                                       o:maximize(), IIf(Empty(o:childList()), SetAppFocus(o), ;
                                       SetAppFocus(o:childList()[1])) }
      AAdd( ::ScrollSeite, DataEntryScrollPage():new( ::TabSeite[::TSNr], { 0, 0},;
                                           { ::TabSeite[::TSNr]:currentsize()[1], ::TabSeite[::TSNr]:currentsize()[2]-20 },;
                                           nScrollPageHeight ) )
      ::ScrollSeite[++::SPNr]:Create()
      ::ScrollSeite[::SPNr]:nStep := nLineSpace
   
      AAdd( ::BEArea, ::ScrollSeite[::SPNr]:oScrollPage:drawingarea )
      ++::BENr
   ENDIF
      // Zweite TabPage ist minimiert
   IF !Upper(AppName())$"MUELLX.EXE-BLEINX.EXE-VELLX.EXE-GUDDX.EXE-NOLTEX.EXE" //+21.11.2010 13:34
      AAdd( ::BEArea, XbpTabPage():new( oParent, oOwner, aPos, aSize, aPPTxt, lVisible ) )
      ::BEArea[++::BENr]:caption    := "Da~ten-1"
      ::BEArea[::BENr]:clipSiblings  := .T.
      ::BEArea[::BENr]:tabStop  := .T.
      ::BEArea[::BENr]:tabHeight  := 20*nV   //07.04.2008 18:30
      ::BEArea[::BENr]:preOffset  := 20
      ::BEArea[::BENr]:postOffset := 60
      ::BEArea[::BENr]:create()
      ::BEArea[::BENr]:helpLink := MagicHelpLabel():New(708)
      ::BEArea[::BENr]:maximize()
      ::BEArea[::BENr]:minimize()
   //   ::BEArea[::BENr]:TabActivate := {|| ::BEArea[::BENr-1]:minimize(), ::BEArea[::BENr+1]:minimize(),;
   //                                       ::BEArea[::BENr]:maximize(), SetAppFocus(::BEArea[::BENr]) }
      ::BEArea[::BENr]:TabActivate := {|m,n,o| n := AScan(::BEArea,o), ;
                                       ::BEArea[n-1]:minimize(), ::BEArea[n+1]:minimize(),;
                                       o:maximize(), IIf(Empty(o:childList()), SetAppFocus(o), ;
                                       SetAppFocus(o:childList()[1])) }
   ELSE
      AAdd( ::TabSeite, XbpTabPage():new( oParent, oOwner, aPos, aSize, aPPTxt, lVisible ) )
      ::TabSeite[++::TSNr]:caption    := "Da~ten-1"
      ::TabSeite[::TSNr]:clipSiblings  := .T.
      ::TabSeite[::TSNr]:tabStop  := .T.
      ::TabSeite[::TSNr]:tabHeight  := 20*nV   //07.04.2008 18:30
      ::TabSeite[::TSNr]:preOffset  := 20
      ::TabSeite[::TSNr]:postOffset := 60
      ::TabSeite[::TSNr]:create()
      ::TabSeite[::TSNr]:helpLink := MagicHelpLabel():New(708)
      ::TabSeite[::TSNr]:maximize()
      ::TabSeite[::TSNr]:minimize()
      ::TabSeite[::TSNr]:TabActivate := {|m,n,o| n := AScan(::TabSeite,o), ;
                                       ::TabSeite[n-1]:minimize(), ::TabSeite[n+1]:minimize(),;
                                       o:maximize(), IIf(Empty(o:childList()), SetAppFocus(o), ;
                                       SetAppFocus(o:childList()[1])) }
      AAdd( ::ScrollSeite, DataEntryScrollPage():new( ::TabSeite[::TSNr], { 0, 0},;
                                           { ::TabSeite[::TSNr]:currentsize()[1], ::TabSeite[::TSNr]:currentsize()[2]-20 },;
                                           nScrollPageHeight ) )
      ::ScrollSeite[++::SPNr]:Create()
      ::ScrollSeite[::SPNr]:nStep := nLineSpace
   
      AAdd( ::BEArea, ::ScrollSeite[::SPNr]:oScrollPage:drawingarea )
      ++::BENr
   ENDIF
      // Dritte TabPage ist minimiert
   IF !Upper(AppName())$"MUELLX.EXE-BLEINX.EXE-VELLX.EXE-GUDDX.EXE-NOLTEX.EXE" //+21.11.2010 13:34
      AAdd( ::BEArea, XbpTabPage():new( oParent, oOwner, aPos, aSize, aPPTxt, lVisible ) )
      ::BEArea[++::BENr]:caption    := "Para~meter-2"
      ::BEArea[::BENr]:clipSiblings  := .T.
      ::BEArea[::BENr]:tabStop  := .T.
      ::BEArea[::BENr]:tabHeight  := 20*nV   //07.04.2008 18:30
      ::BEArea[::BENr]:preOffset  := 40
      ::BEArea[::BENr]:postOffset := 40
      ::BEArea[::BENr]:create()
      ::BEArea[::BENr]:helpLink := MagicHelpLabel():New(709)
      ::BEArea[::BENr]:maximize()
      ::BEArea[::BENr]:minimize()
   //   ::BEArea[::BENr]:TabActivate := {|| ::BEArea[::BENr-2]:minimize(), ::BEArea[::BENr-1]:minimize(),;
   //                                       ::BEArea[::BENr]:maximize(), SetAppFocus(::BEArea[::BENr]) }
      ::BEArea[::BENr]:TabActivate := {|m,n,o| n := AScan(::BEArea,o), ;
                                       ::BEArea[n-2]:minimize(), ::BEArea[n-1]:minimize(),;
                                       o:maximize(), IIf(Empty(o:childList()), SetAppFocus(o), ;
                                       SetAppFocus(o:childList()[1])) }
   ELSE
      AAdd( ::TabSeite, XbpTabPage():new( oParent, oOwner, aPos, aSize, aPPTxt, lVisible ) )
      ::TabSeite[++::TSNr]:caption    := "Para~meter-2"
      ::TabSeite[::TSNr]:clipSiblings  := .T.
      ::TabSeite[::TSNr]:tabStop  := .T.
      ::TabSeite[::TSNr]:tabHeight  := 20*nV   //07.04.2008 18:30
      ::TabSeite[::TSNr]:preOffset  := 40
      ::TabSeite[::TSNr]:postOffset := 40
      ::TabSeite[::TSNr]:create()
      ::TabSeite[::TSNr]:helpLink := MagicHelpLabel():New(709)
      ::TabSeite[::TSNr]:maximize()
      ::TabSeite[::TSNr]:minimize()
      ::TabSeite[::TSNr]:TabActivate := {|m,n,o| n := AScan(::TabSeite,o), ;
                                       ::TabSeite[n-2]:minimize(), ::TabSeite[n-1]:minimize(),;
                                       o:maximize(), IIf(Empty(o:childList()), SetAppFocus(o), ;
                                       SetAppFocus(o:childList()[1])) }
      AAdd( ::ScrollSeite, DataEntryScrollPage():new( ::TabSeite[::TSNr], { 0, 0},;
                                           { ::TabSeite[::TSNr]:currentsize()[1], ::TabSeite[::TSNr]:currentsize()[2]-20 },;
                                           nScrollPageHeight ) )
      ::ScrollSeite[++::SPNr]:Create()
      ::ScrollSeite[::SPNr]:nStep := nLineSpace
   
      AAdd( ::BEArea, ::ScrollSeite[::SPNr]:oScrollPage:drawingarea )
      ++::BENr
   ENDIF
////   ::BrowseFeld := {}
////   ::BFNr := 0
//////   ::BVariable  := {}
//////   ::BVNr := 0
   ::GruppenBox := {}
   ::GBNr := 0
   ::TextZeile := {}
   ::TZNr := 0
   ::DruckKnopf := {}
   ::DKNr := 0
   ::MultiZeile := {}
   ::MZNr := 0
   ::SingleZeile := {}
   ::SZNr := 0
   ::editControls    := {}
   ::appendControls  := {}
   ::keyControls     := {}
   ::keyboardBlock   := {|nKey,x,obj| ::keyHandler( nKey, obj ) }
   ::aBlatt := aBlattG
   ::aBlattZ := {}
   ::aSeite := {}
   ::aNa    := {}
   ::aPrompt := {}
   ::aText  := {}
   ::aTFont := {}
   ::aBereich := {}
   ::aFeld  := {}
   ::aFFont := {}
   ::aZei   := {}
   ::aSpa   := {}
   ::aParam := aParamG
   ::aSeiteP := {}
   ::aNaP    := {}
   ::aPromptP := {}
   ::aTextP  := {}
   ::aTFontP := {}
   ::aBereichP := {}
   ::aFeldP  := {}
   ::aFFontP := {}
   ::aZeiP   := {}
   ::aSpaP   := {}
RETURN self

//METHOD DialogFF:CREATE( oParent, oOwner, aPos, ASize, aPP, lVisible, nBz, cFF, nAnf, nEnd, nA )
METHOD BlattFA:CREATE( oParent, oOwner, aPos, ASize, aPP, lVisible, nBz )
   LOCAL oXbp  //nH, nV := AppDesktop():currentSize()[1]/800, [2]/600 waagrecht:nH, senkrecht:nV
   LOCAL nBo := ( AppDesktop():currentSize()[2]-60*nV), nBr := 7, nHv := nBz, nHt := nBz //*0.8
   LOCAL nZeiF := nBo, nZeiT := nBo, aPosT, aSizeT, aPosF, aSizeF
   LOCAL aPPSle := { { XBP_PP_FGCLR       , GRA_CLR_BLACK    } , ;
                     { XBP_PP_BGCLR, XBPSYSCLR_ENTRYFIELD } }     //24.03.2008 17:02, ;
//                     { XBP_PP_COMPOUNDNAME, IIf(nV>1.5,"12.Arial",IIf(nV>1,"10.Arial","8.Arial")) } }
//   LOCAL aPPTxt := { { XBP_PP_FGCLR       , GRA_CLR_BLACK    } , ;
//                     { XBP_PP_BGCLR       , XBPSYSCLR_DIALOGBACKGROUND } , ;
//                     { XBP_PP_COMPOUNDNAME, IIf(nV>1.5,"12.Arial",IIf(nV>1,"10.Arial","8.Arial")) } }
   LOCAL nOldArea := SELECT(), i, j, y, cFeld, cText, nSpa, nZei // !TEST
   LOCAL nFA := IIf(Upper(AppName())$"BERGX.EXE",70,100), nZ4:=0
   LOCAL aPPTxt := { { XBP_PP_FGCLR       , GRA_CLR_BLACK    } , ;
                     { XBP_PP_BGCLR       , XBPSYSCLR_DIALOGBACKGROUND } }
   PRIVATE bT, cB, cF, xF

   DEFAULT aPP TO {{ XBP_PP_COMPOUNDNAME, IIf(nV>1.5,"12.Arial",IIf(nV>1,"10.Arial","8.Arial")) }}
   AEval( aPP, {|a,x| AAdd(aPPTxt,a) } ) //23.03.2008 18:05
   AEval( aPP, {|a,x| AAdd(aPPSle,a) } ) //24.03.2008 17:02

////////**23.03.2008 12:16://///////////////////////////////////
//////   IF cBfont != NIL
//////      IIf(Val(cBfont)>5, aPPTxt := {{ XBP_PP_COMPOUNDNAME, Trim(cBfont) }}, ;
//////                           cBfont := IIf(nV>1.5,"12.Arial",IIf(nV>1,"10.Arial","8.Arial")) ) 
//////   ENDIF
//////   DEFAULT aPP TO aPPTxt
////////**

////   ::aParam := aParamG
   FOR j := 1 TO Len(::aParam)
      ::aBlattZ := ::aParam[j]
      AAdd( ::aSeiteP, ::aBlattZ[1], j )
      AAdd( ::aNaP, ::aBlattZ[2], j )
      AAdd( ::aPromptP, ::aBlattZ[3], j )
      AAdd( ::aTextP, ::aBlattZ[4], j )
      AAdd( ::aTFontP, ::aBlattZ[5], j )
      AAdd( ::aBereichP, ::aBlattZ[6], j )
      AAdd( ::aFeldP, ::aBlattZ[7], j )         // Feldbezeichnung
      AAdd( ::aFFontP, ::aBlattZ[8], j )
      AAdd( ::aZeiP, ::aBlattZ[9], j )
      AAdd( ::aSpaP, ::aBlattZ[10], j )
      IF j > 1
          nZei := IIf( ::aZeiP[j] < -1, -1, IIf(::aZeiP[j]=0, -1, ::aZeiP[j] ) )
                  //IIf( ::aBlattZ[9]<1, nZei - ::aBlattZ[9], ::aBlattZ[9] )
          nSpa := IIf( ::aBlattZ[10]<1, (nSpa + Len(Trim(::aTextP[j-1])) ;
                               + Len(Trim(::aFeldP[j-1])) - ::aBlattZ[10]), ::aBlattZ[10] )
      ELSE
         nZei := IIf( ::aZeiP[j] > 2, 2, IIf( ::aZeiP[j] < 1, 1, ::aZeiP[j]) )
         nSpa := ::aSpaP[j]
      ENDIF
      IF Upper( ::aSeiteP[j] ) = "P" .AND. ::aZeiP[j] > 0
//    zuerst kommt der Prompt-Text :
         aSizeT := ::BEArea[2]:currentSize()
         nZeiF := IIf( nZei < 1, nZeiF+nHv*nZei, aSizeT[2]-nHv-IIf(Len(::aParam)>20,1,1.5)*nHv*nZei )
         aPosF := {Int(0), nZeiF} ; aSizeF := {aSizeT[1]*.2,Int(nHv)}
         AAdd( ::TextZeile, MStatic():new( ::BEArea[2], , aPosF, aSizeF, aPPTxt,, ;
                                             XBPSTATIC_TYPE_TEXT, Trim(::aPromptP[j]) ) )
         ++::TZNr
         IIf( nV<=1, ::TextZeile[::TZNr]:setFontCompoundName( "8.Arial" ), )
//         ::XbpStatic:options := XBPSTATIC_TEXT_VCENTER+XBPSTATIC_TEXT_LEFT
         ::TextZeile[::TZNr]:create(::BEArea[2], , aPosF, aSizeF, aPPTxt,, ;
                                             XBPSTATIC_TYPE_TEXT, Trim(::aPromptP[j]) ) //23.03.2008 22:53
//    ...und dann der Eingabe-Sle :
////            ::aTextP[j] := IIf(SET(43)==0,ConvToAnsiCP(::aTextP[j]),::aTextP[j])
            ::aTextP[j] := PadR( ::aTextP[j], nFA )
         aPosF := {aSizeT[1]*.2, nZeiF} ; aSizeF := {aSizeT[1]*.78,Int(nHv)}
//         AAdd( ::SingleZeile, MGetX():new( ::BEArea[2], , aPosF, aSizeF, aPPSle,, ;
//                                             0, nFA, , , ;
//                                             , , , ::aTextP, j ) )
            AAdd( ::SingleZeile, MGetXR():new( ::BEArea[2], , aPosF, aSizeF, aPPSle,, ;
                                                @::aTextP[j], nFa, .T.,  , ;
                                                , , , , nA ) )
         ++::SZNr
         ::SingleZeile[::SZNr]:cargo := Trim(::aFeldP[j])
         ::SingleZeile[::SZNr]:clipSiblings := .F.
         ::SingleZeile[::SZNr]:trigger := ::aSpaP[j]  // normalerweise=0 - 16.07.2006 10:41
// >>>>>>>>>> Variable p wird erzeugt, wenn ParameterUpdate erfolgt ist.
///////////////////////////////////////////////////////////////////////////////////////////////
// bisher war ::aSpaP[j] IMMER Null ! Wenn :trigger!=0 , dann existiert auch oBest:TxBdX 
// wenn :changed() und :trigger>0, dann suche Text zu der neuen Eingabe: 
         ::SingleZeile[::SZNr]:killInputFocus := {|mp1,mp2,obj| DeHiliteSle( obj ), ;
               IIf( obj:changed(), ;
               {IIf(obj:trigger > 0, ; 
                  &( "oEdit:TxBd" + Str(obj:trigger-1,IIf(obj:trigger<11,1,2))):=::Such(obj),), ;
               ::Vorschau:ParUpdate(), p:=1, ::Vorschau:UPDATE()}, ;
               ) }  // ::Such neu 15.07.2006 22:43 
//////////////////////////////////////////////////////////////////////////////////////////////
         ::SingleZeile[::SZNr]:CREATE(::BEArea[2], , aPosF, aSizeF, aPPSle,, ;
                                                @::aTextP[j], nFa, .T.,  , ;
                                                , , , , nA ):setdata()
         ::addEditControl( ::SingleZeile[::SZNr] )
      ELSE
         nZei := ++nZ4
//    zuerst kommt der Prompt-Text :
         aSizeT := ::BEArea[2]:currentSize()
         nZeiF := IIf( nZei < 1, nZeiF+nHv*nZei, aSizeT[2]-nHv-IIf(Len(::aParam)>20,1,1.5)*nHv*nZei )
         aPosF := {Int(0), nZeiF} ; aSizeF := {aSizeT[1]*.2,Int(nHv)}
         AAdd( ::TextZeile, MStatic():new( ::BEArea[4], , aPosF, aSizeF, aPPTxt,, ;
                                             XBPSTATIC_TYPE_TEXT, Trim(::aPromptP[j]) ) )
         ++::TZNr
         IIf( nV<=1, ::TextZeile[::TZNr]:setFontCompoundName( "8.Arial" ), )
//         ::XbpStatic:options := XBPSTATIC_TEXT_VCENTER+XBPSTATIC_TEXT_LEFT
         ::TextZeile[::TZNr]:create( ::BEArea[4], , aPosF, aSizeF, aPPTxt,, ;
                                             XBPSTATIC_TYPE_TEXT, Trim(::aPromptP[j]) )
//    ...und dann der Eingabe-Sle :
////            ::aTextP[j] := IIf(SET(43)==0,ConvToAnsiCP(::aTextP[j]),::aTextP[j])
            ::aTextP[j] := PadR( ::aTextP[j], nFA )
         aPosF := {aSizeT[1]*.2, nZeiF} ; aSizeF := {aSizeT[1]*.78,Int(nHv)}
//         AAdd( ::SingleZeile, MGetX():new( ::BEArea[4], , aPosF, aSizeF, aPPSle,, ;
//                                             0, nFA, , , ;
//                                             , , , ::aTextP, j ) )
            AAdd( ::SingleZeile, MGetXR():new( ::BEArea[4], , aPosF, aSizeF, aPPSle,, ;
                                                @::aTextP[j], nFa, .T.,  , ;
                                                , , , , nA ) )
         ++::SZNr
         ::SingleZeile[::SZNr]:clipSiblings := .F.
         ::SingleZeile[::SZNr]:killInputFocus := {|mp1,mp2,obj| DeHiliteSle( obj ), IIf( obj:changed(), ;
                                       {::Vorschau:ParUpdate(), p:=1, ::Vorschau:UPDATE()},) }  //12.05.2006 19:02
         ::SingleZeile[::SZNr]:CREATE( ::BEArea[4], , aPosF, aSizeF, aPPSle,, ;
                                                @::aTextP[j], nFa, .T.,  , ;
                                                , , , , nA ):setdata()
         ::addEditControl( ::SingleZeile[::SZNr] )
      ENDIF
   NEXT
   ::LeditC := Len(::editControls)
   nZeiF := nBo   // 24.08.2004, nZeiT wird hier gar nicht gebraucht
//   ::aBlatt := aBlattG
   FOR i := 1 TO Len(::aBlatt)
      ::aBlattZ := ::aBlatt[i]
      AAdd( ::aSeite, ::aBlattZ[1], i )
      AAdd( ::aNa, ::aBlattZ[2], i )
      AAdd( ::aPrompt, ::aBlattZ[3], i )
      AAdd( ::aText, ::aBlattZ[4], i )
      AAdd( ::aTFont, ::aBlattZ[5], i )
      AAdd( ::aBereich, ::aBlattZ[6], i )
      AAdd( ::aFeld, ::aBlattZ[7], i )         // Feldbezeichnung
      AAdd( ::aFFont, ::aBlattZ[8], i )
      AAdd( ::aZei, ::aBlattZ[9], i )
      AAdd( ::aSpa, ::aBlattZ[10], i )
      IF i > 1 .AND. nZeiF!=nBo // 24.8.2004
         nZei := IIf( ::aZei[i] < 0, -1, IIf(::aZei[i]=0, -1, ::aZei[i]) )
////// 24.08.2004   nSpa := IIf( ::aBlattZ[10]<1, (nSpa + Len(Trim(::aText[i-1])) ;
//////                               + Len(Trim(::aFeld[i-1])) - ::aBlattZ[10]), ::aBlattZ[10] )
      ELSE
         nZei := IIf( ::aZei[i] > 1, 1, ::aZei[i] )
//////         nSpa := ::aSpa[i]
      ENDIF
      DO CASE
       CASE Upper( ::aSeite[i] ) = "R" .OR. Upper( ::aSeite[i] ) = "V" .OR. ::aSeite[i] = "2" ;
                        .OR. Upper( ::aSeite[i] ) = "K"
//      keine Žnderungen, wenn es sich um "Rechnungszeilen" handelt
         ::addEditControl( ::aFeld[i] )
       CASE ::aNa[i] = "t"    // erzeugt ein Sle fr eine Textzeile
//    zuerst kommt der Prompt-Text :
         aSizeT := ::BEArea[3]:currentSize()
         nZeiF := IIf( nZei < 1, nZeiF+nHt*nZei, aSizeT[2]-nHt-1.5*nHt*nZei )
         aPosF := {Int(0), nZeiF} ; aSizeF := {aSizeT[1]*.2,Int(nHt)}
         AAdd( ::TextZeile, MStatic():new( ::BEArea[3], oOwner, aPosF, aSizeF, aPPTxt,, ;
                                             XBPSTATIC_TYPE_TEXT, Trim(::aPrompt[i]) ) )
         ++::TZNr
         IIf( nV<=1, ::TextZeile[::TZNr]:setFontCompoundName( "8.Arial" ), )
//         ::XbpStatic:options := XBPSTATIC_TEXT_VCENTER+XBPSTATIC_TEXT_LEFT
         ::TextZeile[::TZNr]:create( ::BEArea[3], oOwner, aPosF, aSizeF, aPPTxt,, ;
                                             XBPSTATIC_TYPE_TEXT, Trim(::aPrompt[i]) )

//////         aSizeT := ::BEArea[3]:currentSize()
//////         nZeiF := IIf( nZei < 1, nZeiF+nHv*nZei, aSizeT[2]-nHv-1.5*nHv*nZei )
         aPosF := {aSizeT[1]*.2, nZeiF} ; aSizeF := {aSizeT[1]*.78,Int(nHt)}

////         ::aText[i] := IIf(SET(43)==0,ConvToAnsiCP(::aText[i]),::aText[i])
         ::aText[i] := PadR( ::aText[i], nFA )
//         nZeiF := IIf( nZei < 1, nZeiF+nHv*nZei, nBo+nHv-nHv*nZei )
//         aPosF := {Int(nSpa*nBr*nV), nZeiF} ; aSizeF := {Int(Len(xF:=::aText[i])*nBr),Int(15*nV)}
//         AAdd( ::SingleZeile, MGetX():new( ::BEArea[3], oOwner, aPosF, aSizeF, aPPSle,, ;
//                                             0, nFA, , , ;
//                                             , , , ::aText, i ) )
            AAdd( ::SingleZeile, MGetXR():new( ::BEArea[3], , aPosF, aSizeF, aPPSle,, ;
                                                @::aText[i], nFa, .T.,  , ;
                                                , , , , nA ) )
         ++::SZNr
         ::SingleZeile[::SZNr]:clipSiblings := .F.
         ::SingleZeile[::SZNr]:cargo := ::vorschau
         ::SingleZeile[::SZNr]:killInputFocus := {|mp1,mp2,obj| DeHiliteSle( obj ), ;
                                                obj:getData(), obj:cargo:UPDATE() }
         ::SingleZeile[::SZNr]:CREATE( ::BEArea[3], , aPosF, aSizeF, aPPSle,, ;
                                                @::aText[i], nFa, .T.,  , ;
                                                , , , , nA ):setdata()
         ::addEditControl( ::SingleZeile[::SZNr] )
       CASE ::aNa[i] = "f"    // erzeugt ein Sle fr eine Feldzeile
//    zuerst kommt der Prompt-Text :
         aSizeT := ::BEArea[3]:currentSize()
         nZeiF := IIf( nZei < 1, nZeiF+nHt*nZei, aSizeT[2]-nHt-1.5*nHt*nZei )
         aPosF := {Int(0), nZeiF} ; aSizeF := {aSizeT[1]*.2,Int(nHt)}
         AAdd( ::TextZeile, MStatic():new( ::BEArea[3], oOwner, aPosF, aSizeF, aPPTxt,, ;
                                             XBPSTATIC_TYPE_TEXT, Trim(::aPrompt[i]) ) )
         ++::TZNr
         IIf( nV<=1, ::TextZeile[::TZNr]:setFontCompoundName( "8.Arial" ), )
//         ::XbpStatic:options := XBPSTATIC_TEXT_VCENTER+XBPSTATIC_TEXT_LEFT
         ::TextZeile[::TZNr]:create( ::BEArea[3], oOwner, aPosF, aSizeF, aPPTxt,, ;
                                             XBPSTATIC_TYPE_TEXT, Trim(::aPrompt[i]) )
//////         cB := ::aBereich[i] ; cF := ::aFeld[i]
//////         xF := ( (&cB)->(&cF) )      //Feldinhalt
//////         DO CASE
//////            CASE Valtype( xF ) == "C"
//////               ::aFeld[i] := xF
//////            CASE ValType( xF ) == "N"
//////               ::aFeld[i] := Str( xF )
//////            CASE ValType( xF ) == "D"
//////               ::aFeld[i] := DtoC( xF )
//////         ENDCASE
//         nZeiF := IIf( nZei < 1, nZeiF+nHt*nZei, nBo+nHv-nHv*nZei )
//         aPosF := {Int(nSpa*nBr*nV), nZeiF} ; aSizeF := {Int(Len(xF:=::aFeld[i])*nBr),Int(15*nV)}
         ::aFeld[i] := PadR( ::aFeld[i], nFA )
         aPosF := {aSizeT[1]*.2, nZeiF} ; aSizeF := {aSizeT[1]*.78,Int(nHt)}
            AAdd( ::SingleZeile, MGetXR():new( ::BEArea[3], , aPosF, aSizeF, aPPSle,, ;
                                                @::aFeld[i], nFa, .T.,  , ;
                                                , , , , nA ) )
         ++::SZNr
         ::SingleZeile[::SZNr]:clipSiblings := .F.
         ::SingleZeile[::SZNr]:cargo := ::vorschau
         ::SingleZeile[::SZNr]:killInputFocus := {|mp1,mp2,obj| DeHiliteSle( obj ), ;
                                                obj:getData(), obj:cargo:UPDATE() }
         ::SingleZeile[::SZNr]:CREATE( ::BEArea[3], , aPosF, aSizeF, aPPSle,, ;
                                                @::aFeld[i], nFa, .T.,  , ;
                                                , , , , nA ):setdata()
         ::addEditControl( ::SingleZeile[::SZNr] )
//------------
       CASE ::aNa[i] = "M"    // erzeugt ein Mle fr einen Text
//    zuerst kommt der Prompt-Text :
         aSizeT := ::BEArea[3]:currentSize()
         nZeiF := IIf( nZei < 1, nZeiF+nHt*nZei, aSizeT[2]-nHt-1.5*nHt*nZei )
         aPosF := {Int(0), nZeiF} ; aSizeF := {aSizeT[1]*.2,Int(nHt)}
         AAdd( ::TextZeile, MStatic():new( ::BEArea[3], oOwner, aPosF, aSizeF, aPPTxt,, ;
                                             XBPSTATIC_TYPE_TEXT, Trim(::aPrompt[i]) ) )
         ++::TZNr
         IIf( nV<=1, ::TextZeile[::TZNr]:setFontCompoundName( "8.Arial" ), )
         ::TextZeile[::TZNr]:create( ::BEArea[3], oOwner, aPosF, aSizeF, aPPTxt,, ;
                                             XBPSTATIC_TYPE_TEXT, Trim(::aPrompt[i]) )

         ::aFeld[i] := PadR( ::aFeld[i], nFA )
         cF := ::aFeld[i]
         nZeiF := nZeiF+(::aTFont[i]-1)*nHt*nZei
         aPosF := {aSizeT[1]*.2, nZeiF} ; aSizeF := {aSizeT[1]*.78,::aTFont[i]*Int(nHt)}
            AAdd( ::MultiZeile, MMleXR():new( ::BEArea[3], , aPosF, aSizeF, aPPSle,, ;
                                                @&cF, nFa, .T., , ;
                                                , , , , nA ) )
            ++::MZNr
            ::MultiZeile[::MZNr]:cargo := ::vorschau
            ::MultiZeile[::MZNr]:killInputFocus := {|mp1,mp2,obj| DeHiliteSle( obj ), ;
                                                obj:getData(), obj:cargo:UPDATE() }
            ::MultiZeile[::MZNr]:CREATE( ::BEArea[3], , aPosF, aSizeF, aPPSle,, ;
                                                @&cF, nFa, .T., , ;
                                                , , , , nA )   //1.1.2005###################:setData()
//            ::MultiZeile[::MZNr]:helpLink := MagicHelpLabel():New(sv->FIELD_DEC)
//            ::MultiZeile[::MZNr]:setName( y )
            ::addEditControl( ::MultiZeile[::MZNr] )


       CASE ::aNa[i] = "v"    // erzeugt ein Sle fr eine Variablen/Feldzeile
//    zuerst kommt der Prompt-Text :
         aSizeT := ::BEArea[3]:currentSize()
         nZeiF := IIf( nZei < 1, nZeiF+nHt*nZei, aSizeT[2]-nHt-1.5*nHt*nZei )
         aPosF := {Int(0), nZeiF} ; aSizeF := {aSizeT[1]*.2,Int(nHt)}
         AAdd( ::TextZeile, MStatic():new( ::BEArea[3], oOwner, aPosF, aSizeF, aPPTxt,, ;
                                             XBPSTATIC_TYPE_TEXT, Trim(::aPrompt[i]) ) )
         ++::TZNr
         IIf( nV<=1, ::TextZeile[::TZNr]:setFontCompoundName( "8.Arial" ), )
//         ::XbpStatic:options := XBPSTATIC_TEXT_VCENTER+XBPSTATIC_TEXT_LEFT
         ::TextZeile[::TZNr]:create( ::BEArea[3], oOwner, aPosF, aSizeF, aPPTxt,, ;
                                             XBPSTATIC_TYPE_TEXT, Trim(::aPrompt[i]) )
////         ::aFeld[i] := IIf(SET(43)==0,ConvToAnsiCP(::aFeld[i]),::aFeld[i])
         cF := ::aFeld[i]
         xF := PadR( &(cF), nFA )      //Variableninhalt
         DO CASE
            CASE xF == NIL
               ::aFeld[i] := "&(" + cF + ")"
            CASE Valtype( xF ) == "C"
               ::aFeld[i] := xF
            CASE ValType( xF ) == "N"
               ::aFeld[i] := Str( xF )
            CASE ValType( xF ) == "D"
               ::aFeld[i] := DtoC( xF )
         ENDCASE
        IF xF != NIL
//         nZeiF := IIf( nZei < 1, nZeiF+nHv*nZei, nBo+nHv-nHv*nZei )
//         aPosF := {Int(nSpa*nBr*nV), nZeiF} ; aSizeF := {Int(Len(xF:=::aFeld[i])*nBr),Int(15*nV)}
         ::aFeld[i] := PadR( ::aFeld[i], nFA )
         aPosF := {aSizeT[1]*.2, nZeiF} ; aSizeF := {aSizeT[1]*.78,Int(nHt)}
//////            AAdd( ::SingleZeile, MGet():new( ::BEArea[3], oOwner, aPosF, aSizeF, aPPSle,, ;
//////                                                @&cF, nFA, .F., , ;
//////                                                , , , , nA ) )
//         AAdd( ::SingleZeile, MGetX():new( ::BEArea[3], oOwner, aPosF, aSizeF, aPPSle,, ;
//                                             0, nFA, , , ;
//                                             , , , ::aFeld, i ) )
            AAdd( ::SingleZeile, MGetXR():new( ::BEArea[3], , aPosF, aSizeF, aPPSle,, ;
                                                @::aFeld[i], nFa, .T.,  , ;
                                                , , , , nA ) )
         ++::SZNr
         ::SingleZeile[::SZNr]:clipSiblings := .F.
         ::SingleZeile[::SZNr]:cargo := ::vorschau
         ::SingleZeile[::SZNr]:killInputFocus := {|mp1,mp2,obj| DeHiliteSle( obj ), ;
                                                obj:getData(), obj:cargo:UPDATE() }
         ::SingleZeile[::SZNr]:CREATE( ::BEArea[3], , aPosF, aSizeF, aPPSle,, ;
                                                @::aFeld[i], nFa, .T.,  , ;
                                                , , , , nA ):setdata()
         ::addEditControl( ::SingleZeile[::SZNr] )
        ELSE
         ::addEditControl( ::aFeld[i] )
        ENDIF
       CASE !Empty( xF := ::aText[i] )
//////         nZeiF := IIf( nZei < 1, nZeiF+nHt*nZei, nBo+nHt-nHt*nZei )
//////         aPosF := {Int(nSpa*nBr*nV), nZeiF} ; aSizeF := {Int(Len(xF:=Trim(::aText[i]))*nBr),Int(15*nV)}
//////         AAdd( ::TextZeile, MStatic():new( ::BEArea[::BENr], oOwner, aPosF, aSizeF, aPPTxt,, ;
//////                                             XBPSTATIC_TYPE_TEXT, Trim(::aText[i]) ) )
//////         ++::TZNr
//////         IIf( nV<=1, ::TextZeile[::TZNr]:setFontCompoundName( "8.Arial" ), )
////////         ::XbpStatic:options := XBPSTATIC_TEXT_VCENTER+XBPSTATIC_TEXT_LEFT
//////         ::TextZeile[::TZNr]:create()
         ::addEditControl( ::aText[i] )
       CASE !Empty( xF := ::aFeld[i] )
         IF ::aNa[i] != "v" .AND. ::aBereich[i] = "v" // im aFeld steht Mem-Variable
            cF := ::aFeld[i]
            ::aFeld[i] := "&(" + cF + ")"
         ELSE
            cB := ::aBereich[i] ; cF := ::aFeld[i]
            ::aFeld[i] := ((&cB)->(&cF))          //Feldinhalt
         ENDIF
//////         IF ValType( ::aFeld[i] ) != "M"
//////            nZeiF := IIf( nZei < 1, nZeiF+nHt*nZei, nBo+nHt-nHt*nZei )
//////            aPosF := {Int(nSpa*nBr*nV), nZeiF} ; aSizeF := {Int(Len(xF:=Trim(::aFeld[i]))*nBr),Int(15*nV)}
//////            AAdd( ::TextZeile, MStatic():new( ::BEArea[::BENr], oOwner, aPosF, aSizeF, aPPTxt,, ;
//////                                                XBPSTATIC_TYPE_TEXT, Trim(::aFeld[i]) ) )
//////            ++::TZNr
//////            IIf( nV<=1, ::TextZeile[::TZNr]:setFontCompoundName( "8.Arial" ), )
////////            ::XbpStatic:options := XBPSTATIC_TEXT_VCENTER+XBPSTATIC_TEXT_LEFT
//////            ::TextZeile[::TZNr]:create()
            ::addEditControl( ::aFeld[i] )
//////         ENDIF
         OTHERWISE
            ::addEditControl( ::aFeld[i] )
      ENDCASE
      ::aBlatt[i] := { ::aSeite[i], ::aNa[i], ::aPrompt[i], ;
                  ::aText[i], ::aTFont[i], ::aBereich[i], ;
                  ::aFeld[i], ::aFFont[i], ::aZei[i], ::aSpa[i] }
   NEXT
////////////   SELECT &nOldArea  // wohl berflssig??
//????
   DBRegisterClient(self)     // wozu, wenn wir aus dem Array arbeiten?
//????
RETURN self

METHOD BlattFA:destroy( nA )
//??????   (nA)->(DbDeregisterClient())
   ASize( ::BEArea, 0 )
   ::BENr := 0
   ASize( ::TabSeite, 0 )           //+27.04.2009 20:44 ob das wirklich gebraucht wird...
   ::TSNr := 0
   ASize( ::ScrollSeite, 0 )        //+27.04.2009 20:44
   ::SPNr := 0
//////   ASize( ::BrowseFeld, 0 )
//////   ::BFNr := 0
//   ASize( ::BVariable, 0 )
//   ::BVNr := 0
   ASize( ::GruppenBox, 0 )
   ::GBNr := 0
   ASize( ::TextZeile, 0 )
   ::TZNr := 0
   ASize( ::DruckKnopf, 0 )
   ::DKNr := 0
//////   ASize( ::MultiZeile, 0 )
//////   ::MZNr := 0
   ASize( ::SingleZeile, 0 )
   ::SZNr := 0
   ASize( ::editControls, 0 )
   ASize( ::appendControls, 0 )
   ASize( ::keyControls, 0 )
   ::keyboardBlock   := {|nKey,x,obj| 0 }
   ASize( ::aBlatt, 0 )
   ASize( ::aParam, 0 )
   ASize( ::aBlattZ, 0 )
   ASize( ::aSeite, 0 )
   ASize( ::aNa, 0 )
   ASize( ::aPrompt, 0 )
   ASize( ::aText, 0 )
   ASize( ::aTFont, 0 )
   ASize( ::aBereich, 0 )
   ASize( ::aFeld, 0 )
   ASize( ::aFFont, 0 )
   ASize( ::aZei, 0 )
   ASize( ::aSpa, 0 )
RETURN self

METHOD BlattFA:addEditcontrol( oXbp )
   IF ValType( oXbp ) = "O"
      IF AScan( ::editControls, oXbp ) == 0

         AAdd(  ::editControls, oXbp )
         ::addKeyControl( oXbp )
      ENDIF
   ELSE
      AAdd(  ::editControls, oXbp )
   ENDIF
RETURN self

METHOD BlattFA:addAppendControl( oXbp )
   IF AScan( ::appendControls, oXbp ) == 0
      AAdd(  ::appendControls, oXbp )
      ::addKeyControl( oXbp )
   ENDIF
RETURN self

METHOD BlattFA:addKeyControl( oXbp )
   IF AScan( ::keyControls, oXbp ) == 0
      AAdd(  ::keyControls, oXbp )
      oXbp:keyBoard := ::keyboardBlock
   ENDIF
RETURN self

// zum Suchen nach Texten in der Vorschau (fr Trauerkarten-Druck)   16.07.2006 10:14
// (erweiterte Version der Spruchsuche (siehe in BlattDrVG)
METHOD BlattFA:Such( oSE, oDlg1, cProg, nAnf, nEnd, nA, nRec, aPos, ASize, aPP, cTitel, cS, cDatei )
   LOCAL oDlg, nEvent, mp1, mp2, oXbp, oBrowse, cText := ""
   LOCAL nOldArea := Select(), oFocus := SetAppFocus(), oFoc
   LOCAL lFlucht := .F.
   PRIVATE oCB
   DEFAULT oDlg1 TO oVODA
   DEFAULT cProg TO "s_dru"
   DEFAULT nAnf TO 900, nEnd TO 999, nA TO 25, nRec TO RecNo()
   DEFAULT aPos TO {10*nH,30*nV} , ASize TO {int(400*nH),int(250*nV)}
   DEFAULT cTitel TO "Text ausw„hlen <ENTER> (<ESC> = zurck) :"
   DEFAULT cS TO Upper(Trim(oSE:getData()))
   DEFAULT cDatei TO "TextSymb"

   IF cS = "-"    // 20.09.2006 17:02 damit in TKarten leere Streifen erzeugt werden k”nnen
      RETURN "-"
   ENDIF   
//   DbSuspendNotifications()
   SELECT(nA)
   IF Val(cS) = 0          // wenn nach einem Textteil gesucht wird
      (nA)->(DbSetFilter( {|| cS$Upper((nA)->text) } ))
      IIf( !(nA)->(Bof()), (nA)->(DbGotop()), )
   ELSE                    // wenn nach einer TextNr gesucht wird
      (nA)->(DbSeek( cS, .T. ))
      IF Val(cS) < Val((nA)->textnr)
         (nA)->(DbSkip(-1))
      ENDIF
   ENDIF
   
   oDlg := AKDialog():new( AppDesktop(), oDlg1:cargo )
   oDlg:tasklist := .T.
   oDlg:title := cTitel
   oDlg:maxButton := .F.
   oDlg:border := XBPDLG_RAISEDBORDERTHIN_FIXED
   oDlg:create(,, aPos, ASize )

   oDlg:drawingArea:setColorBG( GRA_CLR_DARKCYAN )
   oCB := oDlg:drawingArea
   oCB:cargo := oDlg

// jetzt folgt die Erzeugung der Eingabefelder
   oBrowse := DialogFF():new( oCB,oDlg, , ,,, nBz, cProg, nAnf, nEnd, nA )
   oBrowse:Fancy := ""
   oBrowse:VArea := nA
   oBrowse:BEArea := {}
   AAdd( oBrowse:BEArea, oCB )
   oBrowse:BENr := Len( oBrowse:BEArea )
   oBrowse:CREATE( oCB,oDlg, , ,aPP,, nBz, cProg, nAnf, nEnd, nA )
// bis hierhin geht die Erzeugung der Eingabefelder
   AEval( oBrowse:editControls, {|x| oDlg:addEditControl( x ) } )

   oDlg:setModalState( XBP_DISP_APPMODAL )
   oDlg:show()
   SetAppFocus( oBrowse:BrowseFeld[1] )

   nEvent := xbeP_None
   DO WHILE nEvent <> xbeP_Close
      nEvent := AppEvent( @mp1, @mp2, @oXbp )
      IF nEvent == xbeBRW_ItemSelected
            PostAppEvent( xbeP_Close)
      ENDIF
      IF nEvent == xbeP_Keyboard
      DO CASE
         CASE mp1 >= Asc(" ") .and. mp1 <= Asc("z")
            cSuchWort += Chr(mp1)
            DbSeek( Upper(cSuchWort), .T. )
            IF !Found()
               DbSkip(-1)
            ENDIF
            oBrowse:BrowseFeld[1]:refreshAll()
         CASE mp1 == xbeK_RETURN .or. mp1 == xbeK_F10
            PostAppEvent( xbeP_Close)
         CASE mp1 == xbeK_ESC
            lFlucht := .T.
            PostAppEvent( xbeP_Close)
         CASE mp1 == xbeK_CTRL_DEL
            oFoc := SetAppFocus()
            IF ConfirmBox( oDlg1, "Soll der Datensatz wirklich gel”scht werden?", ;
                                 "Datensatz l”schen!", ;
                                 XBPMB_YESNO, ;
                                 XBPMB_QUESTION, ;
                                 XBPMB_DEFBUTTON2 ) == XBPMB_RET_YES
               Satzsp( oCB )
               (nA)->(DbDelete())
               IF !(nA)->(Bof())
                  (nA)->(DbSkip(-1))              // 21.6.2005 zum Test
               ENDIF
               nRec := RecNo()
               oBrowse:BrowseFeld[1]:refreshAll()
            ENDIF
            SetAppFocus(oFoc)
      ENDCASE
      ENDIF
      oXbp:handleEvent( nEvent, mp1, mp2 )
   ENDDO
   oDlg:setModalState( XBP_DISP_MODELESS )
   oDlg:destroy()
   IF lFlucht = .F.
      oSE:setData( (nA)->textnr + "  |  " + PadR((nA)->text,40) ) // wird in Param-Tab angezeigt
      IF oSE:trigger < 11
         (nA)->(DbClearFilter())
         (nA)->(DbSetScope( SCOPE_BOTH, (nA)->textnr ))
         (nA)->(DbEval({|| cText += Trim((nA)->text+CRLF)}))   // setzt den Spruch zusammen
         (nA)->(DbClearScope())
         cText := Stuff(cText,Len(cText)-1,2,"  ")    // damit letztes CRLF verschwindet
      ELSE
         cText := (nA)->bild     //22.07.2006 16:23
      ENDIF
   ELSE
      (nA)->(DbClearFilter())
      cText := ""
   ENDIF
   SELECT (nOldArea)
//   DbResetNotifications()
//   (nA)->(DbSkip(0))
   SetAppFocus( oFocus )
RETURN cText

//------------------------------------------
