Return Values
Value | Meaning |
---|---|
0 | Menu item is selectable |
1 | Menu item is currently not selectable |
If an error occurs, $procerror contains the exact error.
Use
Use only in the preDisplay trigger of Menu objects.
Description
The function $disable is used to disable (or enable) a menu item
- Set the value to 1 to disable the menu item so it cannot be selected; the menu accelerator key is also disabled. the disabled menu item is dimmed when the menu is displayed.
- Set the value to 0 to enable the menu item.
You can also use $disable as the target in the left side of an assignment. For example:
$disable=!$disable
Since $disable is essentially a Boolean function, when Expression evaluates to a non-zero value, $disable becomes 1.
Using $disable
The following example disables a menu item:
trigger preDisplay set $disable end; preDisplay