FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour add page to tabfolderex on dialog / another view for samples
Posts: 104
Joined: Tue Feb 09, 2021 04:20 PM
add page to tabfolderex on dialog / another view for samples
Posted: Tue May 13, 2025 09:17 PM
I am colaborating with hwgui, and now I am trying do the same on fivewin.
I think it becames interesting.

a working sample using folderex
/*
demofolderex.prg
*/

#include "fivewin.ch"

FUNCTION DemoFolderEx( lWithDialog, oDlg )

   LOCAL oTab

   hb_Default( @lWithDialog, .T. )

   FW_SetTruePixel(.T.)

   IF lWIthDialog
      DEFINE DIALOG oDlg ;
         TITLE "demofolderex" ;
         SIZE 1024, 768
   ENDIF

   @ 50, 50 FOLDEREX oTab ;
         PROMPTS "demofolderex" OF oDlg ;
         TAB HEIGHT 22 ;
         SIZE  800, 600 ;
         PIXEL

   IF lWithDialog
      ACTIVATE DIALOG oDlg CENTER
   ENDIF

   (oTab) // warning -w3 -es2

   RETURN Nil
a working sample using button
/*
demobutton.prg
*/

#include "fivewin.ch"

FUNCTION DemoButton( lWithDialog, oDlg )

   LOCAL oButton

   hb_Default( @lWithDialog, .T. )

   FW_SetTruePixel(.T.)

   IF lWIthDialog
      DEFINE DIALOG oDlg ;
         TITLE "demobutton" ;
         SIZE 1024, 768
   ENDIF

   @ 100, 100 BUTTONBMP oButton ;
      PROMPT "test" ;
      OF oDlg ;
      SIZE 200, 25 ;
      PIXEL ;
      ; // RESOURCE cResName TOP ;
      ACTION MsgStop( "ok" )

   IF lWithDialog
      ACTIVATE DIALOG oDlg CENTER
   ENDIF

   (oButton) // warning -w3 -es2

   RETURN Nil
a working sample using checkbox
/*
democheckbox.prg
*/

#include "fivewin.ch"

FUNCTION DemoCheckbox( lWithDialog, oDlg )

   LOCAL oCheck, lValue := .T.

   hb_Default( @lWithDialog, .T. )

   FW_SetTruePixel(.T.)

   IF lWIthDialog
      DEFINE DIALOG oDlg ;
         TITLE "democheckbox" ;
         SIZE 1024, 768
   ENDIF

   @ 100, 100 CHECKBOX oCheck VAR lValue PROMPT "The Option" PIXEL ;
      SIZE 200, 25 OF oDlg

   IF lWithDialog
      ACTIVATE DIALOG oDlg CENTER
   ENDIF

   (oCheck) // warning -w3 -es2

   RETURN Nil
This is the interesting part: a working sample using all previous samples
/*
demoall.prg
*/

#include "fivewin.ch"

FUNCTION DemoAll()

   LOCAL oDlg, oTab, oPage

   FW_SetTruePixel(.T.)

   DEFINE DIALOG oDlg ;
      TITLE "demoall" ;
      SIZE 1024, 768

   @ 50, 50 FOLDEREX oTab ;
         PROMPTS "X","X","X","X","X" OF oDlg ;
         TAB HEIGHT 22 ;
         SIZE  900, 700 ;
         PIXEL

   oTab:aPrompts[ 1 ] := "folderex"
   oPage := oTab:aDialogs[ 1 ]

   DemoFolderEx( .F., oPage )

   oTab:Refresh()

   oTab:aPrompts[ 2 ] := "button"
   oPage := oTab:aDialogs[ 2 ]

   DemoButton( .F., oPage )

   oTab:Refresh()

   oTab:aPrompts[ 3 ] := "checkbox"
   oPage := oTab:aDialogs[3]

   DemoCheckbox( .F., oPage )

   oTab:Refresh()

   aSize( oTab:aPrompts, 3 )

   ACTIVATE DIALOG oDlg CENTER

   (oTab) // warning -w3 -es2

   RETURN Nil

An extra is to add buttons to run dialog standalone and to show source code.
Code is the same, for dialog or tabpage.
DemoCheckbox() -> run as dialog / standalone
DemoCheckbox( .F., oPage ) -> run on tabpage

I like the result, it is to choose a sample by image of what is needed.
Better than compile one by one.

My question:
Using DIALOG, how to add pages to folderex ?
On demoall I created several pages and remove not needed pages.
oTab:AddItem() cause error.

José M. C. Quintas Brazil

gtwvg, fivewin 25.12, hwgui, mingw 15.2 (32 bits)

Posts: 104
Joined: Tue Feb 09, 2021 04:20 PM
Re: add page to tabfolderex on dialog / another view for samples
Posted: Tue May 13, 2025 09:23 PM


Result of demoall is one sample on each page without to need another source code.

José M. C. Quintas Brazil

gtwvg, fivewin 25.12, hwgui, mingw 15.2 (32 bits)

Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Re: add page to tabfolderex on dialog / another view for samples
Posted: Wed May 14, 2025 11:23 AM

oFld:AddItem('Nova Aba')

ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
Posts: 104
Joined: Tue Feb 09, 2021 04:20 PM
Re: add page to tabfolderex on dialog / another view for samples
Posted: Wed May 14, 2025 04:02 PM


2 levels of folderex now, and button for samples that I try change to folderex but I can't.
/*
demoall.prg
*/

#include "fivewin.ch"

STATIC aMenuOptions := {}, nMenuLevel := 0

FUNCTION DemoAll()

   LOCAL oDlg, aInitList := {}
   LOCAL oTabLevel1, nIndexLevel1, aOption1
   LOCAL oTabLevel2 := Array(100), nIndexLevel2, aOption2, nTab2Index := 0
   LOCAL oButton := Array(100), nButtonIndex := 0

   FW_SetTruePixel(.T.)

   DEFINE DIALOG oDlg ;
      TITLE "demoall" ;
      SIZE 1024, 768

   MenuOption( "browse" )
      MenuDrop()
      MenuOption( "demoxbsubtot",                  { |o| DemoxbSubTot( .F., o ) } )
      MenuOption( "zodiac",                        { |o| DemoZodiac( .F., o ) } )
      MenuOption( "xbrwpages", "xbwrwpages",       { || Demoxbrwpages() } )
      MenuUnDrop()
   MenuOption( "button",                           { |o| DemoButton( .F., o ) } )
   MenuOption( "checkbox",                         { |o| DemoCheckbox( .F., o ) } )
   MenuOption( "folderex",                         { |o| DemoFolderEx( .F., o ) } )
   MenuOption( "zorder",                           { |o| DemoZorder( .F., o ) } )

   @ 50, 50 FOLDEREX oTabLevel1 ;
      PROMPTS ListOfTabPages() ;
      OF oDlg ;
      TAB HEIGHT 22 ;
      SIZE  900, 700 ;
      PIXEL
   nIndexLevel1 := 0
   FOR EACH aOption1 IN aMenuOptions
      oTabLevel1:aPrompts[ ++nIndexLevel1 ] := aOption1[ 1 ]
      IF Empty( aOption1[ 2 ] )
         Eval( aOption1[ 3 ], oTabLevel1:aDialogs[ nIndexLevel1 ] )
      ELSE
         @ 50, 50 FOLDEREX oTabLevel2[ ++nTab2Index ] ;
            PROMPTS ListOfTabPages() ;
            OF oTabLevel1:aDialogs[ nIndexLevel1 ]  ;
            TAB HEIGHT 22 ;
            SIZE  800, 600 ;
            PIXEL
         nIndexLevel2 := 0
         FOR EACH aOption2 IN aOption1[ 2 ]
            oTabLevel2[ nTab2Index ]:aPrompts[ ++nIndexLevel2 ] := aOption2[ 1 ]
            IF ValType( aOption2[3] ) == "C"
               @ 100, 100 BUTTONBMP oButton[ ++nButtonIndex ] ;
                  PROMPT aOption2[1] ;
                  OF oTabLevel2[ nTab2Index ]:aDialogs[ nIndexLevel2 ] ;
                  SIZE 200, 25 ;
                  PIXEL ;
                  ; // RESOURCE cResName TOP ;
                  ACTION Eval( aOption2[4] )
            ELSE
               Eval( aOption2[ 3 ], oTabLevel2[ nTab2Index ]:aDialogs[ nIndexLevel2 ] )
            ENDIF
         NEXT
         aSize( oTabLevel2[ nTab2Index ]:aPrompts, nIndexLevel2 )
      ENDIF
   NEXT
   aSize( oTabLevel1:aPrompts, nIndexLevel1 )

   ACTIVATE DIALOG oDlg CENTER ;
      ON INIT ( Self, ExecuteInit( aInitList ) )

   RETURN Nil

STATIC FUNCTION ListOfTabPages()

   LOCAL aList := Array(100)
   AFill( aList, "" )

   RETURN aList

STATIC FUNCTION MenuOption( cCaption, bCodeOrString, bCode )

   LOCAL nCont, aLastMenu

   aLastMenu := aMenuOptions
   FOR nCont = 1 TO nMenuLevel
      aLastMenu := aLastMenu[ Len( aLastMenu ) ]
      aLastMenu := aLastMenu[ 2 ]
   NEXT
   AAdd( aLastMenu, { ccaption, {}, bCodeOrString, bCode } )

   RETURN Nil

STATIC FUNCTION MenuDrop()

   nMenuLevel++

   RETURN Nil

STATIC FUNCTION MenuUndrop()

   nMenuLevel --

   RETURN Nil

STATIC FUNCTION ExecuteInit( aInitList )

   LOCAL bCode

   IF .F.
   FOR EACH bCode In aInitList
      Eval( bCode )
   NEXT
   ENDIF

   RETURN Nil
aInitList is an array of DIALOG INIT.
When sample works inside demoall, it does not have dialog, than add to this array, to execute on demoall dialog init.
The sample can works standalone using own dialog, or inside folderex of demoall dialog.

It is an interesting test of possibilities.
Some things can work using WINDOW only, some things can work using a DIALOG INIT, others need more tests.
Can detect differences and solve them, before they occurs on application.
Now using fivewin samples.

José M. C. Quintas Brazil

gtwvg, fivewin 25.12, hwgui, mingw 15.2 (32 bits)

Posts: 104
Joined: Tue Feb 09, 2021 04:20 PM
Re: add page to tabfolderex on dialog / another view for samples
Posted: Wed May 14, 2025 04:57 PM
 Pasta de d:\github\fivewin\samples

14/05/2025  10:49         6.327.296 demoall.exe
13/05/2025  16:36         6.681.088 demobutton.exe
13/05/2025  16:57         6.681.088 democheckbox.exe
13/05/2025  15:12         6.724.096 demofolderex.exe
14/05/2025  10:32         6.271.488 demoxbrwpages.exe
14/05/2025  00:53         6.682.112 demozorder.exe
I do not understand this:
demoall is all together.
How can all together be smaller?

José M. C. Quintas Brazil

gtwvg, fivewin 25.12, hwgui, mingw 15.2 (32 bits)

Continue the discussion