SIMPOL Documentation

wxdialog

Description

A wxdialog object is a dialog window on the screen, which the programmer has control over and is used for interacting with the user. Windows of type wxdialog have the appearance of dialog windows in the native system, and can be shown modally, that is in a way which forces the user to respond to them before continuing.

Type Tags

wxcontainer, wxdialogparent

Object Value

wxdialog.new()

Description

Creates a new wxdialog object with the required properties.

Prototype

wxdialog.new ( integer left, integer top, integer outerwidth, integer outerheight, integer innerwidth, integer innerheight, boolean visible, type(wxdialogparent) parent, boolean captionbar, string captiontext, boolean menubutton, boolean visbutton, wxbitmap icon, integer backgroundrgb, string stdbuttons, integer error )

Parameters

ParameterDefault valueType nameDescription
leftNoneinteger The position of the left side of the dialog window on the screen.
topNoneinteger The position of the top edge of the dialog window on the screen.
outerwidthNoneinteger The width of the entire dialog window, including borders, titles, and other parts which are not used by window content. Either outerwidth or innerwidth must be specified, but it is an error to specify both.
outerheightNoneinteger The height of the entire dialog window, including borders, titles, and other parts which are not used by window content. Either outerheight or innerheight must be specified, but it is an error to specify both.
innerwidthNoneinteger The width of the useable, inner part of the window, not including borders, titles, etc., or wxdialogstdbutton buttons, if any. Either outerwidth or innerwidth must be specified, but it is an error to specify both.
innerheightNoneinteger The height of the useable, inner part of the window, not including borders, titles, etc., or wxdialogstdbutton buttons, if any. Either outerheight or innerheight must be specified, but it is an error to specify both.
visible.trueboolean Determines whether or not the dialog window will be visible on the screen.
parent.nultype(wxdialogparent) Gives the parent of the new dialog window, if any.
captionbar.trueboolean Determines whether or not the dialog window is to have a caption bar, which is used to display text and to allow the user to move the window by dragging it using the mouse. If a window does not have a caption bar, then it cannot have a menu button or vis button, so these must not be specified as arguments with the value of .true (but they can be passed as .false or omitted).
captiontext""string The text which is to appear in any caption bar the dialog window has.
menubutton.trueboolean Determines whether or not the dialog window is to have a menu button, which allows the user to access a menu giving the ability to manage the window, for example to move or 'close' it. A window must have a caption bar if it to have a menu button, so the captionbar argument must not be passed as .false (though it can be passed as .true or omitted).
visbutton.trueboolean Determines whether or not the dialog window is to have a visibilty button, allowing the user to make the window invisible, which is often considered to be 'closing' it. A window must have a caption bar if it to have a vis button, so the captionbar argument must not be passed as .false (though it can be passed as .true or omitted).
iconNonewxbitmap The wxbitmap to use as the icon for the new dialog window. It is recommended to use an appropriately sized image for this purpose (16 x 16 pixels).
backgroundrgb The system dependent default dialog window background color integer The background color of the new dialog window. It is inadvisable to specify any value for this argument which is not the value of an existing rgb object.
stdbuttons""string Specifies which wxdialogstdbutton buttons, if any, are to be created in the dialog. The buttons will be created to appear in a manner which is appropriate for the platform, and the part of the dialog which displays these buttons will be excluded from the area used for showing dialog content. The string is typically a comma separated list of button names, such as "ok,cancel". The valid button names are "ok", "cancel", "yes", "no" and "help". The name of each button can be used together with the member operator (!) to access the button via the wxdialog object.
error.nulinteger Specifies an object which is used to output any error code generated during creation of the wxdialog object. If error is not specified or is .nul then any error which occurs during object creation will halt the program. If an error object is specified and an error occurs during object creation then the error code is output into that object and the new methods returns .nul.

Properties

PropertyTypeDescription
_type(*) This property is provided for use by the user to attach any object of any type to the type in which this property is provided.
__type(*) This property is provided for use by the user to attach any object of any type to the type in which this property is provided. It has the additional feature of being marked with the resolve keyword, so that object resolution can continue down this property.
backgroundrgbrgb Shows the color of the inner part of the dialog window when no content is visible.
captionbarboolean Indicates whether or not the dialog window has a caption bar. The caption bar is used to display a title for the window, and is also used to move the window by dragging with the mouse.
captiontextstring Contains the text which is displayed in the dialog window's caption bar. A dialog window which doesn't have a caption bar can still have caption text.
contenttype(wxcontent) The current content of the dialog window.
firststdbuttonwxdialogstdbutton The first button of type wxdialogstdbutton which was created for this dialog window
iconwxbitmap The wxbitmap object that is used as the source of the icon for the dialog.
innerheightinteger Gives the height of the useable, inner part of the dialog window, not including borders, titles, etc., and also excluding the area containing any wxdialogstdbutton buttons.
innerwidthinteger Gives the width of the useable, inner part of the dialog window, not including borders, titles, etc., and also excluding the area containing any wxdialogstdbutton buttons.
leftinteger Gives the x-position of the left hand side of the dialog window on the screen.
menubuttonboolean Indicates whether or not the dialog window has a button in the caption bar which provides the user with access to a menu that allows the window to be managed, for example to be moved or 'closed'. Not all combinations of .true and .false settings for menubutton and visbutton are possible on all platforms.
modalboolean Indicates whether or not the dialog window is currently being shown modally.
onmoveevent An event which is triggered when the position of the dialog window is changed by the user.
onvisibilitychangeevent An event which is triggered when the user changes the visibility of the dialog window, for example by 'closing' the dialog by clicking the visibility button in the caption bar.
outerheightinteger Gives the height of the entire dialog window, including borders, titles, and other parts which are not used by window content or child windows.
outerwidthinteger Gives the width of the entire dialog window, including borders, titles, and other parts which are not used by window content or child windows.
parenttype(wxdialogparent) The parent of this dialog window. If a dialog window has a parent then it is always shown on top of the parent, though it is not contained within the parent.
topinteger Gives the y-position of the top edge of the dialog window on the screen.
typetype Specifies the wxdialog type object.
visbuttonboolean Indicates whether or not the dialog window has a button in the caption bar with which the user can make the window invisible. This is normally thought of as 'closing' the window. Not all combinations of .true and .false settings for menubutton and visbutton are possible on all platforms.
visibleboolean Indicates whether or not the dialog window is currently visible on the screen.

Methods

processmodal()

Description

Makes the dialog window visible on the screen, and processes user input to it modally, i.e. without allowing input to other dialogs or windows in the application. It is an error to call this method when the dialog is already visible, either modally or modelessly. The wxdialog object itself is returned.

Prototype

wxdialogvar.processmodal ( integer timeout )

Parameters
ParameterDefault valueType nameDescription
timeout0integer Specifies an amount of time (in microseconds) for which the method will continue to show the dialog and process user interaction, unless the dialog window is made not visible by calling the setvisible() method with a parameter value of .false. If a value of .inf is specified, then user interaction will be processed indefinitely, or until the dialog is made not visible using the setvisible() method.

setbackgroundrgb()

Description

Sets the background color of the dialog window. The wxdialog object itself is returned, to allow multiple setting methods to be put into one expression. It is an error to specify both the rgb argument and one or more of the red, green or blue arguments.

Prototype

wxdialogvar.setbackgroundrgb ( integer rgb, integer red, integer green, integer blue )

Parameters
ParameterDefault valueType nameDescription
rgbThe current value of the backgroundrgb propertyinteger The new background color of the dialog. It is inadvisable to specify any value for this argument which is not the value of an existing rgb object.
redThe current value of the backgroundrgb.red propertyinteger The red component in the new background color of the window. This must be between 0 and 255 inclusive.
greenThe current value of the backgroundrgb.green propertyinteger The green component in the new background color of the window. This must be between 0 and 255 inclusive.
blueThe current value of the backgroundrgb.blue propertyinteger The blue component in the new background color of the window. This must be between 0 and 255 inclusive.

setcaptiontext()

Description

Sets the text in the caption bar, if any, of the dialog window. The wxdialog object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxdialogvar.setcaptiontext ( string captiontext )

Parameters
ParameterDefault valueType nameDescription
captiontextNonestring The text which is to appear in any caption bar the dialog has.

seticon()

Description

Sets the icon for the dialog. This must be a dialog that has a caption bar, otherwise an error is returned in the error parameter. The wxdialog object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxdialogvar.seticon ( wxbitmap icon, integer error )

Parameters
ParameterDefault valueType nameDescription
iconNonewxbitmap The wxbitmap that should be used as the dialog icon. This should be a bitmap that is 16x16 pixels normally.
error.nulinteger Specifies an object that is used to output any error code generated during execution of the function. If error is not specified or is .nul then any error which occurs during object creation will halt the program. If an error object is specified and an error occurs during execution then the error code is output into that object.

setposition()

Description

Sets the size and/or position of a dialog window. The wxdialog object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxdialogvar.setposition ( integer left, integer top, integer outerwidth, integer outerheight, integer innerwidth, integer innerheight )

Parameters
ParameterDefault valueType nameDescription
leftThe current value of the left propertyinteger The new position of the left side of the dialog window on the screen
topThe current value of the top propertyinteger The new position of the top edge of the dialog window on the screen
outerwidthThe current value of the outerwidth propertyinteger The new width of the entire dialog window, including borders, titles, and other parts which are not used by dialog content or wxdialogstdbutton buttons. It is an error to specify both outerwidth and innerwidth arguments.
outerheightThe current value of the outerheight propertyinteger The new height of the entire dialog window, including borders, titles, and other parts which are not used by dialog content or wxdialogstdbutton buttons. It is an error to specify both outerheight and innerheight arguments.
innerwidthThe current value of the innerwidth propertyinteger The new width of the useable, inner part of the dialog, not including borders, titles, etc., and also excluding the area containing any wxdialogstdbutton buttons. It is an error to specify both outerwidth and innerwidth arguments.
innerheightThe current value of the innerheight propertyinteger The new height of the useable, inner part of the dialog, not including borders, titles, etc., and also excluding the area containing any wxdialogstdbutton buttons. It is an error to specify both outerheight and innerheight arguments.

setvisible()

Description

Sets whether or not the dialog window is visible on the screen. The wxdialog object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxdialogvar.setvisible ( boolean visible )

Parameters
ParameterDefault valueType nameDescription
visibleNoneboolean Determines whether or not the window will be visible on the screen.

wxdialog!

Get

The member operator (!) is used to access the objects of type wxdialogstdbutton that may have been specified during the creation of the dialog window. These can be any of yes, no, ok, cancel, or help. The member operator followed by the button name returns a reference to the button. Attempting to access a button that has not been defined is an error. As an example, if the standard buttons parameter contains the string "ok", then the code might look like: wxdialogvar!ok.

Set

Attempting to assign a reference or a value to a wxdialog object using the ! operator is not supported.