ProvideX V8.20 > Language Reference > 2. Directives
201
MENU_BAR Directive
           Control Menu Bar
Formats
1. Define/Create: MENU_BAR ctl_id,menu_def$[,ERR=stmtref]
2. Remove: MENU_BAR REMOVE[,ERR=stmtref]
3. Disable/Enable Item: MENU_BAR {DISABLE | ENABLE} element[$][,ERR=stmtref]
4. Force Focus: MENU_BAR GOTO[,ERR=stmtref]
5. 'Check'/'Uncheck' Item: MENU_BAR {ON | OFF} element[$][,ERR=stmtref]
6. Read Selected Item:  MENU_BAR READ var$[,ERR=stmtref]
7. Clear Menu Bar:  MENU_BAR CLEAR[,ERR=stmtref]
8. Restore Default Help:  MENU_BAR RESET[,ERR=stmtref]
Where:
ctl_id
Unique logical identifier for the menu bar. Use an integer between -32000
to +32000. Avoid integers that conflict with keyboard definitions (e.g., 4
cancels CTL=4 for the F4 key) or special negative CTL values set by the
system. See Negative CTL Definitions, p.822.
element[$]
Individual menu selection. Expression consisting of shortcut letters
or assigned item CTL values for accessing the selection.
menu_def$
Menu structure and elements. String expressions. Maximum 2047
elements. A bitmap/icon can be included for each element in the menu.
Tip: To determine how many elements you already have, count the
ampersands (&).
stmtref
Program line number or label to transfer control to.
var$
String variable to receive the last selected menu item.
Description
Use the MENU_BAR directive to define and control the menu across the top of a
window.
Format 1: Define/Create Menu Bar
MENU_BAR ctl_id,menu_def$[,ERR=stmtref]
This format creates a menu bar control object. If the menu bar is not properly defined,
ProvideX returns an Error #87: MENUBAR definition invalid. Define the
menu_def$ of menu groups and elements and identify each item uniquely (e.g., F and O
would identify File/Open) by marking the character the user can enter in conjunction
with the Alt key (e.g., Alt -F) to select the particular item. Use the following format:
· Enclose each menu group in square brackets.
· Delimit each item in a group with a comma.
· Prefix each item's selection character (hot key) with & (an ampersand).
· Prefix each sub-menu group with its item ID.