Modality

Determines whether the form instance can lose focus without being closed. Valid values are Modal or Non-Modal (instance can lose and get focus)

newinstance"A_FORM", "MyInstance","modality=Non-Modal | Modal"

Value Description
Non-Modal The component instance can get and lose as a result of user action or the setformfocus ProcScript statement.
Modal Component instance retains focus until closed.

Description

The Modality property can be set in the Properties Inspector for all component instances, or in ProcScript when creating a new instance. For example, the following statement starts a non-modal form to be used for inquiry:

newinstance "MYFORM", "QUERY", "MODALITY=NON-MODAL;QUERY=TRUE"

For non-modal forms, ProcScript in the loseFocus and getFocus triggers determines if focus is allowed to shift from one form to another.

Note:  When a non-modal form is tested from within the Uniface IDE, it is started as a modal form, overriding the Modality property that you have defined for the form. To test the form as a non-modal form, use the command line switch /tst; alternatively, you can create a small application that you can use for testing non-modal forms.

When a modal form instance is created with newinstance, it is attached to the instance that created it. This means that if a modal form instance is created by one non-modal form, even if another non-modal form activates its exec operation, the modal form instance is attached to the first non-modal form; that form will become active when the modal form stops.

Applies To