Property Sheet Commands
|
Modal Property Sheet
DEFINE PROPSHEET <PropertySheetName>
[ OF| PARENT> < ParentWindowName > ]
AT <nRow>,<nCol>
[ WIDTH < nWidth > ]
[ HEIGHT <nHeight> ]
MODAL
[ CAPTION <cCaption> ]
[ ICON <cIcon/IdIcon>]
[ FONT <FontName> ]
[ SIZE <FontSize> ]
[ BOLD ]
[ ITALIC]
[ UNDERLINE ]
[ STRIKEOUT ]
[ DIALOGPROC <DialogProcedureName> | <bBlock>]
[ ON INIT <InitProcedureName> | <bBlock>]
[ ON APPLY <ApplyProcedureName> | <bBlock>]
[ ON CANCEL <CancelProcedureName> | <bBlock>]
[ ON VALID <ValidProcedureName> | <bBlock>]
Wizard Property Sheet
DEFINE PROPSHEET <
PropertySheetName >
[ OF| PARENT> < ParentWindowName > ]
AT <nRow>,<nCol>
[ WIDTH < nWidth > ]
[ HEIGHT <nHeight> ]
WIZARD
[ LITE ]
[ CAPTION <caption> ] //ignored in wizard
[ ICON <cIcon/IdIcon>];
[ WATERMARK <watermark> ]
[ HEADERBMP <headerbmp> ]
[ FONT <FontName> ]
[ SIZE <FontSize> ]
[ BOLD ]
[ ITALIC]
[ UNDERLINE ]
[ STRIKEOUT ]
[ DIALOGPROC <DialogProcedureName> | <bBlock>]
[ ON INIT <InitProcedureName> | <bBlock>]
[ ON APPLY <ApplyProcedureName> | <bBlock>]
[ ON CANCEL <CancelProcedureName> | <bBlock>]
[ ON VALID <ValidProcedureName> | <bBlock>]
Modeless Property Sheet
DEFINE PROPSHEET <
PropertySheetName >
[ OF| PARENT> < ParentWindowName > ]
AT <nRow>,<nCol>
[ WIDTH < nWidth > ]
[ HEIGHT <nHeight> ]
[ CAPTION <cCaption> ]
[ ICON <cIcon/IdIcon>];
[ FONT <FontName> ]
[ SIZE <FontSize> ]
[ BOLD ]
[ ITALIC]
[ UNDERLINE ]
[ STRIKEOUT ]
[ DIALOGPROC <DialogProcedureName> | <bBlock>]
[ ON INIT <InitProcedureName> | <bBlock>]
[ ON APPLY <ApplyProcedureName> | <bBlock>]
[ ON CANCEL <CancelProcedureName> | <bBlock>]
[ ON VALID <ValidProcedureName> | <bBlock>]
Modeless Property Sheet with HMG Events procedures
DEFINE PROPSHEET <
PropertySheetName >
[ OF| PARENT> < ParentWindowName > ]
AT <nRow>,<nCol>
[ WIDTH < nWidth > ]
[ HEIGHT <nHeight> ]
[ CAPTION <cCaption> ]
[ ICON <cIcon/IdIcon>];
[ FONT <FontName> ]
[ SIZE <FontSize> ]
[ BOLD ]
[ ITALIC]
[ UNDERLINE ]
[ STRIKEOUT ]
[ ON INIT <InitProcedureName> | <bBlock>]
[ ON APPLY <ApplyProcedureName> | <bBlock>]
[ ON CANCEL <CancelProcedureName> | <bBlock>]
[ ON VALID <ValidProcedureName> | <bBlock>]
Sheet Page (Dialog box) from resources
SHEETPAGE <SheetName> RESOURCE <id>
[ TITLE <cTitle> ]
[ HEADER <cHeader> ]
[ SUBHEADER <cSubHeader> ]
[ HIDEHEADER ]
Sheet Page (Dialog box) without using resources
DEFINE SHEETPAGE <
SheetName > [ RESOURCE <id> ]
[ TITLE <cTitle> ]
[ HEADER <cHeader> ]
[ SUBHEADER < cSubHeader > ]
[ HIDEHEADER ]
... Control Definitions...
END SHEETPAGE ;
END PROPSHEET ;
NOTE:
It is possible to call out in double method DIALOGPRC :
· Any DialogFunction, - then it can be used in function predefined variables:
DLG_HWND - Dialog Handle
DLG_MSG - Dialog Message
DLG_ID - Dialog Id
DLG_NOT - Dialog Notification
Example:
Function DialogFun(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
DIALOG PROPERTIES:
DIALOG METHODS:
FUNCTIONS:
The dialog box functions is responsible for initializing the controls to these settings when creating the dialog box. It is also responsible for retrieving the current settings from the controls before destroying the dialog box.
Procedure must call DestroyWindow to close a modeless dialog box.
· GetDlgCtrlID (<hWndControl> ) --> nIdControl
function returns the identifier for the control identified by the window handle
· GetDialogItemHandle ( <hWndDialog>,<nIdControl>)
--> CtrlHandle
function retrieves a handle to a control in the specified dialog box
· GetNextDlgGroupItem API function retrieves a handle to the first control in a group of controls that precedes (or follows) the specified control in a dialog box.
· GetNextDlgTabItem API function retrieves a handle to the first control that has the WS_TABSTOP style that precedes (or follows) the specified control.
· IsDialogMessage API function determines whether a message is intended for the specified dialog box and, if it is, processes the message.
· MapDialogRect function converts the specified dialog box units to screen units (pixels). The function replaces the coordinates in the specified RECT structure with the converted coordinates, which allows the structure to be used to create a dialog box or position a control within a dialog box.
· SendDlgItemMessage API function sends a message to the specified control in a dialog box.
The methods used to initialize and retrieve settings depend on the type of control.
Radio Buttons and Check Boxes
· CheckDlgButton (<hWndDialog>,<nIdControl>,
<.T./.F.> )
function, which sets or clears the check box
· CheckRadioButton (<hWndControl>,<nIdFirstRadio>,
<nIdLastRadio>,
<nIdSelectRadio>)
function to set the appropriate radio button and automatically clear any other radio
button.
· IsDlgButtonChecked
(<hWndDialog>,<nIdControl>
) --> boolState
function to check the state of each radio button and check box
Dialog Box Edit Controls
List Boxes, Combo Boxes, and Directory Listings
Dialog Box Control Messages