Edit

ModalWindow (your_wind_id [, property_array])

Result Type:  string

Definition:  Instantiates a modal window using the UI form with identifier your_wind_id (i.e. the name you gave the form in the script editor). Your window definition should include a default (OK) button and usually a Cancel button. The user clicking either of these will cause the window to close. If neither of these buttons is present, the window will have a close box which will have a similiar effect to Cancel.

In v9 and later, you can provide an optional properties associative array which will be used to initialise the properties of the window (that you would otherwise set and get with SetWindowProperty and GetWindowProperty. This removes the need to use global properties to pass parameters to window handlers.

The return value of ModalWindow will be the identifier of the last control hit (generally this will be the id of the cancel button or the OK button).

The window will receive the usual window-related messages. e.g: You can write a Before handler named Before:your_wind_id(windowRef) in which you can set up the state of the window's controls.

Windows automatically remember their last size and location (this information is written into a file named script_id.properties. You can set the values of the properties your_wind_id_left, your_wind_id_top, your_wind_id_right, and your_wind_id_bottom before instantiating the window to override the size and location.

Availability:  available within MWScript handlers.

See Also:

CreateWindow: Instantiate a modeless custom window

ModalJobsheetEntryWindow: Run a modal Jobsheet entry modify/create window

ModalListWindow: Instantiate a modal custom database table list window

ModalTransactionWindow: Run a modal transaction modify/create window