showModal

showModal(): Integer;

The showModal method of the Form class makes the form visible in its current state; that is, minimized, maximized, or normal. (Use the windowState property to control the state of the form.) The first showModal statement for a created form executes its load event if it has not already been executed.

Setting the visible property to false within the load event is ignored when the showModal method is performed. When a modal form is displayed, no logic after the showModal method is executed until the form is unloaded or made invisible. See also "Windows Events and JADE Events", later in this document.

The showModal method is not supported for a form defined as a Web page. If the showModal method is invoked for a Web page form, an error is raised at run time or the behavior of the show method is adopted, depending on the setting of the Treat showModal as show check box in the Web Options sheet of the Define Application dialog of your JADE application. (For details about interfacing to the Internet, see "Implementing Web Applications", in the JADE Web Application Guide.)

When displaying a modal form, no user input (from the keyboard or mouse) can occur in any other form until the modal form is unloaded. The logic must unload a modal form (usually in response to some user action) before further user input can occur. MDI forms cannot be shown modally. Although other forms in your application are disabled when a modal form is displayed, other applications are not.

The modal form is not deleted until the method that creates it is terminated (even when an unload is performed). User logic can therefore access any portion of the form and its controls, except that no events for that form occur.

The showModal method returns the value of the modalResult form variable, which can be set in the called modal form to indicate an action to be taken upon return from the form. The form must have been created before it can be shown. The create method constructs the windows and menus for the forms and its controls, as defined in the JADE development environment.

Unlike the show method, the logic does not return to the statement following the showModal method until after the form is unloaded or made invisible. Other forms cannot receive user input (from the keyboard or mouse) while that form is active.

The showModal method cannot be invoked from a server method.

The methods in the following examples show the use of the showModal method.

listProducts_dblClick(listBox: ListBox);
vars
    form : ProductDisplay;
begin
    if listProducts.itemText[listProducts.listIndex] <> "" then
        create form;
        form.fault := app.myCompany.allProducts.getAtKey(getProductNumber);
        form.centreWindow;
        form.showModal;
    endif;
end;

callCDEntry(doDisplay: Boolean) updating;
vars
    cdentry : CDEntry;
    str     : String;
begin
    str := cd.sendString("info identity");
    create cdentry;
    cdentry.doDisplay    := doDisplay;      // display if present
    cdentry.cdIdentity   := str.Integer;
    cdentry.numberTracks := numberOfTracks;
    cdentry.showModal;
    // update cdplayer data
    userObject := cdentry.userObject;
    displayCDInfo;
end;