DEFINE FOLDER Creates a folder control. |
A Folder allows the user to define multiple pages for the same area of dialog box. Each page consists of a certain type of information or a group of controls that the application displays when the user selects the corresponding page.
Folder from Resources
DEFINE FOLDER <FolderName>
[ OF| PARENT> < ParentWindowName > ]
RESOURCE <res>
[ CAPTION <cCaption> ]
[ FONT <FontName> ]
[ SIZE <FontSize> ]
[ BOLD ]
[ ITALIC]
[ MODAL ]
[ ON FOLDERPROC <FolderProcedureName> | <bBlock> [ APPLYBTN> ] ]
[ ON INIT <InitProcedureName> | <bBlock>]
[ ON CANCEL <CancelProcedureName> | <bBlock>]
[ ON HELP <HelpProcedureName> | <bBlock>]
[ MULTILINE> ]
[ BUTTONS> ]
[ FLAT> ]
[ HOTTRACK> ]
[ VERTICAL> ]
[ BOTTOM> ]
Folder created from memory
DEFINE FOLDER <
FolderName >
[ OF| PARENT < ParentWindowName > ]
AT <nRow>,<nCol>
[ WIDTH < nWidth > ]
[ HEIGHT <nHeight> ]
[ CAPTION <cCaption> ]
[ FONT <FontName> ]
[ SIZE <FontSize> ]
[ BOLD ]
[ ITALIC]
[ MODAL ]
[ ON FOLDERPROC <FolderProcedureName> | <bBlock> [ APPLYBTN> ] ]
[ ON INIT <InitProcedureName> | <bBlock>]
[ ON CANCEL <CancelProcedureName> | <bBlock>]
[ ON HELP <HelpProcedureName> | <bBlock>]
[ MULTILINE> ]
[ BUTTONS> ]
[ FLAT> ]
[ HOTTRACK> ]
[ VERTICAL> ]
[ BOTTOM> ]
Folder Page (Dialog box) from resources
FOLDERPAGE <FolderName> RESOURCE <id>
[ TITLE <cTitle> ]
[ IMAGE <cImageName> ]
Folder Page (Dialog box) with Controls created in Memory
DEFINE FOLDERPAGE <
FolderName > [ RESOURCE <id> ]
[ TITLE <cTitle> ]
[IMAGE <cImageName> ]
... Control Definitions...
END FOLDERPAGE ;
END FOLDER ;
NOTE:
It is possible to call out in double method FOLDERPRC :
· Any FolderPageDialogFunction, - then it can be used in function predefined
variables:
DLG_HWND - Page Dialog Handle
DLG_MSG - Page Dialog Message
DLG_ID - Page Dialog Id
DLG_NOT - Page Dialog Notification
Code Example:
Function PageDialogFun(lOk, nNewAge)
Local ret := 0, cValue
if DLG_ID != Nil
do case
case DLG_ID == IDOK .and. DLG_NOT ==0
_ReleaseDialog ( )
case DLG_ID == IDCANCEL .and. DLG_NOT ==0
_ReleaseDialog ( )
case DLG_ID == IDC_EDT1 .and. DLG_NOT ==1024
cValue := GetEditText (DLG_HWND, IDC_EDT1 )
if !empty(cValue)
EnableDialogItem (DLG_HWND, IDC_BTN1)
else
DisableDialogItem (DLG_HWND, IDC_BTN1)
endif
case DLG_ID == IDC_BTN1 .and. DLG_NOT ==0
ret := GetEditText (DLG_HWND, IDC_EDT1 )
nNewAge := ret
lOk := .t.
_ReleaseDialog ( )
case DLG_ID == IDC_BTN2 .and. DLG_NOT ==0
SetDialogItemText(DLG_HWND, IDC_EDT1 ," " )
DisableDialogItem (DLG_HWND, IDC_BTN1)
case DLG_ID == IDC_BTN3 .and. DLG_NOT ==0
_ReleaseDialog ( )
endcase
endif
Return ret
· CodeBlok in form {|x,y,z,v| DialogFunction(x,y,z,v) }
Particular parameters mark:
x - Dialog Handle
y - Dialog Message
z - Dialog Id
v - Dialog Notification
FUNCTIONS:
The page dialog box functions is responsible for initializing the controls to these settings when creating the page dialog box. It is also responsible for retrieving the current settings from the controls before destroying the page dialog box.
EXAMPLE: