Purpose |
|||||||||||
Syntax |
MENU ADD STRING, hMenu, txt$, id&, state& [, AT [BYCMD] pos&] [, CALL callback] | ||||||||||
Remarks |
A string may contain an optional command accelerator key, and also describe an equivalent keyboard accelerator combination. | ||||||||||
hMenu |
Double-word or Long-integer variable containing the handle of the parent menu to which the string should be added. | ||||||||||
txt$ |
Text to display in the parent menu. An ampersand (&) may be used in the string to make the following letter into a command accelerator (hot-key). The letter is underscored to signify that it is an accelerator. To create a horizontal separator instead of a text string, set txt$ = "-", id& = 0, state& = 0. Keyboard accelerators, as described in the ACCEL ATTACH statement, can be indicated in the text of a menu item, for the reference of the user. To include a keyboard accelerator description in a menu string, separate it from the menu item text with a $TAB {CHR$(9)} character. For example: MENU ADD STRING, hMenu, "Cu&t" & $TAB & "CTRL+X", id&, mstate& | ||||||||||
id& |
The unique
| ||||||||||
state& |
The initial state of the menu item. It can be one or more of the following, combined together with the OR operator to form a bitmask:
| ||||||||||
pos& |
Optional position in the parent menu, where the menu item should be inserted. If the BYCMD option is used, the menu item is inserted prior to the menu item ID specified by pos&. Otherwise, the menu item is inserted at the physical pos& within the parent menu, where pos& = 1 for the first position, pos& = 2 for the second, and so on. | ||||||||||
callback |
Optional name of a Callback Function that will be called when the menu item is selected. | ||||||||||
Restrictions |
The application must call the MENU DRAW BAR statement whenever a menu changes, whether or not the menu is in a displayed dialog. | ||||||||||
See also |
Dynamic Dialog Tools, ACCEL ATTACH, Menus, MENU ADD POPUP, MENU ATTACH, MENU DELETE, MENU DRAW BAR, MENU GET STATE, MENU GET TEXT, MENU NEW BAR, MENU NEW POPUP, MENU SET STATE, MENU SET TEXT | ||||||||||
Example |
See Menu Example. |