The Dialog class / ui.Dialog methods |
Enabling and disabling dialog actions.
setActionActive( name STRING, active BOOLEAN )
ON ACTION hide CALL DIALOG.setActionActive("zoom", FALSE)
In GUI applications, push-buttons triggering actions should normally be disabled if the current context / situation makes the corresponding action invalid or unusable. For example, a "print" button should be disabled if there is nothing to print. The setActionActive() method is typically used to enable/ disable actions according to the context.
The second parameter of the method must be a boolean expression that evaluates to 0 (FALSE) or 1 (TRUE).
To simplify action activation, write a common "setup" function which centralizes all rules to enable/ disable actions. This function can then be called from any place in the DIALOG instruction, passing the DIALOG object as parameter. See Example 3.
When the action activation depends from a field context, use the INFIELD clause of ON ACTION to automatically disable an action if the focus leaves the specified field.
For more details about action names, see Identifying actions in dialog methods.