wxMenuBar

wxMenuBar

wxMenuBar
Functions for wxMenuBar class

A menu bar is a series of menus accessible from the top of a frame.

Remark: To respond to a menu selection, provide a handler for EVT_MENU, in the frame that contains the menu bar.

If you have a toolbar which uses the same identifiers as your EVT_MENU entries, events from the toolbar will also be processed by your EVT_MENU event handlers.

Tip: under Windows, if you discover that menu shortcuts (for example, Alt-F to show the file menu) are not working, check any EVT_CHAR events you are handling in child windows. If you are not calling event.Skip() for events that you don't process in these event handlers, menu shortcuts may cease to work.

See: wxMenu, Overview events

This class is derived (and can use functions) from: wxWindow wxEvtHandler

wxWidgets docs: wxMenuBar

Destructor, destroying the menu bar and removing it from the parent frame (if any).

Types

Check = boolean()

Checks or unchecks a menu item.

Remark: Only use this when the menu bar has been associated with a frame; otherwise, use the wxMenu equivalent call.

Types

Enable = boolean()

Enables or disables (greys out) a menu item.

Remark: Only use this when the menu bar has been associated with a frame; otherwise, use the wxMenu equivalent call.

Types

Pos = integer()
Enable = boolean()

Enables or disables a whole menu.

Remark: Only use this when the menu bar has been associated with a frame.

Types

Returns the index of the menu with the given title or wxNOT_FOUND if no such menu exists in this menubar.

The title parameter may specify either the menu title (with accelerator characters, i.e. "&File") or just the menu label ("File") indifferently.

Types

MenuString = ItemString = unicode:chardata()

Finds the menu item id for a menu name/menu item string pair.

Return: The menu item identifier, or wxNOT_FOUND if none was found.

Remark: Any special menu codes are stripped out of source and target strings before matching.

Types

Finds the menu item object associated with the given menu item identifier.

Return: The found menu item object, or NULL if one was not found.

Types

Gets the help string associated with the menu item identifier.

Return: The help string, or the empty string if there was no help string or the menu item was not found.

See: setHelpString/3

Types

Gets the label associated with a menu item.

Return: The menu item label, or the empty string if the item was not found.

Remark: Use only after the menubar has been associated with a frame.

Types

Pos = integer()

Returns the label of a top-level menu.

Note that the returned string includes the accelerator characters that have been specified in the menu title string during its construction.

Return: The menu label, or the empty string if the menu was not found.

Remark: Use only after the menubar has been associated with a frame.

See: getMenuLabelText/2, setMenuLabel/3

Types

Pos = integer()

Returns the label of a top-level menu.

Note that the returned string does not include any accelerator characters that may have been specified in the menu title string during its construction.

Return: The menu label, or the empty string if the menu was not found.

Remark: Use only after the menubar has been associated with a frame.

See: getMenuLabel/2, setMenuLabel/3

Types

Returns the number of menus in this menubar.

Types

Determines whether an item is checked.

Return: true if the item was found and is checked, false otherwise.

Types

Enable = boolean()

Types

Returns the Apple menu.

This is the leftmost menu with application's name as its title. You shouldn't remove any items from it, but it is safe to insert extra menu items or submenus into it.

Only for:wxosx

Since: 3.0.1

Enables you to get the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open.

Return: The global menubar.

Remark: Only exists on Mac, other platforms do not have this method.

Only for:wxosx

Types

Menubar = wxMenuBar()

Enables you to set the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open.

Remark: Only exists on Mac, other platforms do not have this method.

Only for:wxosx

Types

Determines whether an item is enabled.

Return: true if the item was found and is enabled, false otherwise.

Types

Pos = integer()

Removes the menu from the menu bar and returns the menu object - the caller is responsible for deleting it.

This function may be used together with insert/4 to change the menubar dynamically.

See: replace/4

Types

Pos = integer()

Sets the label of a top-level menu.

Remark: Use only after the menubar has been associated with a frame.