rc.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
SUBMENU (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
 
                  The Resource Compiler SUBMENU Statement
 
SUBMENU text, submenu-id [, menu-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 menu-item definitions 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.
 
Field                Description
────────────────────────────────────────────────────────────────────────────
 
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 an
                     integer in the range 0 through 65,535, or a simple
                     expression that evaluates to a value in that range.
 
menu-style           Specifies the submenu style. This value can be a
                     combination of MIS_ values. For details on the MIS_
                     values, see the MENUITEM topic.
 
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 the PRESPARAMS
                     topic. The MENUITEM statement defines an individual
                     command in the given menu. For details, see the
                     MENUITEM topic.
 
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", 2
BEGIN
    MENUITEM "Oxygen", 200
    MENUITEM "Carbon", 201, , MIA_CHECKED
    MENUITEM "Hydrogen", 202
END
 
See Also
 
MENU, MENUITEM, PRESPARAMS
 
                                      ♦