SUBMENU Statement
Syntax:
SUBMENU text, submenu-id [, menuitem-style]
BEGIN
menuitem-definition
.
.
.
END
The SUBMENU statement creates a submenu for a given menu. A submenu is
a vertical list of menu items from which the user can choose a command.
You can provide any number of SUBMENU statements in a MENU statement, but
each SUBMENU statement must specify a unique submenu-id value. You can provide
any number of menuitem-definition statements in the SUBMENU statement. These
define the menu items (commands) in the menu. The order of the statements
determines the order of the menu items.
text
Specifies the text of the submenu. This field
must contain zero or more characters enclosed in double quotation marks.
Character values must be in the range 1 through 255. If a double quotation
mark is required in the string, you must include the double quotation mark
twice. A tilde ( ~ ) character in the item name indicates that the following
character is used as a mnemonic character for the item. When the menu is
displayed, the tilde is not shown, but the mnemonic character is underlined.
The user can choose the menu item by pressing the key corresponding to
the underlined mnemonic character.
submenu-id
Specifies the submenu identifier.
This value must be a signed integer in the range -32768 through 32767, an
unsigned integer in the range of 1 through 65535, or a simple expression
that evaluates to a value in these ranges.
menuitem-style
Specifies the submenu style.
This value can be a combination of MIS_ values. For details on the MIS_
values, see MENUITEM Statement.
menuitem-definition
Specifies a PRESPARAMS
or MENUITEM statement. You can use the PRESPARAMS statement to control
the appearance of a submenu, such as the font and the foreground and background
colors. If used, the PRESPARAMS statement must immediately follow the BEGIN
keyword. For details about the PRESPARAMS statement, see PRESPARAMS
Statement.
The MENUITEM statement defines an individual command in the given menu.
For details, see MENUITEM Statement.
Example
This example creates a submenu named Elements. Its identifier is 2. The
submenu contains three menu items, which are created by using MENUITEM statements.
SUBMENU "Elements", 2BEGIN
MENUITEM "Oxygen", 200
MENUITEM "Carbon", 201, , MIA_CHECKED
MENUITEM "Hydrogen", 202
END
[Back: SUBITEMSIZE Statement]
[Next: undef Directive]