Amending preprocessor directive for TFolderEx

Post Reply
hua
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Amending preprocessor directive for TFolderEx

Post by hua »

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

    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

    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

#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
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Amending preprocessor directive for TFolderEx

Post by Antonio Linares »

Dear Hua,

Please try this:

Code: Select all | Expand

#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
hmpaquito
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Amending preprocessor directive for TFolderEx

Post by hmpaquito »

Hola Antonio,

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

Code: Select all | Expand

   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

   REDEFINE FOLDEREX ::oFolder ID 110 OF ::oDlg   ;
      aPROMPTS aPrompts ;
      aDIALOGS  aDialogs 
 
Salu2
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Amending preprocessor directive for TFolderEx

Post by Antonio Linares »

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
hua
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Amending preprocessor directive for TFolderEx

Post by hua »

Thanks Antonio!
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
Post Reply