Defining a Submenu
When you assemble a menu, you first define the pull-down submenus and their associated menu items with the DEFINE SUB-MENU statement. This is the basic syntax for the DEFINE SUB-MENU statement.
The LIKE menu option is useful when you want to duplicate an already existing menu. The menu-element-descriptor allows you to customize the submenu. This is the syntax for the menu-element-descriptor phrase.
Table 11–1 explains the relevant components of the syntax.
Table 11–1: MENU Element Options
Component
|
Description
|
SUB-MENU
|
Names a submenu that displays when the user chooses this menu item. The specified submenu must already be defined.
|
DISABLED
|
Disables the menu item initially. When you use this option, the user can’t choose the menu item.
|
LABEL
|
Defines the text descriptor that the user sees on the menu. If you omit LABEL, Progress displays the submenu name by default.
|
RULE
|
Inserts a rule (line) at this point on the menu. Use rules to visually group related commands.
|
SKIP
|
Inserts a blank line at this position on the menu.
|
menu-item-phrase
|
Names a menu-item widget and specifies details about the item. See the following table for more information.
|
The menu-item-phrase lets you customize both how the menu item displays and how the user can access it. This is the syntax for the menu-item-phrase.
Table 11–2 explains the relevant components of the syntax.
Table 11–2: MENU–ITEM Options
Component
|
Description
|
MENU-ITEM
|
Specifies a unique name for the menu item. This name doesn’t have to be previously defined.
|
ACCELERATOR
|
Specifies the keyboard accelerator for this menu item. A keyboard accelerator is a key that chooses a menu item even if the menu item is not displayed. This option is available only in graphical windowing environments.
|
TOGGLE-BOX
|
Displays the menu item with a toggle box that the user can toggle on or off.
|
DISABLED
|
Disables the menu item. This means that the user cannot choose this item.
|
LABEL
|
Specifies the text descriptor that the user sees in the submenu. If you omit LABEL, Progress displays the item name by default.
You can include an ampersand (&) within the label to indicate that the following letter acts as a mnemonic (shortcut key) for the menu item. For example, "E&xit" specifies “x” as the mnemonic.
|
Note that in this code fragment, which is an example of a complete submenu definition, only the final MENU-ITEM phrase has a period:
The next step in building a menu is to define a menu bar and add submenus and items to it.