Hi,
I have to create a Dialog with a variable number of folder.
From code (not from res with redefine)
Here's my sample code
It works but I have to substitute this line of code...
@ 1 , 1 FOLDER oFld OF oDlg ;
PROMPT "Pag&1" , ;
"Pag&2" , ;
"Pag&3" , ;
"Pag&4" ;
SIZE 400 , 400 PIXEL
with something else that permit to me to manage a variable number of folders
I have tried with
oFld:Additem("1")
oFld:Additem("2")
without success
#include "fivewin.ch"
FUNCTION MAIN
LOCAL oDlg
LOCAL oFld
LOCAL nPag , nRow , nCol
LOCAL nMaxPag := 4
DECLARE aEti[ 4 , 2 , 2 ]
DECLARE oEti[ 4 , 2 , 2 ]
FOR nPag := 1 TO 4
FOR nRow := 1 TO 2
FOR nCol := 1 TO 2
oEti[ nPag , nRow, nCol ] := NIL
aEti[ nPag , nRow, nCol ] := STR( nPag,3 ) + STR( nRow,3 ) + STR( nCol,3 )
NEXT nCol
NEXT nRow
NEXT nPag
DEFINE DIALOG oDlg FROM 0 , 0 TO 600 , 600 PIXEL
@ 1 , 1 FOLDER oFld OF oDlg ;
PROMPT "Pag&1" , ;
"Pag&2" , ;
"Pag&3" , ;
"Pag&4" ;
SIZE 400 , 400 PIXEL
FOR nPag := 1 TO 4
FOR nRow := 1 TO 2
FOR nCol := 1 TO 2
creaget( oFld, nPag , nRow , nCol , oEti, aEti )
NEXT nCol
NEXT nRow
NEXT nPag
ACTIVATE DIALOG oDlg CENTER
RETURN NIL
FUNCTION CREAGET( oFld, nPag, nRow, nCol , oEti, aEti )
@ nRow * 20 , nCol * 100 - 50 GET oEti[ nPag, nRow, nCol ] VAR aEti[ nPag, nRow, nCol ] ;
OF oFld:adialogs[ nPag ] SIZE 60 , 20 PIXEL
RETURN NIL