wxDialogBox: wxPanel

A dialog box is similar to a panel, with the following exceptions:

  1. A surrounding frame is implicitly created.
  2. Extra functionality is automatically given to the dialog box, such as tabbing between items (currently Windows only).
  3. If the dialog box is modal, the calling program is blocked until the dialog box is dismissed.

Under XView, some panel items may display incorrectly in a modal dialog. An XView bug-fix for list boxes is supplied with wxWindows, but some items remain a problem.

Note that under Windows 3, modal dialogs have to be emulated using modeless dialogs and a message loop. This is because Windows 3 expects the contents of a modal dialog to be loaded from a resource file or created on receipt of a dialog initialization message. This is too restrictive for wxWindows, where any window may be created and displayed before its contents are created.

It would be easy to add a facility for loading Windows 3 dialog resources instead of building them programmatically, but of course this method is very non-portable. See the discussion in section [*].

For a set of dialog convenience functions, including file selection, see Section [*].

wxDialogBox::wxDialogBox

voidwxDialogBoxwxFrame *parent, char *title, Bool modal=FALSE,
int x=300, int y=300, int width=500, int height=500

Constructor. If modal is TRUE, the dialog box will wait to be dismissed (using Show(FALSE)) before returning control to the calling program.

wxDialogBox::wxDialogBox

voidwxDialogBox

Destructor. Deletes any panel items before deleting the physical window.

wxDialogBox::Iconize

voidIconizeBool iconize

If TRUE, iconizes the dialog box; if FALSE, shows and restores it. Note that in Windows, iconization has no effect since dialog boxes cannot be iconized. However, applications may need to explicitly restore dialog boxes under XView and Motif which have user-iconizable frames, and under Windows calling Iconize(FALSE) will bring the window to the front, as does Show(TRUE).

wxDialogBox::Iconized

BoolIconized

Returns TRUE if the dialog box is iconized. Always returns FALSE under Windows for the reasons given above.

wxDialogBox::Show

voidShowBool show

If show is TRUE, the dialog box is shown and brought to the front; otherwise the box is hidden. If show is FALSE and the dialog is modal, control is returned to the calling program.