Button click action

Button click action

Postby Otto » Mon Nov 22, 2021 5:12 pm

Hello friends,

Maybe someone has time and can help me.
Unfortunately, ACTION does not work with the switches.
I would like to make the switch clickable and then change the width.

call test program:
sorting.exe mydbf.dbf

Best regards,
Otto

Image


Code: Select all  Expand view


#include "FiveWin.ch"
 

REQUEST DBFCDX
REQUEST DBFFPT

static oBtn[ 200 ]
static nColNext := 0
static oFont, oFontBold
static cABC := " "
static aFields
static aStructAlt
static databaseName
//----------------------------------------------------------------------------//

function main(cAufruf)
   
   local cRet              := ""
   local oDlg
   local lSave             := .f.
   local oBtnEnde, oBtnSave
   local oBtnOK
   local nReihe            := 0
   local nCount            := 0
   local I                 := 0
   local nColOffset        := 3
   local nWidth            := GetSysMetrics( 0 )/2
   local nHeight           := GetSysMetrics( 1 )/4*3
   local x                 := 0
   local nAbstand          := 0
   local y                 := 0
   local maxItems           := 0
   Local hPen                   := CreatePen( 1, 3, 4144959 )           //Rot
   local cDbf := ""
   local aStruct :={}
   local aTemp := {}
   local nSpalten
   local cBinData
   *----------------------------------------------------------
   
   if valtype( cAufruf ) <> "U"
      databaseName := caufruf
      use(caufruf) new
      aStruct := dbstruct()
      xbrowse(aStruct)
      cBinData := ASave( aStruct )                   // Converts Array Data and to Binary and stores in cStr
     
      memowrit( "struktur.txt", cBinData )
     
   else
      databaseName := ""
   endif
   
   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14 BOLD
   DEFINE FONT oFontBold NAME "TAHOMA" SIZE 0,-20 BOLD
   
   aFields := {}
   aTemp := ARead ( memoread( "struktur.txt" ) )
   xbrowse(aTemp)
   aStructAlt := aTemp
   
   AEval( aTemp, { |a|  AADD( afields,{ a[1], I += 1  }) } )
   
   asort( afields,,, { |x, y | x[1] < y[1] } )
   
   maxItems := len(aFields)
   
   AADD( afields, {"ROW",  maxItems + 1}  )
   AADD( afields, {"ROW",  maxItems + 2}  )
   AADD( afields, {"ROW",  maxItems + 3}  )
   AADD( afields, {"ROW",  maxItems + 4}  )
   AADD( afields, {"ROW",  maxItems + 5}  )
   
   maxItems += 5
   
     DEFINE DIALOG oDlg ;
           TITLE "Auswahl" ;
            FROM 0, 0 ;
              TO nHeight, nWidth ;
           PIXEL

   nWidth := nWidth/6*4
   
   @ 02,300 ;
   SAY "database fields" ;
   OF oDlg ;
   PIXEL ;
   FONT oFontBold
   
   @ ( nHeight/3*2+25 ) / 2.05,0 ;
   SAY "new database" ;
   OF oDlg ;
   PIXEL ;
   FONT oFontBold
   
   nSpalten := INT(   nWidth/105 )-1
   
   x           := nSpalten   //3//10
   y           := 18 //35 // 15
   nAbstand    := nWidth/5 * 4 / 5
   nColOffset  := 20
   
   FOR nReihe = 0 to maxItems / 5
      nColNext := 5
     
      FOR I = 1 To x
         nCount := nCount + 1
         if nCount > maxItems
            exit
         endif
         
         //nRow, nCol, aVar, n, oWnd
         oBtn[ nCount ] := MakeGet( ( 3 + y * nReihe ),;
                                        nColOffset/2.05 + ( nWidth - 20 * 2 )/ x /2.05 * ( I - 1 ),;
                                        aFields,;
                                        nCount,;
                                        oDlg  )
         
      NEXT
     
   NEXT
   
   
   @ ( nHeight-90) /2.05,nWidth/2/2.05 - 50 ;
     FLATBTN oBtnSave ;
      PROMPT "Save" ;
        SIZE 50 /2.05 + 5, 27 /2.05 ;
          OF oDlg ;
      ACTION Save(oDlg, nHeight) ;
       COLOR CLR_BLACK, CLR_YELLOW

   
   @ ( nHeight-90) /2.05,nWidth/2/2.05 ;
     FLATBTN oBtnEnde ;
      PROMPT "Abbruch" ;
        SIZE 50 /2.05 + 5, 27 /2.05 ;
          OF oDlg ;
      ACTION oDlg:END() ;
       COLOR CLR_BLACK, CLR_YELLOW

   
   SelectObject( oDlg:hDc, hPen )
   
         ACTIVATE DIALOG oDlg ;
          CENTERED ;
           ON INIT (  dragModus( oBtn, nCount )   ) ;
          ON PAINT (  oDlg:line( nHeight/3*2, 0  ,nHeight/3*2, nWidth +300 ) )

   
   if lsave = .t.
   endif
   
return nil
//----------------------------------------------------------------------------//

function dragModus( oBtn, nCount )
   local I := 0
   
   FOR I := 1 to nCount -1
      // oBtn[ I ]:lDrag := .t.
   next
return nil

//----------------------------------------------------------------------------//

static function MakeGet( nRow, nCol, aVar, n, oWnd )
   local oget
   
   if cABC <> left( aVar[ n, 1 ], 1 )
     
      @ nRow +20,nColNext ;
      BTNBMP oGet ;
      PROMPT aVar[ n, 1 ] ;
      OF oWnd  PIXEL ;
      ACTION xbrowse(oGet);
      FONT oFontBold;  
      SIZE  70, 14 FLAT  

      cABC := left( aVar[ n, 1 ], 1 )
     
   else
      @ nRow +20,nColNext ;
      BTNBMP oGet ;
      PROMPT aVar[ n, 1 ] ;
      OF oWnd  PIXEL ;
      ACTION xbrowse(oGet);
      FONT oFont;  
      SIZE  70, 14 FLAT  
     
   endif
   
   oGet:cargo := aVar[ n, 2 ]
   oGet:bPostDrag := { |oSay| osay:ntop := INT( osay:ntop/20)*20   }
     
   nColNext := nColNext + oGet:nWidth + 5
   oGet:lDrag := .t.
 
return oGet

//----------------------------------------------------------------------------//

function save( oWnd, nHeight)
   local I := 0
   local oCtrl
   local aSortiert := {}
 
   for each oCtrl in oWnd:aControls
     
      I += 1
      if oCtrl:cTitle = "Abbruch" .or.;
         oCtrl:cTitle = "Save" .or.;
         oCtrl:cTitle = "database fields" .or.;
         oCtrl:cTitle = "new database"
         
      else
         AAdd( aSortiert, { oCtrl:cTitle, oCtrl:nTop, oCtrl:nLeft, "Auswahl", oCtrl:Cargo } )
      endif
   next
   
   f_xbrowse( aSortiert )
   
 
   
return nil
//----------------------------------------------------------------------------//

function f_xbrowse( aSortiert )
   local oDlg, oBrw, oFont
   local oBTNSpeichern
   local oBTNWeiter
   local lOK            := .f.
   local cBuchungsNr    := ""
   local aGaeste        := {}
   *----------------------------------------------------------
   
   DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14
   
   DEFINE DIALOG oDlg ;
   TITLE "Liste aller Einstellungen" ;
   SIZE 800, 540 ;
   PIXEL ;
   FONT oFont
   
   @ 10,10 ;
   XBROWSE oBrw ;
   OF oDlg ;
   PIXEL ;
   SIZE 500, 200 ;
   DATASOURCE aSortiert ;
   AUTOSORT ;
   NOBORDER
   
   oBrw:nMarqueeStyle    = MARQSTYLE_HIGHLWIN7
   oBrw:CreateFromCode()
   
   
   @ ( oDlg:nHeight - 40 ) / 2.05, oDlg:nWidth/5/2.05  ;
   FLATBTN oBTNSpeichern ;
   PROMPT "DBF erstellen" ;
   SIZE 2, ( 32 ) /2.05 ;
   OF oDlg ;
   ACTION ( dbf_erstellen( aSortiert ) )
   
   @ ( oDlg:nHeight - 40 ) / 2.05,oDlg:nWidth/2/2.05 + oBTNSpeichern:nWidth + 10;
   FLATBTN oBTNWeiter ;
   PROMPT "Abbruch" ;
   SIZE 2, ( 32 ) /2.05 ;
   OF oDlg ;
   ACTION ( oDlg:End() ) ;
   CANCEL
   
   //----------------------------------------------------------------------------//
   
   ACTIVATE DIALOG oDlg CENTERED
   
   RELEASE FONT oFont
   
return nil

//----------------------------------------------------------------------------//

function dbf_erstellen( aSortiert )
   local aTemp := {}
   local I := 1
   local aStructNeu := {}
   local cCode := ""
   local aTemp1 := {}
   local cBinData
   *----------------------------------------------------------
   
   FOR I:= 1 to len(aSortiert)
      if aSortiert[I, 2 ] > 560
         aadd( atemp, aSortiert[I] )
      endif
     
   next
   
   asort( atemp,,, { |x, y | x[3] < y[3] } )    
   asort( atemp,,, { |x, y | x[2] < y[2] } )
   
   //xbrowse(aTemp)
   
   cBinData := ASave( aTemp )                   // Converts Array Data and to Binary and stores in cStr
   
   memowrit( "structurfilter.txt", cBinData )
   
return nil
//----------------------------------------------------------------------------//



 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6008
Joined: Fri Oct 07, 2005 7:07 pm

Re: Button click action

Postby karinha » Mon Nov 22, 2021 6:40 pm

Very strange. With me, 2 buttons work and 3 buttons don't work.

Muy extraño. En mi caso, 2 botones funcionan y 3 botones no funcionan.

Code: Select all  Expand view

#include "FiveWin.ch"

REQUEST DBFCDX
REQUEST DBFFPT

STATIC oBtn[ 200 ]
STATIC nColNext := 0
STATIC oFont, oFontBold
STATIC cABC := " "
STATIC aFields
STATIC aStructAlt
STATIC databaseName
STATIC oGet

FUNCTION Main( cAufruf )

   LOCAL cRet              := ""
   LOCAL oDlg
   LOCAL lSave             := .F.
   LOCAL oBtnEnde, oBtnSave
   LOCAL oBtnOK
   LOCAL nReihe            := 0
   LOCAL nCount            := 0
   LOCAL I                 := 0
   LOCAL nColOffset        := 3
   LOCAL nWidth            := GetSysMetrics( 0 ) / 2
   LOCAL nHeight           := GetSysMetrics( 1 ) / 4 * 3
   LOCAL x                 := 0
   LOCAL nAbstand          := 0
   LOCAL y                 := 0
   LOCAL maxItems           := 0
   LOCAL hPen                   := CreatePen( 1, 3, 4144959 )           // Rot
   LOCAL cDbf := ""
   LOCAL aStruct := {}
   LOCAL aTemp := {}
   LOCAL nSpalten
   LOCAL cBinData

   IF ValType( cAufruf ) <> "U"
      databaseName := caufruf
      use( caufruf ) new
      aStruct := dbStruct()
      xbrowse( aStruct )
      cBinData := ASave( aStruct )                   // Converts Array Data and to Binary and stores in cStr

      MemoWrit( "struktur.txt", cBinData )

   ELSE
      databaseName := ""
   ENDIF

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 14 BOLD
   DEFINE FONT oFontBold NAME "TAHOMA" SIZE 0, - 20 BOLD

   aFields := {}
   aTemp := ARead ( MemoRead( "struktur.txt" ) )
   xbrowse( aTemp )
   aStructAlt := aTemp

   AEval( aTemp, {| a |  AAdd( afields, { a[ 1 ], I += 1  } ) } )

   ASort( afields,,, {| x, y | x[ 1 ] < y[ 1 ] } )

   maxItems := Len( aFields )

   AAdd( afields, { "ROW 1",  maxItems + 1 }  )
   AAdd( afields, { "ROW 2",  maxItems + 2 }  )
   AAdd( afields, { "ROW 3",  maxItems + 3 }  )
   AAdd( afields, { "ROW 4",  maxItems + 4 }  )
   AAdd( afields, { "ROW 5",  maxItems + 5 }  )

   maxItems += 5

   DEFINE DIALOG oDlg ;
      TITLE "Auswahl" ;
      FROM 0, 0 ;
      TO nHeight, nWidth ;
      PIXEL

   nWidth := nWidth / 6 * 4

   @ 02, 300 ;
      SAY "database fields" ;
      OF oDlg ;
      PIXEL ;
      FONT oFontBold

   @ ( nHeight / 3 * 2 + 25 ) / 2.05, 0 ;
      SAY "new database" ;
      OF oDlg ;
      PIXEL ;
      FONT oFontBold

   nSpalten := Int(   nWidth / 105 ) - 1

   x           := nSpalten   // 3//10
   y           := 18 // 35 // 15
   nAbstand    := nWidth / 5 * 4 / 5
   nColOffset  := 20

   FOR nReihe = 0 TO maxItems / 5
      nColNext := 5

      FOR I = 1 TO x

         nCount := nCount + 1

         IF nCount > maxItems
            EXIT
         ENDIF

         // nRow, nCol, aVar, n, oWnd
         oBtn[ nCount ] := MakeGet( ( 3 + y * nReihe ), ;
            nColOffset / 2.05 + ( nWidth - 20 * 2 ) / x / 2.05 * ( I - 1 ), ;
            aFields, ;
            nCount, ;
            oDlg  )

         // Master Otto?
         // ASI, SOLO 2 BOTTONES TIENE ACTION?? ES CORRECTO?
         oBtn[ I ]:lDrag := .T.  // NEW

      NEXT

   NEXT

   @ ( nHeight - 90 ) / 2.05, nWidth / 2 / 2.05 - 50 ;
      FLATBTN oBtnSave ;
      PROMPT "Save" ;
      SIZE 50 / 2.05 + 5, 27 / 2.05 ;
      OF oDlg ;
      ACTION Save( oDlg, nHeight ) ;
      COLOR CLR_BLACK, CLR_YELLOW

   @ ( nHeight - 90 ) / 2.05, nWidth / 2 / 2.05 ;
      FLATBTN oBtnEnde ;
      PROMPT "Abbruch" ;
      SIZE 50 / 2.05 + 5, 27 / 2.05 ;
      OF oDlg ;
      ACTION oDlg:END() ;
      COLOR CLR_BLACK, CLR_YELLOW

   SelectObject( oDlg:hDc, hPen )

   ACTIVATE DIALOG oDlg ;
      CENTERED ;
      ON INIT (  dragModus( oBtn, nCount )   ) ;
      ON PAINT (  oDlg:line( nHeight / 3 * 2, 0, nHeight / 3 * 2, nWidth + 300 ) )

   IF lsave = .T.

   ENDIF

RETURN NIL

FUNCTION dragModus( oBtn, nCount )

   LOCAL I := 0

   FOR I := 1 TO nCount - 1
      // oBtn[ I ]:lDrag := .t.
   NEXT

RETURN NIL

FUNCTION MakeGet( nRow, nCol, aVar, n, oWnd )

   // LOCAL oget

   IF cABC <> Left( aVar[ n, 1 ], 1 )

      @ nRow + 20, nColNext ;
         BTNBMP oGet ;
         PROMPT aVar[ n, 1 ] ;
         OF oWnd  PIXEL ;
         ACTION xbrowse( oGet );
         FONT oFontBold;
         SIZE  70, 14 FLAT

      cABC := Left( aVar[ n, 1 ], 1 )

   ELSE

      @ nRow + 20, nColNext ;
         BTNBMP oGet ;
         PROMPT aVar[ n, 1 ] ;
         OF oWnd  PIXEL ;
         ACTION xbrowse( oGet );
         FONT oFont;
         SIZE  70, 14 FLAT

   ENDIF

   oGet:Cargo := aVar[ n, 2 ]

   oGet:bPostDrag := {| oSay | oSay:ntop := Int( oSay:ntop / 20 ) * 20   }

   nColNext := nColNext + oGet:nWidth + 5

   oGet:SetFocus()

   // oGet:Click()

   // funciona.
   oGet:bLDblClick := { | nRow, nCol | EditControl( nRow, nCol, oGet ) }
   oGet:bRClicked  := { | nRow, nCol | EditControl( nRow, nCol, oGet ) }

   // oGet:lDrag := .T. asi, no hay ACTION  //???
   
RETURN oGet

FUNCTION EditControl( nRow, nCol, oControl )

   ? [yes? SI!]

RETURN NIL

FUNCTION save( oWnd, nHeight )

   LOCAL I := 0
   LOCAL oCtrl
   LOCAL aSortiert := {}

   FOR EACH oCtrl in oWnd:aControls

      I += 1
      IF oCtrl:cTitle = "Abbruch" .OR. ;
            oCtrl:cTitle = "Save" .OR. ;
            oCtrl:cTitle = "database fields" .OR. ;
            oCtrl:cTitle = "new database"

      ELSE
         AAdd( aSortiert, { oCtrl:cTitle, oCtrl:nTop, oCtrl:nLeft, "Auswahl", oCtrl:Cargo } )
      ENDIF
   NEXT

   f_xbrowse( aSortiert )

RETURN NIL

FUNCTION f_xbrowse( aSortiert )

   LOCAL oDlg, oBrw, oFont
   LOCAL oBTNSpeichern
   LOCAL oBTNWeiter
   LOCAL lOK            := .F.
   LOCAL cBuchungsNr    := ""
   LOCAL aGaeste        := {}

   DEFINE FONT oFont NAME 'Tahoma' SIZE 0, - 14

   DEFINE DIALOG oDlg ;
      TITLE "Liste aller Einstellungen" ;
      SIZE 800, 540 ;
      PIXEL ;
      FONT oFont

   @ 10, 10 ;
      XBROWSE oBrw ;
      OF oDlg ;
      PIXEL ;
      SIZE 500, 200 ;
      DATASOURCE aSortiert ;
      AUTOSORT ;
      NOBORDER

   oBrw:nMarqueeStyle    = MARQSTYLE_HIGHLWIN7
   oBrw:CreateFromCode()


   @ ( oDlg:nHeight - 40 ) / 2.05, oDlg:nWidth / 5 / 2.05  ;
      FLATBTN oBTNSpeichern ;
      PROMPT "DBF erstellen" ;
      SIZE 2, ( 32 ) / 2.05 ;
      OF oDlg ;
      ACTION ( dbf_erstellen( aSortiert ) )

   @ ( oDlg:nHeight - 40 ) / 2.05, oDlg:nWidth / 2 / 2.05 + oBTNSpeichern:nWidth + 10;
      FLATBTN oBTNWeiter ;
      PROMPT "Abbruch" ;
      SIZE 2, ( 32 ) / 2.05 ;
      OF oDlg ;
      ACTION ( oDlg:End() ) ;
      CANCEL

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

RETURN NIL

FUNCTION dbf_erstellen( aSortiert )

   LOCAL aTemp := {}
   LOCAL I := 1
   LOCAL aStructNeu := {}
   LOCAL cCode := ""
   LOCAL aTemp1 := {}
   LOCAL cBinData

   FOR I := 1 TO Len( aSortiert )

      IF aSortiert[ I, 2 ] > 560
         AAdd( atemp, aSortiert[ I ] )
      ENDIF

   NEXT

   ASort( atemp,,, {| x, y | x[ 3 ] < y[ 3 ] } )
   ASort( atemp,,, {| x, y | x[ 2 ] < y[ 2 ] } )

   // xbrowse(aTemp)

   cBinData := ASave( aTemp )                   // Converts Array Data and to Binary and stores in cStr

   MemoWrit( "structurfilter.txt", cBinData )

RETURN NIL
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7215
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Button click action

Postby Otto » Mon Nov 22, 2021 7:30 pm

Hi Joao,
I think it has to do as I create the button with the principle of detached locals.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6008
Joined: Fri Oct 07, 2005 7:07 pm

Re: Button click action

Postby Otto » Tue Nov 23, 2021 7:21 am

Thanks,João,
I give up on that.

What I want to achieve is to drag a selection of fields onto a grid and to be able to make the width and other presets.

The grid should be suitable for creating a bootstrap grid.

Here is a sample:

Image

I think it might be easier with 2 xBrowser.

Image

But first I'll see what a JS solution looks like.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6008
Joined: Fri Oct 07, 2005 7:07 pm

Re: Button click action

Postby Otto » Tue Nov 23, 2021 9:39 am

Hello Joao,
I found out, that in my case, it is
oGet:lDrag := .t.
which stops ACTION.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6008
Joined: Fri Oct 07, 2005 7:07 pm

Re: Button click action

Postby Otto » Tue Nov 23, 2021 11:14 am

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6008
Joined: Fri Oct 07, 2005 7:07 pm

Re: Button click action

Postby karinha » Tue Nov 23, 2021 12:56 pm

Maestro Otto, solo curiosidad, ¿código final? ¿Puedes mostrar? Si no puede, no hay problema. Solo curiosidad del programador.

Master Otto, just curiosity, final code? You can show? If you can't, no problem. Programmer's curiosity only.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7215
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Button click action

Postby Otto » Tue Nov 23, 2021 1:28 pm

Hello João,
here is my code.
I am glad you help and are interested.
If you have any changes, please poste.


Best regards,
Otto

Code: Select all  Expand view



#include "FiveWin.ch"


REQUEST DBFCDX
REQUEST DBFFPT

static oBtn[ 200 ]
static nColNext := 0
static oFont, oFontBold
static cABC := " "
static aFields
static aStructAlt
static databaseName
static oDlg
static lVar := .t.
//----------------------------------------------------------------------------//

function main(cAufruf)
   
    local cRet              := ""
   
    local lSave             := .f.
    local oBtnEnde, oBtnSave
    local oBtnOK
    local nReihe            := 0
    local nCount            := 0
    local I                 := 0
    local nColOffset        := 3
    local nWidth            := GetSysMetrics( 0 )/2
    local nHeight           := GetSysMetrics( 1 )/4*3
    local x                 := 0
    local nAbstand          := 0
    local y                 := 0
    local maxItems          := 0
    Local hPen                  := CreatePen( 1, 3, 4144959 )           //Rot
    local cDbf := ""
    local aStruct :={}
    local aTemp := {}
    local nSpalten
    local cBinData
    local oGetTest
    local oSw
   
    *----------------------------------------------------------
   
    if valtype( cAufruf ) <> "U"
        databaseName := caufruf
        use(caufruf) new
        aStruct := dbstruct()
        xbrowse(aStruct)
        cBinData := ASave( aStruct )                   // Converts Array Data and to Binary and stores in cStr
       
        memowrit( "struktur.txt", cBinData )
       
    else
        databaseName := ""
    endif
   
    DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14 BOLD
    DEFINE FONT oFontBold NAME "TAHOMA" SIZE 0,-20 BOLD
   
    aFields := {}
    aTemp := ARead ( memoread( "struktur.txt" ) )
    xbrowse(aTemp)
    aStructAlt := aTemp
   
    AEval( aTemp, { |a|  AADD( afields,{ a[1], I += 1  }) } )
   
    asort( afields,,, { |x, y | x[1] < y[1] } )
   
    maxItems := len(aFields)
   
    AADD( afields, {"ROW",  maxItems + 1}  )
    AADD( afields, {"ROW",  maxItems + 2}  )
    AADD( afields, {"ROW",  maxItems + 3}  )
    AADD( afields, {"ROW",  maxItems + 4}  )
    AADD( afields, {"ROW",  maxItems + 5}  )
   
    maxItems += 5
   
    DEFINE DIALOG oDlg ;
    TITLE "Auswahl" ;
    FROM 0, 0 ;
    TO nHeight, nWidth ;
    PIXEL
   
    nWidth := nWidth/6*4
   
    @ 02,300 ;
    SAY "database fields" ;
    OF oDlg ;
    PIXEL ;
    FONT oFontBold
   
    @ ( nHeight/3*2+25 ) / 2.050,250 ;
    SWITCH oSw ;
        VAR lVar ;
        SIZE 10, 10 ;
        PIXEL ;
        OF oDlg ;
        COLOR CLR_WHITE, RGB( 255, 128,   0 )
       
       
       
        @ ( nHeight/3*2+25 ) / 2.05,0 ;
        SAY "new database" ;
        OF oDlg ;
        PIXEL ;
        FONT oFontBold
       
        nSpalten    := INT(   nWidth/105 )-1
        x           := nSpalten   //3//10
        y           := 18 //35 // 15
        nAbstand    := nWidth/5 * 4 / 5
        nColOffset  := 20
       
        FOR nReihe = 0 to maxItems / 5
            nColNext := 5
           
            FOR I = 1 To x
                nCount := nCount + 1
                if nCount > maxItems
                    exit
                endif
               
                //nRow, nCol, aVar, n, oWnd
                oBtn[ nCount ] := MakeGet( ( 3 + y * nReihe ),;
                nColOffset/2.05 + ( nWidth - 20 * 2 )/ x /2.05 * ( I - 1 ),;
                aFields,;
                nCount )
               
            NEXT
           
        NEXT
       
       
       
       
        @ ( nHeight-90) /2.05,nWidth/2/2.05 - 50 ;
        FLATBTN oBtnSave ;
        PROMPT "Save" ;
        SIZE 50 /2.05 + 5, 27 /2.05 ;
        OF oDlg ;
        ACTION Save(oDlg, nHeight) ;
        COLOR CLR_BLACK, CLR_YELLOW
       
       
        @ ( nHeight-90) /2.05,nWidth/2/2.05 ;
        FLATBTN oBtnEnde ;
        PROMPT "Abbruch" ;
        SIZE 50 /2.05 + 5, 27 /2.05 ;
        OF oDlg ;
        ACTION oDlg:END() ;
        COLOR CLR_BLACK, CLR_YELLOW
       
       
        SelectObject( oDlg:hDc, hPen )
       
        ACTIVATE DIALOG oDlg ;
        CENTERED ;
        ON INIT (  dragModus( oBtn, nCount )   ) ;
        ON PAINT (  oDlg:line( nHeight/3*2, 0  ,nHeight/3*2, nWidth +300 ) )
       
       
        if lsave = .t.
        endif
       
    return nil
    //----------------------------------------------------------------------------//
   
    function dragModus( oBtn, nCount )
        local I := 0
       
        FOR I := 1 to nCount -1
            // oBtn[ I ]:lDrag := .t.
        next
    return nil
   
    //----------------------------------------------------------------------------//
   
    static function MakeGet( nRow, nCol, aVar, n  )
        local oget
       
        if cABC <> left( aVar[ n, 1 ], 1 )
           
            @ nRow +20,nColNext ;
            BTNBMP oGet ;
            PROMPT aVar[ n, 1 ] ;
            OF oDlg  PIXEL ;
            FONT oFontBold;  
            SIZE  70, 14  
           
            cABC := left( aVar[ n, 1 ], 1 )
           
           
        else
            @ nRow +20,nColNext ;
            BTNBMP oGet ;
            PROMPT aVar[ n, 1 ] ;
            OF oDlg  PIXEL ;
            FONT oFont;  
            SIZE  70, 14
        endif
       
        oGet:cargo := aVar[ n, 2 ]
        oGet:bPostDrag := { |oSay| osay:ntop := INT( osay:ntop/20)*20, IIF( lVar=.t., f_fieldsetup(oSay), )   }
       
        nColNext := nColNext + oGet:nWidth + 5
        oGet:lDrag := .t.
       
    return oGet
   
    //----------------------------------------------------------------------------//
   
    function save( oWnd, nHeight)
        local I := 0
        local oCtrl
        local aSortiert := {}
       
        for each oCtrl in oWnd:aControls
           
            I += 1
            if oCtrl:cTitle = "Abbruch" .or.;
                oCtrl:cTitle = "Save" .or.;
                oCtrl:cTitle = "database fields" .or.;
                oCtrl:cTitle = "new database"
               
            else
                AAdd( aSortiert, { oCtrl:cTitle, oCtrl:nTop, oCtrl:nLeft, "Auswahl", oCtrl:Cargo, oCtrl:nWidth } )
            endif
        next
       
        f_xbrowse( aSortiert )
       
       
       
    return nil
    //----------------------------------------------------------------------------//
   
    function f_xbrowse( aSortiert )
        local oDlg, oBrw, oFont
        local oBTNSpeichern
        local oBTNWeiter
        local lOK           := .f.
        local cBuchungsNr   := ""
        local aGaeste       := {}
        *----------------------------------------------------------
       
        DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14
       
        DEFINE DIALOG oDlg ;
        TITLE "Liste aller Einstellungen" ;
        SIZE 800, 540 ;
        PIXEL ;
        FONT oFont
       
        @ 10,10 ;
        XBROWSE oBrw ;
        OF oDlg ;
        PIXEL ;
        SIZE 500, 200 ;
        DATASOURCE aSortiert ;
        AUTOSORT ;
        NOBORDER
       
       
        oBrw:nMarqueeStyle    = MARQSTYLE_HIGHLWIN7
        oBrw:CreateFromCode()
       
       
        @ ( oDlg:nHeight - 40 ) / 2.05, oDlg:nWidth/5/2.05  ;
        FLATBTN oBTNSpeichern ;
        PROMPT "DBF erstellen" ;
        SIZE 2, ( 32 ) /2.05 ;
        OF oDlg ;
        ACTION ( dbf_erstellen( aSortiert ) )
       
        @ ( oDlg:nHeight - 40 ) / 2.05,oDlg:nWidth/2/2.05 + oBTNSpeichern:nWidth + 10;
        FLATBTN oBTNWeiter ;
        PROMPT "Abbruch" ;
        SIZE 2, ( 32 ) /2.05 ;
        OF oDlg ;
        ACTION ( oDlg:End() ) ;
        CANCEL
       
        //----------------------------------------------------------------------------//
       
        ACTIVATE DIALOG oDlg CENTERED
       
        RELEASE FONT oFont
       
    return nil
   
    //----------------------------------------------------------------------------//
   
    function dbf_erstellen( aSortiert )
        local aTemp := {}
        local I := 1
        local aStructNeu := {}
        local cCode := ""
        local aTemp1 := {}
        local cBinData
        *----------------------------------------------------------
       
        FOR I:= 1 to len(aSortiert)
            if aSortiert[I, 2 ] > 560
                aadd( atemp, aSortiert[I] )
            endif
           
        next
       
        asort( atemp,,, { |x, y | x[3] < y[3] } )  
        asort( atemp,,, { |x, y | x[2] < y[2] } )
       
        //xbrowse(aTemp)
       
        cBinData := ASave( aTemp )                   // Converts Array Data and to Binary and stores in cStr
       
        memowrit( "structurfilter.txt", cBinData )
       
    return nil
    //----------------------------------------------------------------------------//
   
   
    function f_fieldsetup(oSay)
       
        local oDlg, oBtn, oGet, cName := space(10)
        local aPrompts := { "1","2","3","4","5","6","7","8","9","10","11","12" }
        local oCbx
        local nVar := "1"
       
        DEFINE DIALOG oDlg ;
        TITLE "Setup" ;
        FROM 5, 5 ;
        TO 15, 40 ;
        FONT oFont ;
        TRUEPIXEL
       
       
        @ 30,30 ;
        COMBOBOX oCbx ;
        VAR nVar ;
        PROMPTS aPrompts ;
        SIZE 100, 300 ;
        PIXEL ;
        OF oDlg
       
       
       
        @ 5, 2 BUTTON oBtn PROMPT "&Aceptar" OF oDlg SIZE 80,24 ;
        ACTION ( oSay:nWidth := 70 * val(nVar),oDlg:End() )
       
        @ 5,15 BUTTON "&Cancelar" OF oDlg SIZE 80,24 ;
        ACTION oDlg:End()
       
        ACTIVATE DIALOG oDlg ;
        CENTERED
       
       
    return nil



 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6008
Joined: Fri Oct 07, 2005 7:07 pm

Re: Button click action

Postby karinha » Tue Nov 23, 2021 4:17 pm

More or less...

https://imgur.com/Q1cwPpf

Image

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7215
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Button click action

Postby karinha » Tue Nov 23, 2021 5:44 pm

YES? SI!! Ahora está como me gusta. jajaja.

https://imgur.com/x92dvZ2

Image

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7215
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Button click action

Postby karinha » Tue Nov 23, 2021 5:46 pm

Code:

Code: Select all  Expand view

// \SAMPLES\OTTO3.PRG - 23/11/2021

#Include "FiveWin.ch"

#Define CLR_PINK       nRGB( 255, 128, 128 )
#Define CLR_MSPURPLE   nRGB( 0,   120, 215 )
#Define CLR_MSRED      nRGB( 232,  17,  35 )
#Define CLR_MSGRAY     nRGB( 229, 229, 229 )
#Define CLR_NBLUE      nRGB( 128, 128, 192 )

REQUEST DBFCDX
REQUEST DBFFPT

STATIC oBtn[ 200 ]
STATIC nColNext := 0
STATIC oFont, oFontBold
STATIC cABC := " "
STATIC aFields
STATIC aStructAlt
STATIC databaseName
STATIC oDlg
STATIC lVar := .T.

FUNCTION Main( cAufruf )

   LOCAL cRet              := ""
   LOCAL cFile
   LOCAL lSave             := .F.
   LOCAL oBtnEnde, oBtnSave, oFontSubl, cTitle, dDate, cTime
   LOCAL oBtnOK
   LOCAL nReihe            := 0
   LOCAL nCount            := 0
   LOCAL I                 := 0
   LOCAL nColOffset        := 3
   //    nWidth, nHeight  // 640 x 576
   //                         Resolution 1280 x 768
   LOCAL nWidth            := 800 // GetSysMetrics( 0 ) / 2
   LOCAL nHeight           := 600 // GetSysMetrics( 1 ) / 4 * 3
   LOCAL x                 := 0
   LOCAL nAbstand          := 0
   LOCAL y                 := 0
   LOCAL maxItems          := 0
   LOCAL hPen              := CreatePen( 1, 3, 4144959 )           // Rot
   LOCAL cDbf              := ""
   LOCAL aStruct           := {}
   LOCAL aTemp             := {}
   LOCAL nSpalten, cBinData, oGetTest, oSw
   LOCAL oSilDrawLi, SilDrawLi := REPLICATE( "_", 250 )

   SET CENTURY ON
   SET DATE BRITISH
   SET TIME FORMAT TO "HH:MM:SS"
   SET EPOCH TO YEAR( DATE() ) - 30

   IF ValType( cAufruf ) <> "U"

      databaseName := caufruf // ??

      USE CAUFRUF NEW  // EXCLUSIVE OR SHARED ?
      GO TOP

      aStruct := dbStruct()

      xBrowse( aStruct )

      cBinData := ASave( aStruct )                   // Converts Array Data and to Binary and stores in cStr

      MemoWrit( "struktur.txt", cBinData )

      cFile := cFilePath( GetModuleFileName( GetInstance() ) ) + "struktur.txt"

      WinExec( "Notepad.exe " + cFile ) // visual

   ELSE

      databaseName := ""

   ENDIF

   DEFINE FONT oFontSubl NAME "Courier New" SIZE 0, - 26 BOLD UnderLine
   DEFINE FONT oFont     NAME "TAHOMA"      SIZE 0, - 14 BOLD
   DEFINE FONT oFontBold NAME "TAHOMA"      SIZE 0, - 20 BOLD

   aFields := {}

   aTemp := ARead ( MemoRead( "struktur.txt" ) )

   xBrowse( aTemp )

   aStructAlt := aTemp

   AEval( aTemp, {| a |  AAdd( afields, { a[ 1 ], I += 1  } ) } )

   ASort( afields,,, {| x, y | x[ 1 ] < y[ 1 ] } )

   maxItems := Len( aFields )

   AAdd( afields, { "ROW",  maxItems + 1 }  )
   AAdd( afields, { "ROW",  maxItems + 2 }  )
   AAdd( afields, { "ROW",  maxItems + 3 }  )
   AAdd( afields, { "ROW",  maxItems + 4 }  )
   AAdd( afields, { "ROW",  maxItems + 5 }  )

   maxItems += 5

   dDate := DTOC( Date() )
   cTime := Time()

   cTitle := "OttoMatic: Auswahl - 1280 x 768 - " + dDate + " - " + cTime

   DEFINE DIALOG oDlg TITLE cTitle  FROM 0, 0      ;
      TO nHeight, nWidth PIXEL COLORS CLR_MSGRAY, CLR_WHITE TRANSPARENT

   oDlg:lHelpIcon := .F.

   nWidth := nWidth / 6 * 4

   @ 02, 020 SAY "OttoMatic Corp." OF oDlg PIXEL UPDATE                      ;
      FONT oFontBold COLORS CLR_CYAN, CLR_WHITE

   @ 02, 130 SAY "Drag the Button to Action" OF oDlg PIXEL UPDATE            ;
      FONT oFontBold COLORS CLR_CYAN, CLR_WHITE

   @ 02, 290 SAY "Database Fields" OF oDlg PIXEL UPDATE FONT oFontBold       ;
      COLORS CLR_CYAN, CLR_WHITE

   @  06, 000 SAY oSilDrawLi VAR SilDrawLi SIZE 400, 15 OF oDlg UPDATE       ;
      PIXEL FONT oFontBold COLORS CLR_PINK, CLR_WHITE TRANSPARENT

   @ 19.50, 110 SAY "Choose a Button to Drag" OF oDlg PIXEL UPDATE           ;
      FONT oFontSubl COLORS CLR_CYAN, CLR_WHITE

   // lVar := .T. -> CHECKBOX?
   @ ( nHeight / 3 * 2 + 25 ) / 2.050, 250 SWITCH oSw VAR lVar SIZE 10, 10   ;
      PIXEL OF oDlg COLOR CLR_WHITE, RGB( 255, 128,   0 )

   oSw:cToolTip := "Click me"

   @ ( nHeight / 3 * 2 + 25 ) / 2.05, 0 SAY " New Database " OF oDlg PIXEL   ;
      FONT oFontBold UPDATE COLORS CLR_CYAN, CLR_WHITE TRANSPARENT

   nSpalten    := Int(   nWidth / 105 ) - 1
   x           := nSpalten   // 3//10
   y           := 18 // 35 // 15
   nAbstand    := nWidth / 5 * 4 / 5
   nColOffset  := 20

   FOR nReihe = 0 TO maxItems / 5

      SYSREFRESH()

      nColNext := 5

      FOR I = 1 TO x

         SYSREFRESH()

         nCount := nCount + 1

         IF nCount > maxItems

            EXIT

         ENDIF

         // nRow, nCol, aVar, n, oWnd
         oBtn[ nCount ] := MakeGet( ( 3 + y * nReihe ),                     ;
            nColOffset / 2.05 + ( nWidth - 20 * 2 ) / x / 2.05 * ( I - 1 ), ;
            aFields,                                                        ;
            nCount )

      NEXT

   NEXT

   // What is the need for all this engineering? 2.05
   //   ? nWidth / 2 / 2.05 // Center of Dialog. Crazy. hahahaha.
   @ ( nHeight - 50 ) / 2.05, nWidth / 2 / 1.30 - 50 FLATBTN oBtnSave ;
      PROMPT "&Save" SIZE 50 / 2.05 + 5, 27 / 1.95 OF oDlg            ;
      COLOR CLR_BLACK, CLR_YELLOW FONT oFont                          ;
      ACTION Save( oDlg, nHeight )

   oBtnSave:cToolTip := "Grabar / Record"

   //   ? nWidth / 2 / 2.05 // Abbruch
   @ ( nHeight - 50 ) / 2.05, nWidth / 2 / 1.30      FLATBTN oBtnEnde ;
      PROMPT "&Exit" SIZE 50 / 2.05 + 5, 27 / 1.95 OF oDlg            ;
      COLOR CLR_BLACK, CLR_YELLOW  FONT oFont                         ;
      ACTION( oDlg:End() )

   oBtnEnde:cToolTip := "Salida / Exit"

   SelectObject( oDlg:hDc, hPen )

   ACTIVATE DIALOG oDlg CENTERED               ;
      ON INIT(  dragModus( oBtn, nCount )   )  ;
      ON PAINT(  oDlg:line( nHeight / 3 * 2, 0, nHeight / 3 * 2, nWidth + 300 ) )

   /*
   IF lSave = .T.
   ENDIF
   */


   oFont:End()
   oFontBold:End()
   oFontSubl:End()

RETURN NIL

STATIC FUNCTION MakeGet( nRow, nCol, aVar, n  )

   LOCAL oget

   IF cABC <> Left( aVar[ n, 1 ], 1 )

      @ nRow + 35, nColNext + 45 BTNBMP oGet PROMPT aVar[ n, 1 ] OF oDlg  PIXEL ;
         FONT oFontBold SIZE  70, 14 COLOR CLR_MSPURPLE UPDATE

      cABC := Left( aVar[ n, 1 ], 1 )

   ELSE // VACIO / EMPTY OR NOT

      @ nRow + 35, nColNext + 45 BTNBMP oGet PROMPT aVar[ n, 1 ] OF oDlg  PIXEL ;
         FONT oFont SIZE  70, 14 COLOR CLR_MSRED UPDATE

   ENDIF

   oGet:cToolTip := "Drag the Button to Action"

   oGet:Cargo := aVar[ n, 2 ]

   oGet:bPostDrag := {| oSay | osay:ntop := Int( osay:ntop / 20 ) * 20,    ;
      IIF( lVar = .T., f_fieldsetup( oSay ), )   }

   nColNext := nColNext + oGet:nWidth + 5

   oGet:lDrag := .T.

RETURN( oGet )

FUNCTION Save( oWnd, nHeight )

   LOCAL I := 0
   LOCAL oCtrl
   LOCAL aSortiert := {}

   FOR EACH oCtrl in oWnd:aControls

      I += 1

      IF oCtrl:cTitle = "Abbruch"         .OR. ;
         oCtrl:cTitle = "Save"            .OR. ;
         oCtrl:cTitle = "Database Fields" .OR. ;
         oCtrl:cTitle = "New Database"

      ELSE

         AAdd( aSortiert, { oCtrl:cTitle, oCtrl:nTop, oCtrl:nLeft, "Auswahl", oCtrl:Cargo, oCtrl:nWidth } )

      ENDIF

   NEXT

   f_xBrowse( aSortiert )

RETURN NIL

FUNCTION f_xBrowse( aSortiert )

   LOCAL oDlg, oBrw, oFont
   LOCAL oBTNSpeichern
   LOCAL oBTNWeiter
   LOCAL lOK         := .F.
   LOCAL cBuchungsNr := ""
   LOCAL aGaeste     := {}

   DEFINE FONT oFont NAME 'Tahoma' SIZE 0, - 14

   DEFINE DIALOG oDlg TITLE "Liste aller Einstellungen" SIZE 800, 540 PIXEL ;
      FONT oFont

   oDlg:lHelpIcon := .F.

   @ 10, 10 XBROWSE oBrw OF oDlg PIXEL SIZE 500, 200                        ;
      DATASOURCE aSortiert AUTOSORT NOBORDER

   oBrw:cToolTip := "Liste aller Einstellungen"

   oBrw:nMarqueeStyle    = MARQSTYLE_HIGHLWIN7
   oBrw:CreateFromCode()

   @ ( oDlg:nHeight - 40 ) / 2.05, oDlg:nWidth / 5 / 2.05 ;
      FLATBTN oBTNSpeichern PROMPT "DBF erstellen" SIZE 2, ( 32 ) / 2.05    ;
      OF oDlg ACTION ( dbf_erstellen( aSortiert, oDlg ) )

   oBTNSpeichern:cToolTip := "DBF erstellen - Grabar - Record"

   @ ( oDlg:nHeight - 40 ) / 2.05, oDlg:nWidth / 2 / 2.05 + ;
      oBTNSpeichern:nWidth + 10 FLATBTN oBTNWeiter PROMPT "Abbruch" ;
      SIZE 2, ( 32 ) / 2.05 OF oDlg ACTION( oDlg:End() ) CANCEL

   oBTNWeiter:cToolTip := "Abbruch - Exit - Salida"

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

RETURN NIL

FUNCTION Dbf_erstellen( aSortiert, oDlg )   // grabar / record

   LOCAL aTemp      := {}
   LOCAL I          := 1
   LOCAL aStructNeu := {}
   LOCAL cCode      := ""
   LOCAL aTemp1     := {}
   LOCAL cBinData, cFile

   FOR I := 1 TO Len( aSortiert )

      IF aSortiert[ I, 2 ] > 560

         AAdd( atemp, aSortiert[ I ] )

      ENDIF

   NEXT

   ASort( atemp,,, {| x, y | x[ 3 ] < y[ 3 ] } )
   ASort( atemp,,, {| x, y | x[ 2 ] < y[ 2 ] } )

   // xBrowse(aTemp)

   cBinData := ASave( aTemp ) // Converts Array Data and to Binary and stores in cStr

   // MemoWrit( "structurfilter.txt", cBinData )
   MemoWrit( "strucfil.txt", cBinData )  // only test

   MsgInfo( "Recording Successfully Made." +CRLF + ;
            "<Enter> To Continue...      ",        ;
            "Attention!                  " )

   cFile := cFilePath( GetModuleFileName( GetInstance() ) ) + "strucfil.txt"

   WinExec( "Notepad.exe " + cFile ) // visual

   oDlg:End() // close dialog.

RETURN NIL

FUNCTION F_fieldsetup( oSay )

   LOCAL oDlg, oBtn, oGet, cName := Space( 10 )
   LOCAL aPrompts := { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }
   LOCAL oCbx, oExit
   LOCAL nVar := "1"

   DEFINE DIALOG oDlg TITLE "Setup" FROM 5, 5 TO 15, 40 FONT oFont TRUEPIXEL

   oDlg:lHelpIcon := .F.

   @ 30, 30 COMBOBOX oCbx VAR nVar PROMPTS aPrompts SIZE 100, 300 PIXEL ;
      OF oDlg STYLE CBS_DROPDOWN FONT oFont UPDATE

   @ 5, 10 BUTTON oBtn PROMPT "&Aceptar" OF oDlg SIZE 80, 24            ;
      ACTION ( oSay:nWidth := 70 * Val( nVar ), oDlg:End() )

   @ 5, 25 BUTTON oExit PROMPT "&Cancelar" OF oDlg SIZE 80, 24          ;
      ACTION( oDlg:End() ) CANCEL

   SET FONT OF oBtn  TO oFont
   SET FONT OF oExit TO oFont

   ACTIVATE DIALOG oDlg CENTERED

RETURN NIL

FUNCTION DragModus( oBtn, nCount )

   LOCAL I := 0

   FOR I := 1 TO nCount - 1
      // oBtn[ I ]:lDrag := .t.
   NEXT

RETURN NIL

// fin / end
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7215
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Button click action

Postby Otto » Tue Nov 23, 2021 6:25 pm

Joao,
So much nicer now.

This is old code. /2-05 I used as I have a feeling for pixel and before TRUEPIXEL you had to convert. size in DIALOG / 2.05 to have it like in WINDOW.


As I am working on a large screen, scrolling for me is not necessary.
But otherwise it would be fine if we could scroll the upper and lower part of the screen.


Best regards,
Otto



What is the purpose of this program?
This program creates HTML source code for bootstrap forms.
But you can also use it to create a new database.

https://www.w3schools.com/bootstrap/boo ... system.asp
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6008
Joined: Fri Oct 07, 2005 7:07 pm

Re: Button click action

Postby karinha » Tue Nov 23, 2021 6:34 pm

Excellent program, I learned a lot by reading and modifying the original. I am so grateful for this fantastic programming lesson. Living and learning. Thank you master Otto

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7215
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Button click action

Postby Otto » Tue Nov 23, 2021 7:16 pm

Hello Joao

If you are interested and would like to participate, I can post the whole program.

It's a bit of spaghetti code, but this is about the job that needs to be done.
I post the flowchart once again. This is what modtools does.

Best regards,
Otto


Best regards,
Otto



Image


Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6008
Joined: Fri Oct 07, 2005 7:07 pm

Re: Button click action

Postby karinha » Wed Nov 24, 2021 12:06 am

Good evening master Otto, would this be the beginning of learning MOD_HARBOUR?

Buenas noches maestro Otto, ¿sería este el comienzo de aprender MOD_HARBOUR?

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7215
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: karinha and 88 guests