.TH wxMenuBar 3erl "wx 2.2.2.1" "wxWidgets team." "Erlang Module Definition" .SH NAME wxMenuBar \- Functions for wxMenuBar class .SH DESCRIPTION .LP A menu bar is a series of menus accessible from the top of a frame\&. .LP Remark: To respond to a menu selection, provide a handler for EVT_MENU, in the frame that contains the menu bar\&. .LP 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\&. .LP 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\&. .LP See: \fIwxMenu\fR\&, Overview events .LP This class is derived (and can use functions) from: \fIwxWindow\fR\& \fIwxEvtHandler\fR\& .LP wxWidgets docs: wxMenuBar .SH DATA TYPES .nf \fBwxMenuBar()\fR\& = wx:wx_object() .br .fi .SH EXPORTS .LP .nf .B new() -> wxMenuBar() .br .fi .br .RS .LP Construct an empty menu bar\&. .RE .LP .nf .B new(Style) -> wxMenuBar() .br .fi .br .RS .LP Types: .RS 3 Style = integer() .br .RE .RE .RS .RE .LP .nf .B destroy(This :: wxMenuBar()) -> ok .br .fi .br .RS .LP Destructor, destroying the menu bar and removing it from the parent frame (if any)\&. .RE .LP .nf .B append(This, Menu, Title) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Menu = wxMenu:wxMenu() .br Title = unicode:chardata() .br .RE .RE .RS .LP Adds the item to the end of the menu bar\&. .LP Return: true on success, false if an error occurred\&. .LP See: \fIinsert/4\fR\& .RE .LP .nf .B check(This, Id, Check) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Id = integer() .br Check = boolean() .br .RE .RE .RS .LP Checks or unchecks a menu item\&. .LP Remark: Only use this when the menu bar has been associated with a frame; otherwise, use the \fIwxMenu\fR\& equivalent call\&. .RE .LP .nf .B enable(This, Id, Enable) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Id = integer() .br Enable = boolean() .br .RE .RE .RS .LP Enables or disables (greys out) a menu item\&. .LP Remark: Only use this when the menu bar has been associated with a frame; otherwise, use the \fIwxMenu\fR\& equivalent call\&. .RE .LP .nf .B enableTop(This, Pos, Enable) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Pos = integer() .br Enable = boolean() .br .RE .RE .RS .LP Enables or disables a whole menu\&. .LP Remark: Only use this when the menu bar has been associated with a frame\&. .RE .LP .nf .B findMenu(This, Title) -> integer() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Title = unicode:chardata() .br .RE .RE .RS .LP Returns the index of the menu with the given \fItitle\fR\& or \fIwxNOT_FOUND\fR\& if no such menu exists in this menubar\&. .LP The \fItitle\fR\& parameter may specify either the menu title (with accelerator characters, i\&.e\&. \fI"&File"\fR\&) or just the menu label (\fI"File"\fR\&) indifferently\&. .RE .LP .nf .B findMenuItem(This, MenuString, ItemString) -> integer() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br MenuString = ItemString = unicode:chardata() .br .RE .RE .RS .LP Finds the menu item id for a menu name/menu item string pair\&. .LP Return: The menu item identifier, or wxNOT_FOUND if none was found\&. .LP Remark: Any special menu codes are stripped out of source and target strings before matching\&. .RE .LP .nf .B findItem(This, Id) -> wxMenuItem:wxMenuItem() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Id = integer() .br .RE .RE .RS .LP Finds the menu item object associated with the given menu item identifier\&. .LP Return: The found menu item object, or NULL if one was not found\&. .RE .LP .nf .B getHelpString(This, Id) -> unicode:charlist() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Id = integer() .br .RE .RE .RS .LP Gets the help string associated with the menu item identifier\&. .LP Return: The help string, or the empty string if there was no help string or the menu item was not found\&. .LP See: \fIsetHelpString/3\fR\& .RE .LP .nf .B getLabel(This, Id) -> unicode:charlist() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Id = integer() .br .RE .RE .RS .LP Gets the label associated with a menu item\&. .LP Return: The menu item label, or the empty string if the item was not found\&. .LP Remark: Use only after the menubar has been associated with a frame\&. .RE .LP .nf .B getLabelTop(This, Pos) -> unicode:charlist() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Pos = integer() .br .RE .RE .RS .LP See: \fIgetMenuLabel/2\fR\&\&. .RE .LP .nf .B getMenuLabel(This, Pos) -> unicode:charlist() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Pos = integer() .br .RE .RE .RS .LP Returns the label of a top-level menu\&. .LP Note that the returned string includes the accelerator characters that have been specified in the menu title string during its construction\&. .LP Return: The menu label, or the empty string if the menu was not found\&. .LP Remark: Use only after the menubar has been associated with a frame\&. .LP See: \fIgetMenuLabelText/2\fR\&, \fIsetMenuLabel/3\fR\& .RE .LP .nf .B getMenuLabelText(This, Pos) -> unicode:charlist() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Pos = integer() .br .RE .RE .RS .LP Returns the label of a top-level menu\&. .LP Note that the returned string does not include any accelerator characters that may have been specified in the menu title string during its construction\&. .LP Return: The menu label, or the empty string if the menu was not found\&. .LP Remark: Use only after the menubar has been associated with a frame\&. .LP See: \fIgetMenuLabel/2\fR\&, \fIsetMenuLabel/3\fR\& .RE .LP .nf .B getMenu(This, MenuIndex) -> wxMenu:wxMenu() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br MenuIndex = integer() .br .RE .RE .RS .LP Returns the menu at \fImenuIndex\fR\& (zero-based)\&. .RE .LP .nf .B getMenuCount(This) -> integer() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br .RE .RE .RS .LP Returns the number of menus in this menubar\&. .RE .LP .nf .B insert(This, Pos, Menu, Title) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Pos = integer() .br Menu = wxMenu:wxMenu() .br Title = unicode:chardata() .br .RE .RE .RS .LP Inserts the menu at the given position into the menu bar\&. .LP Inserting menu at position 0 will insert it in the very beginning of it, inserting at position \fIgetMenuCount/1\fR\& is the same as calling \fIappend/3\fR\&\&. .LP Return: true on success, false if an error occurred\&. .LP See: \fIappend/3\fR\& .RE .LP .nf .B isChecked(This, Id) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Id = integer() .br .RE .RE .RS .LP Determines whether an item is checked\&. .LP Return: true if the item was found and is checked, false otherwise\&. .RE .LP .nf .B setAutoWindowMenu(Enable) -> ok .br .fi .br .RS .LP Types: .RS 3 Enable = boolean() .br .RE .RE .RS .RE .LP .nf .B getAutoWindowMenu() -> boolean() .br .fi .br .RS .RE .LP .nf .B oSXGetAppleMenu(This) -> wxMenu:wxMenu() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br .RE .RE .RS .LP Returns the Apple menu\&. .LP 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\&. .LP Only for:wxosx .LP Since: 3\&.0\&.1 .RE .LP .nf .B macGetCommonMenuBar() -> wxMenuBar() .br .fi .br .RS .LP Enables you to get the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open\&. .LP Return: The global menubar\&. .LP Remark: Only exists on Mac, other platforms do not have this method\&. .LP Only for:wxosx .RE .LP .nf .B macSetCommonMenuBar(Menubar) -> ok .br .fi .br .RS .LP Types: .RS 3 Menubar = wxMenuBar() .br .RE .RE .RS .LP Enables you to set the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open\&. .LP Remark: Only exists on Mac, other platforms do not have this method\&. .LP Only for:wxosx .RE .LP .nf .B isEnabled(This, Id) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Id = integer() .br .RE .RE .RS .LP Determines whether an item is enabled\&. .LP Return: true if the item was found and is enabled, false otherwise\&. .RE .LP .nf .B remove(This, Pos) -> wxMenu:wxMenu() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Pos = integer() .br .RE .RE .RS .LP Removes the menu from the menu bar and returns the menu object - the caller is responsible for deleting it\&. .LP This function may be used together with \fIinsert/4\fR\& to change the menubar dynamically\&. .LP See: \fIreplace/4\fR\& .RE .LP .nf .B replace(This, Pos, Menu, Title) -> wxMenu:wxMenu() .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Pos = integer() .br Menu = wxMenu:wxMenu() .br Title = unicode:chardata() .br .RE .RE .RS .LP Replaces the menu at the given position with another one\&. .LP Return: The menu which was previously at position pos\&. The caller is responsible for deleting it\&. .LP See: \fIinsert/4\fR\&, \fIremove/2\fR\& .RE .LP .nf .B setHelpString(This, Id, HelpString) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Id = integer() .br HelpString = unicode:chardata() .br .RE .RE .RS .LP Sets the help string associated with a menu item\&. .LP See: \fIgetHelpString/2\fR\& .RE .LP .nf .B setLabel(This, Id, Label) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Id = integer() .br Label = unicode:chardata() .br .RE .RE .RS .LP Sets the label of a menu item\&. .LP Remark: Use only after the menubar has been associated with a frame\&. .LP See: \fIgetLabel/2\fR\& .RE .LP .nf .B setLabelTop(This, Pos, Label) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Pos = integer() .br Label = unicode:chardata() .br .RE .RE .RS .LP See: \fIsetMenuLabel/3\fR\&\&. .RE .LP .nf .B setMenuLabel(This, Pos, Label) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxMenuBar() .br Pos = integer() .br Label = unicode:chardata() .br .RE .RE .RS .LP Sets the label of a top-level menu\&. .LP Remark: Use only after the menubar has been associated with a frame\&. .RE