Dialogs Types Modal System modal Non modal modeless

  • Slides: 14
Download presentation
Dialogs

Dialogs

Types: • Modal • System modal • Non modal (modeless)

Types: • Modal • System modal • Non modal (modeless)

Message. Box Four parameters: 1. Parent window handle 2. Message to show 3. Title

Message. Box Four parameters: 1. Parent window handle 2. Message to show 3. Title 4. Flags

Modality • MB_APPLMODAL (default) • MB_SYSTEMMODAL • MB_TASKMODAL

Modality • MB_APPLMODAL (default) • MB_SYSTEMMODAL • MB_TASKMODAL

Buttons • • MB_ABORTRETRYIGNORE MB_CANCELTRYCONTINUE MB_OKCANCEL MB_RETRYCANCEL MB_YESNOCANCEL MB_HELP

Buttons • • MB_ABORTRETRYIGNORE MB_CANCELTRYCONTINUE MB_OKCANCEL MB_RETRYCANCEL MB_YESNOCANCEL MB_HELP

Icons • • MB_ICONEXCLAMATION MB_ICONWARNING MB_ICONINFORMATION MB_ICONASTERISK MB_ICONQUESTION (not recommended) MB_ICONSTOP MB_ICONERROR MB_ICONHAND

Icons • • MB_ICONEXCLAMATION MB_ICONWARNING MB_ICONINFORMATION MB_ICONASTERISK MB_ICONQUESTION (not recommended) MB_ICONSTOP MB_ICONERROR MB_ICONHAND

Dialog window procedure Differences with window: BOOL instead LRESULT WM_INITDIALOG End. Dialog

Dialog window procedure Differences with window: BOOL instead LRESULT WM_INITDIALOG End. Dialog

Modal dialog window • After dialog window procedure is defined, dialog window can be

Modal dialog window • After dialog window procedure is defined, dialog window can be created with functions Dialog. Box or Dialog. Box. Param. • Dialog window has two handles: dialog window itself and parent window’s. • Dialog. Box. Param creates a modal dialog box from a dialog box template resource. It has 5 th argument, which is sent to dialog procedure as LPARAM parameter of the WM_INITDIALOG MESSAGE.

Indirect dialog window • Functions Dialog. Box. Indirect or Dialog. Box. Indirect. Param creates

Indirect dialog window • Functions Dialog. Box. Indirect or Dialog. Box. Indirect. Param creates a modal box from a dialog box template • DLGTEMPLATE(EX) structure • DLGITEMTEMPLATE(EX) structure let define individual dialog window

DLGTEMPLATE

DLGTEMPLATE

With class • WNDCLASS structure can be used to define dialog: – wnd. cb.

With class • WNDCLASS structure can be used to define dialog: – wnd. cb. Wnd. Wxtra = DLGWINDOWEXTRA; • Register as simple window

Message loop • Is. Dialog. Message is function used to modify message loop for

Message loop • Is. Dialog. Message is function used to modify message loop for modeless (not necessarily) dialog boxes