Disable all menus and toolbars

Command group Flag affected Reversible Execute on client Platform(s)
Menus NO YES NO All

Syntax

Disable all menus and toolbars

Description

The Disable all menus and toolbars command disables all top-level menus and toolbars in the main Omnis menu bar or application docking areas (i.e. not toolbars or menus installed in window classes). For toolbars, the command sets the active state of the docking areas and disables everything without changing its appearance. The menus and toolbars can be enabled using the Enable all menus and toolbars command.

Note $itoolbars represents the group of open top-level toolbar instances, and the members of the group are toolbars. Setting $enabled for an individual toolbar not only affects if controls can be used, but also affects the appearance of controls, hence they gray in this case.

You can disable all user installed menu and toolbar instances by setting the $enabled property, as follows:

Do  $imenus.$sendall($ref.$enabled.$assign(kFalse))
Do $itoolbars.$sendall($ref.$enabled.$assign(kFalse))

Example

# Disable all menus and toolbars unless
# the correct password is entered
Disable all menus and toolbars
Prompt for input Password : Returns lPassword
If low(lPassword)='password'
  Enable all menus and toolbars
End If