Contents Up Previous Next

Dialog box

Overview

A dialog box is essentially a panel with its own frame, 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 callbacks are valid for the dialog box class: see also those listed for panels.

OnCharHook
Under Windows only, all key strokes going to a dialog box or frame can be intercepted before being passed on for normal processing. This callback function takes the window id and event id, and should return 1 to override further processing, or 0 to do default processing. See also Key event.

dialog-box-create
dialog-box-create-from-resource
dialog-box-is-modal
dialog-box-set-modal


dialog-box-create

long ( dialog-box-create long parent-id string title
optional long modal optional long x optional long y
optional long width optional long height optional string style optional string name)

Creates a dialog box. parent-id can be zero or a valid dialog or frame ID; title should be a string for the dialog box's title. The value of modal may be 1 (when window-show is called with an argument of 1, the dialog blocks until window-show is called with an argument of 0) or 0 (dialog is modeless, and window-show returns immediately).

The window-show function must be called with argument 1 to make the dialog visible, and with argument 0 to undisplay the dialog (and to dimiss a modal dialog).

The style parameter may be a combination of the following, using the bitwise 'or' operator:

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).

The default value for style is "wxCAPTION | wxSYSTEM_MENU | wxTHICK_FRAME''.

name gives the dialog box a name that can be retrieved with window-get-name.


dialog-box-create-from-resource

long ( dialog-box-create-from-resource long parent-id string resource-name)

Creates a dialog box from the given wxWindows resource. The resource file containing this resource must first have been loaded with load-resource-file.

Panel items on a panel or dialog box that has been created from a resource, do not have conventional callbacks. Therefore you need to intercept the OnCommand event for the panel or dialog box and test the name and event of the item passed to this callback.


dialog-box-is-modal

long ( dialog-box-is-modal long parent-id)

Returns 1 if the dialog box is modal, 0 otherwise.


dialog-box-set-modal

long ( dialog-box-set-modal long parent-id, long modal)

Sets the dialog box to be modal or non-modal, before window-show is issued. Pass 1 or 0 to modal.