A dialog box is essentially a wxPanel with its own wxFrame, and therefore shares some functions and behaviour with both of these objects.
Any panel item can be created as a child of a dialog box, and also the dialog box can be created modal, so that the flow of program control halts until the dialog box is dismissed.
The following event handlers are valid for the panel class:
wxDialogBox modal
wxDialogBox create
wxDialogBox on-char-hook
wxDialogBox on-close
wxDialogBox on-paint
wxDialogBox on-size
bool modal
Initialize to TRUE if the dialog box is to be modal, FALSE otherwise. The default is FALSE.
void ( create)
The following slots may be initialized if not loading from a resource.
The following slots should be initialized if loading from a resource (see Resource overview for further details).
The value of style can be a bit list of the following values:
wxCAPTION | Puts a caption on the dialog box (under XView and Motif this is mandatory). |
wxSTAY_ON_TOP | Stay on top of other windows (Windows only). |
wxSYSTEM_MENU | Display a system menu (manadatory under XView and Motif). |
wxTHICK_FRAME | Display a thick frame around the window (manadatory under XView and Motif). |
wxVSCROLL | Give the dialog box a vertical scrollbar (XView only). |
wxDEFAULT_DIALOG_STYLE | Equivalent to a combination of wxCAPTION, wxSYSTEM_MENU and wxTHICK_FRAME |
The default value for style is wxDEFAULT_DIALOG_STYLE.
If modal is TRUE, when the show message is sent to the dialog box object, the flow of control will stop until the show message has been called again with a FALSE parameter. Otherwise, if modal is FALSE, flow of control will immediately return to the program when the dialog box has been shown.
bool ( on-char-hook wxKeyEvent event)
Under Windows only, all key strokes going to a dialog box or frame can be intercepted before being passed on for normal processing. This handler takes the event object, and should return TRUE to override further processing, or FALSE to do default processing. See also wxKeyEvent.
bool ( on-close)
The function is called when the user dismisses the dialog box. If the handler returns TRUE, the window is automatically deleted (possibly terminating the application). A return value of FALSE forbids automatic deletion.
void ( on-paint)
Override this handler to respond to paint events (sent when the dialog box needs repainting). Normally, a dialog box's items repaint themselves, but for special purposes, you may wish to draw on the dialog box device context.
void ( on-size long width longheight)
The function is called with the dialog box width and height when the user resizes the frame.