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 <cFontName> ]
[ SIZE <cFontSize> ]
[ BOLD ]
[ ITALIC]
[ MODAL ]
[ ON FOLDERPROC <OnFolderProcedure> | <bBlock> [ APPLYBTN> ] ]
[ ON INIT <OnInitProcedure> | <bBlock>]
[ ON CANCEL <OnCancelProcedure> | <bBlock>]
[ ON HELP <OnHelpProcedure> | <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 <cFontName> ]
[ SIZE <nFontSize> ]
[ BOLD ]
[ ITALIC]
[ MODAL ]
[ ON FOLDERPROC <OnFolderProcedure> | <bBlock> [ APPLYBTN> ] ]
[ ON INIT <OnInitProcedure> | <bBlock>]
[ ON CANCEL <OnCancelProcedure> | <bBlock>]
[ ON HELP <OnHelpProcedure> | <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.
FolderName
|
Specifies the name of the Folder control
|
Res
|
The ID identifier this Control in Dialog Window
|
cCaption
|
Specifies the caption of the Folder control
|
ParentWindowName
|
A reference to the Parent Window.
|
cFontName
|
Specifies the Font Name
|
nFontSize
|
Specifies the Font Size
|
OnFolderProcedure
|
Action to be performed when ?
|
OnInitProcedure
|
Action to be performed when Initializing control
|
OnCancelProcedure
|
Action to be performed when ?
|
OnHelpProcedure
|
Action to be performed when ?
|
cImageName
|
Specifies the Image name for the Folder Page
|
cTitle
|
Specifies a Title for the Folder Page control
|
id
|
Specifies the id of the resource
|
|
|
MODAL
|
?
|
MULTILINE
|
Specifies to have multiple lines of Folders
|
BUTTONS
|
Specifies to make the Folders look like Buttons
|
FLAT
|
Specifies to use a FLAT style
|
HOTTRACK
|
?
|
VERTICAL
|
Specifies to put the Folder in Vertical mode (Setting Bottom in
vertical Mode puts the Folder on the right side)
|
BOTTOM
|
Specifies to put the Folder at the bottom the the Folder Page
|
EXAMPLE: