MENUITEM

MENUITEM text, result, [optionlist]

The MENUITEM statement, which is optional, defines a menu item.

Parameters

text

Specifies the name of the menu item. This parameter takes an ASCII string, enclosed in double quotation marks.

The string can contain the escape characters \t and \a. The \t character inserts a tab in the string and is used to align text in columns. Tab characters should be used only in pop-up menus, not in menu bars. (For information on pop-up menus, see the POPUP statement.) The \a character aligns all text that follows it flush right to the menu bar or pop-up menu.

To insert a double quotation mark in the string, use two double quotation marks.

To add a mnemonic to the text string, place the ampersand (&) ahead of the letter that will be the mnemonic. This will cause the letter to appear underlined in the control and to function as the mnemonic. To use the ampersand as a character in a string, insert two ampersands (&&).

result

Specifies the result generated when the user selects the menu item. This parameter takes an integer value. Menu-item results are always integers; when the user clicks the menu-item name, the result is sent to the window that owns the menu.

optionlist

Specifies the appearance of the menu item. This optional parameter takes one or more predefined menu options, separated by commas or spaces. The menu options are as follows:

Option Description

CHECKED Item has a check mark next to it.
GRAYED Item name is initially inactive and appears on the menu in gray or a lightened shade of the menu-text color.
HELP Identifies a help item.
INACTIVE Item name is displayed but it cannot be selected.
MENUBARBREAK Same as MF_MENUBREAK except that for pop-up menus, it separates the new column from the old column with a vertical line.
MENUBREAK Places the menu item on a new line for static menu-bar items. For pop-up menus, it places the menu item in a new column with no dividing line between the columns.

The INACTIVE and GRAYED options cannot be used together.

Examples

The following example demonstrates the usage of the MENUITEM statement:

MENUITEM  "&Alpha", 1, CHECKED, GRAYED
MENUITEM  "&Beta", 2