Amending preprocessor directive for TFolderEx

Amending preprocessor directive for TFolderEx

Postby hua » Fri Dec 16, 2022 4:18 am

I am trying to build a dynamic TFolderEx so when it is REDEFINE, the value for aPrompts and aDialogs will come from file.

What do I need to change at its pre-processor directive so instead of coding
Code: Select all  Expand view
   REDEFINE FOLDEREX ::oFolder ID 110 OF ::oDlg   ;
      PROMPTS "tab1", "tab2" ;
      DIALOGS "dlg1", "dlg2"
 


I could also pass arrays for prompts and dialogs like this
Code: Select all  Expand view
   REDEFINE FOLDEREX ::oFolder ID 110 OF ::oDlg   ;
      PROMPTS {"tab1", "tab2"} ;
      DIALOGS {"dlg1", "dlg2"}
 


Can the #xcommand be coded to be able to accept both format?

TIA

Excerpt from FWH19.12's folder.ch;
Code: Select all  Expand view

#xcommand REDEFINE FOLDEREX [<oFolder>];
             [ ID <nId> ] ;
             [ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
             [ <prm: PROMPT, PROMPTS, ITEMS> <cPrompt,...> ] ;
             [ <bm: BITMAPS, IMAGES, BMPS> <cbmps,...> ] ;
             [ <dlg: DIALOG, DIALOGS, PAGE, PAGES> <cDlgsName,...> ] ;
             [ TAB HEIGHT <ntabheight> ];
             [ OPTION <nOption> ] ;
             [ ROUND <nRound> ];
             [ SEPARATOR <nSep> ];
             [ <lAdjust: ADJUST> ] ;
             [ <lStretch: STRETCH> ] ;
             [ POPUP <upop>];
             [ ALIGN <nAlign,...> ] ;
             [ BRIGHT <nBright> ] ;
             [ ACTION <uAction> ];
             [ ON CHANGE <uChange> ] ;
             [ ON PAINT TAB <uPaint> ];
             [ ON PAINT TEXT <uPaintxt> ];
             [ HELPTOPICS <cnHelpids,...> ] ;
             [ <layout: TOP, LEFT, BOTTOM, RIGHT> ] ;
             [ <lAnimate: ANIMATE> [ SPEED <nSpeed> ] ] ;
             [ FONT <oFont> ]; //-->> byte-one 2010
             [ <lTransparent: TRANSPARENT> ]
             [ <lBorder: NOBORDER > ] ;
             [ COLOR <nClrPane> ] ;
        => ;
             [<oFolder> := ] TFoldereX():ReDefine( <nId>, <oWnd>, [\{<cDlgsName>\}],;
             [\{<cbmps>\}], [\{<cPrompt>\}], <ntabheight>, [\{<cnHelpids>\}],;
             <nRound>, [{|nOption,nOldOption,Self| <uChange>}],;
             [{|Self,nOption| <uPaint>}], [{|Self,nOption| <uPaintxt>}], ;
             [\{<nAlign>\}], <.lAdjust.>, <nSep>, <nOption>, ;
             [{|Self,nOption| <upop>}], <.lStretch.>, [ Upper(<(layout)>) ],;
             [{|Self,nOption| <uAction>}], <nBright>, <.lAnimate.>, [<nSpeed>], ;
             <oFont>, <.lTransparent.>, <.lBorder.>, <nClrPane> )

 
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Amending preprocessor directive for TFolderEx

Postby Antonio Linares » Fri Dec 16, 2022 9:28 am

Dear Hua,

Please try this:
Code: Select all  Expand view
#xcommand REDEFINE FOLDEREX [<oFolder>];
             [ ID <nId> ] ;
             [ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
             [ <prm: PROMPT, PROMPTS, ITEMS> <cPrompt,...> ] ;
             [ <prm: PROMPT, PROMPTS, ITEMS> \{<cPrompt,...>\} ] ;
             [ <bm: BITMAPS, IMAGES, BMPS> <cbmps,...> ] ;
             [ <dlg: DIALOG, DIALOGS, PAGE, PAGES> <cDlgsName,...> ] ;
             [ <dlg: DIALOG, DIALOGS, PAGE, PAGES> \{<cDlgsName,...>\} ] ;
             [ TAB HEIGHT <ntabheight> ];
             [ OPTION <nOption> ] ;
             [ ROUND <nRound> ];
             [ SEPARATOR <nSep> ];
             [ <lAdjust: ADJUST> ] ;
             [ <lStretch: STRETCH> ] ;
             [ POPUP <upop>];
             [ ALIGN <nAlign,...> ] ;
             [ BRIGHT <nBright> ] ;
             [ ACTION <uAction> ];
             [ ON CHANGE <uChange> ] ;
             [ ON PAINT TAB <uPaint> ];
             [ ON PAINT TEXT <uPaintxt> ];
             [ HELPTOPICS <cnHelpids,...> ] ;
             [ <layout: TOP, LEFT, BOTTOM, RIGHT> ] ;
             [ <lAnimate: ANIMATE> [ SPEED <nSpeed> ] ] ;
             [ FONT <oFont> ]; //-->> byte-one 2010
             [ <lTransparent: TRANSPARENT> ] ;
             [ <lBorder: NOBORDER > ] ;
             [ COLOR <nClrPane> ] ;
        => ;
             [<oFolder> := ] TFoldereX():ReDefine( <nId>, <oWnd>, [\{<cDlgsName>\}],;
             [\{<cbmps>\}], [\{<cPrompt>\}], <ntabheight>, [\{<cnHelpids>\}],;
             <nRound>, [{|nOption,nOldOption,Self| <uChange>}],;
             [{|Self,nOption| <uPaint>}], [{|Self,nOption| <uPaintxt>}], ;
             [\{<nAlign>\}], <.lAdjust.>, <nSep>, <nOption>, ;
             [{|Self,nOption| <upop>}], <.lStretch.>, [ Upper(<(layout)>) ],;
             [{|Self,nOption| <uAction>}], <nBright>, <.lAnimate.>, [<nSpeed>], ;
             <oFont>, <.lTransparent.>, <.lBorder.>, <nClrPane> )
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Amending preprocessor directive for TFolderEx

Postby hmpaquito » Fri Dec 16, 2022 10:15 am

Hola Antonio,

Viendo el comando no creo que funcione.
El compañero, en realidad, plantea poder usar algo como:


Code: Select all  Expand view
  REDEFINE FOLDEREX ::oFolder ID 110 OF ::oDlg   ;
      PROMPTS aPrompts ;
      DIALOGS  aDialogs
 


En su día lo comenté contigo en este foro: Las clausulas lista son extremadamente rigidas cuando el numero de items varía. A eso me comentaste que hace muchos años que se hizo y que si hubieramos sabido lo que hoy sabemos... Yo a eso sólo pude darte la razón.... jajajajajaajajajajajajajajajajaajajajajajajajaja

Pero evidentemente se puede implementar el "dinamismo". En mi caso lo haría añadiendo segundas clausulas como en este ejemplo:

Code: Select all  Expand view
  REDEFINE FOLDEREX ::oFolder ID 110 OF ::oDlg   ;
      aPROMPTS aPrompts ;
      aDIALOGS  aDialogs
 


Salu2
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Amending preprocessor directive for TFolderEx

Postby Antonio Linares » Fri Dec 16, 2022 4:46 pm

El problema es que en la salida siempre añadimos { ... }

Habria que modificar la clase para que detecte si hay un subarray
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Amending preprocessor directive for TFolderEx

Postby hua » Mon Dec 19, 2022 4:08 am

Thanks Antonio!
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 78 guests