back to gui
wxDialog
generated from ../src/mod_gui/control/dialog.cpp
A dialog box is a window with a title bar and sometimes a system menu,
which can be moved around the screen. It can contain controls and other windows.
The following sample shows a simple dialog:
// Initialize the application
wxTheApp.onInit = function()
{
dlg = new wxDialog(null, -1, "test");
dlg.button = new wxButton(dlg, 1, "Ok");
dlg.button.onClicked = function()
{
endModal(1);
}
dlg.showModal();
// Return false, will end the main loop
return false;
}
Constants
Style
| Name |
Description |
| DIALOG_MODAL |
|
| CAPTION |
|
| DEFAULT_DIALOG_STYLE |
|
| RESIZE_BORDER |
|
| SYSTEM_MENU |
|
| THICK_FRAME |
|
| STAY_ON_TOP |
|
| NO_3D |
|
| DIALOG_EX_CONTEXTHELP |
|
Constructor
wxDialog
wxDialog()
wxDialog(Parent,
Id,
title,
Position = wxDefaultPosition,
Size = wxDefaultSize,
Style = wxDialog.DEFAULT_DIALOG_STYLE)
| Name |
Type |
Default |
Description |
| Parent |
wxWindow |
|
The parent of the dialog. null is Allowed.
|
| Id |
Integer |
|
The window identifier
|
| title |
String |
|
The title of the dialog
|
| Position |
wxPoint |
wxDefaultPosition |
The position of the dialog.
|
| Size |
wxSize |
wxDefaultSize |
The size of the dialog
|
| Style |
Integer |
wxDialog.DEFAULT_DIALOG_STYLE |
The window style
|
Creates a dialog
Properties
| Name |
Type |
Description |
modal  |
Boolean |
Returns true when the dialog is a modal dialog
|
returnCode  |
Integer |
The returncode of the modal dialog
|
Methods
create
create(Parent,
Id,
title,
Position = wxDefaultPosition,
Size = wxDefaultSize,
Style = wxDialog.DEFAULT_DIALOG_STYLE) : Boolean
| Name |
Type |
Default |
Description |
| Parent |
wxWindow |
|
The parent of the dialog. null is Allowed.
|
| Id |
Integer |
|
The window identifier
|
| title |
String |
|
The title of the dialog
|
| Position |
wxPoint |
wxDefaultPosition |
The position of the dialog.
|
| Size |
wxSize |
wxDefaultSize |
The size of the dialog
|
| Style |
Integer |
wxDialog.DEFAULT_DIALOG_STYLE |
The window style
|
Creates a dialog.
endModal
endModal(ReturnCode)
| Name |
Type |
Default |
Description |
| ReturnCode |
Integer |
|
The value to be returned from showModal
|
Ends a modal dialog.
showModal
showModal() : Integer
Shows a modal dialog.
The value returned is the return code set by endModal.
Events
| onClose |
Called when the dialog is closed. The type of the argument that your
handler receives is wxCloseEvent.
|
| onInitDialog |
This event is sent as a dialog or panel is being initialised.
Handlers for this event can transfer data to the window.
The function gets a wxInitDialogEvent as argument
|