Purpose
Rebuilds the entire menu bar, using the available menus. You can issue this statement from the MapBasic window in MapInfo Pro.
Syntax 1
Create Menu Bar As
{ menu_name | ID menu_number }
[ , { menu_name | ID menu_number } ... ]
Syntax 2
Create Menu Bar As Default
menu_name is the name of a standard MapInfo Pro menu, or the name of a custom menu created through a Create Menu statement.
menu_number is the number associated with a standard MapInfo Pro menu (for example, 1 for the File menu).
Description
A Create Menu Bar statement tells MapInfo Pro which menus should appear on the menu bar, and in what order. If the statement omits one or more of the standard menu names, the resultant menu may be shorter than the standard MapInfo Pro menu. Conversely, if the statement includes the names of one or more custom menus (which were created through the Create Menu statement), the Create Menu Bar statement can create a menu bar that is longer than the standard MapInfo Pro menu.
Any menu can be identified by its name (for example, "File"), regardless of whether it is a standard menu or a custom menu. Each of MapInfo Pro's standard menus can also be referred to by its menu ID; for example, the File menu has an ID of 1.
See Alter Menu Item statement for a listing of the names and ID numbers of MapInfo Pro's menus.
After the menu bar has been customized, the following statement:
Create Menu Bar As Default
restores the standard MapInfo Pro menu bar. Note that the Create Menu Bar As Default statement removes any custom menu items that may have been added by other MapBasic applications that may be running at the same time. For the sake of not accidentally disabling other MapBasic applications, you should exercise caution when using the Create Menu Bar As Default statement.
Examples
The following example shortens the menu bar so that it includes only the File, Edit, and Query menus.
Create Menu Bar As
"File", "Edit", "Query"
Ordinarily, the MapInfo Pro menu bar only displays a Map menu when a Map window is the active window. Similarly, MapInfo Pro only displays a Browse menu when a Browse window is the active window. The following example redefines the menu bar so that it always includes both the Map and Browse menus, even when no windows are on the screen. However, all items on the Map menu will be disabled (grayed out) whenever the current window is not a Map window, and all items on the Browse menu will be disabled whenever the current window is not a Browse window.
Create Menu Bar As
"File", "Edit", "Query", "Map", "Browse"
The following example creates a custom menu, called DataEntry, and then redefines the menu bar so that it includes only the File, Edit, and DataEntry menus.
Declare Sub AddSub
Declare Sub EditSub
Declare Sub DelSub
Create Menu "DataEntry" As
"Add" calling AddSub,
"Edit" calling EditSub,
"Delete" calling DelSub
Create Menu Bar As
"File", "Edit", "DataEntry"
See Also:
Alter Menu Bar statement, Create Menu statement, Menu Bar statement