new()->wxMenu()
Constructs a wxMenu object.
new(Options::[Option])->wxMenu()
Types:
Option = {style, integer()}
Constructs a wxMenu object.
new(Title,Options::[Option])->wxMenu()
Types:
Title = unicode:chardata()
Option = {style, integer()}
Constructs a wxMenu object with a title.
destroy(This::wxMenu())->ok
Destructor, destroying the menu.
Note: Under Motif, a popup menu must have a valid parent (the window it was last popped up on)
when being destroyed. Therefore, make sure you delete or re-use the popup menu before destroying
the parent window. Re-use in this context means popping up the menu on a different window from
last time, which causes an implicit destruction and recreation of internal data structures.
append(This,MenuItem)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
MenuItem = wxMenuItem:wxMenuItem()
Adds a menu item object.
This is the most generic variant of append/5 method because it may be used for both items
(including separators) and submenus and because you can also specify various extra properties of a
menu item this way, such as bitmaps and fonts.
Remark: See the remarks for the other append/5 overloads.
See: appendSeparator/1, appendCheckItem/4, appendRadioItem/4, AppendSubMenu() (not implemented in
wx), insert/6, setLabel/3, getHelpString/2, setHelpString/3, wxMenuItemappend(This,Id,Item)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Id = integer()
Item = unicode:chardata()
append(This,Id,Item,SubMenu)->wxMenuItem:wxMenuItem()append(This,Id,Item,SubMenu::[Option])->
wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Id = integer()
Item = unicode:chardata()
Option = {help, unicode:chardata()} | {kind, wx:wx_enum()}
Adds a menu item.
Example:
or even better for stock menu items (see wxMenuItem:new/1):
Remark: This command can be used after the menu has been shown, as well as on initial creation of
a menu or menubar.
See: appendSeparator/1, appendCheckItem/4, appendRadioItem/4, AppendSubMenu() (not implemented in
wx), insert/6, setLabel/3, getHelpString/2, setHelpString/3, wxMenuItemappend(This,Id,Item,SubMenu,Options::[Option])->
wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Id = integer()
Item = unicode:chardata()
SubMenu = wxMenu()
Option = {help, unicode:chardata()}
Adds a submenu.
Deprecated: This function is deprecated, use AppendSubMenu() (not implemented in wx) instead.
See: appendSeparator/1, appendCheckItem/4, appendRadioItem/4, AppendSubMenu() (not implemented in
wx), insert/6, setLabel/3, getHelpString/2, setHelpString/3, wxMenuItemappendCheckItem(This,Id,Item)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Id = integer()
Item = unicode:chardata()
appendCheckItem(This,Id,Item,Options::[Option])->
wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Id = integer()
Item = unicode:chardata()
Option = {help, unicode:chardata()}
Adds a checkable item to the end of the menu.
See: append/5, insertCheckItem/5appendRadioItem(This,Id,Item)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Id = integer()
Item = unicode:chardata()
appendRadioItem(This,Id,Item,Options::[Option])->
wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Id = integer()
Item = unicode:chardata()
Option = {help, unicode:chardata()}
Adds a radio item to the end of the menu.
All consequent radio items form a group and when an item in the group is checked, all the others
are automatically unchecked.
Note: Radio items are not supported under wxMotif.
See: append/5, insertRadioItem/5appendSeparator(This)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Adds a separator to the end of the menu.
See: append/5, insertSeparator/2break(This)->ok
Types:
This = wxMenu()
Inserts a break in a menu, causing the next appended item to appear in a new column.
This function only actually inserts a break in wxMSW and does nothing under the other platforms.
check(This,Id,Check)->ok
Types:
This = wxMenu()
Id = integer()
Check = boolean()
Checks or unchecks the menu item.
See: isChecked/2delete(This,Id)->boolean()delete(This,Item)->boolean()
Types:
This = wxMenu()
Item = wxMenuItem:wxMenuItem()
Deletes the menu item from the menu.
If the item is a submenu, it will not be deleted. Use 'Destroy'/2 if you want to delete a submenu.
See: findItem/2, 'Destroy'/2, remove/2'Destroy'(This,Id)->boolean()'Destroy'(This,Item)->boolean()
Types:
This = wxMenu()
Item = wxMenuItem:wxMenuItem()
Deletes the menu item from the menu.
If the item is a submenu, it will be deleted. Use remove/2 if you want to keep the submenu (for
example, to reuse it later).
See: findItem/2, delete/2, remove/2enable(This,Id,Enable)->ok
Types:
This = wxMenu()
Id = integer()
Enable = boolean()
Enables or disables (greys out) a menu item.
See: isEnabled/2findItem(This,Id)->wxMenuItem:wxMenuItem()findItem(This,ItemString)->integer()
Types:
This = wxMenu()
ItemString = unicode:chardata()
Finds the menu id for a menu item string.
Return: Menu item identifier, or wxNOT_FOUND if none is found.
Remark: Any special menu codes are stripped out of source and target strings before matching.
findItemByPosition(This,Position)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Position = integer()
Returns the wxMenuItem given a position in the menu.
getHelpString(This,Id)->unicode:charlist()
Types:
This = wxMenu()
Id = integer()
Returns the help string associated with a menu item.
Return: The help string, or the empty string if there is no help string or the item was not found.
See: setHelpString/3, append/5getLabel(This,Id)->unicode:charlist()
Types:
This = wxMenu()
Id = integer()
Returns a menu item label.
Return: The item label, or the empty string if the item was not found.
See: GetLabelText() (not implemented in wx), setLabel/3getMenuItemCount(This)->integer()
Types:
This = wxMenu()
Returns the number of items in the menu.
getMenuItems(This)->[wxMenuItem:wxMenuItem()]
Types:
This = wxMenu()
getTitle(This)->unicode:charlist()
Types:
This = wxMenu()
Returns the title of the menu.
See: setTitle/2insert(This,Pos,Id)->wxMenuItem:wxMenuItem()insert(This,Pos,MenuItem)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Pos = integer()
MenuItem = wxMenuItem:wxMenuItem()
Inserts the given item before the position pos.
Inserting the item at position getMenuItemCount/1 is the same as appending it.
See: append/5, prepend/5insert(This,Pos,Id,Options::[Option])->
wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Pos = Id = integer()
Option =
{text, unicode:chardata()} |
{help, unicode:chardata()} |
{kind, wx:wx_enum()}
Inserts the given item before the position pos.
Inserting the item at position getMenuItemCount/1 is the same as appending it.
See: append/5, prepend/5insert(This,Pos,Id,Text,Submenu)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Pos = Id = integer()
Text = unicode:chardata()
Submenu = wxMenu()
insert(This,Pos,Id,Text,Submenu,Options::[Option])->
wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Pos = Id = integer()
Text = unicode:chardata()
Submenu = wxMenu()
Option = {help, unicode:chardata()}
Inserts the given submenu before the position pos.
text is the text shown in the menu for it and help is the help string shown in the status bar when
the submenu item is selected.
See: AppendSubMenu() (not implemented in wx), prepend/5insertCheckItem(This,Pos,Id,Item)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Pos = Id = integer()
Item = unicode:chardata()
insertCheckItem(This,Pos,Id,Item,Options::[Option])->
wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Pos = Id = integer()
Item = unicode:chardata()
Option = {help, unicode:chardata()}
Inserts a checkable item at the given position.
See: insert/6, appendCheckItem/4insertRadioItem(This,Pos,Id,Item)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Pos = Id = integer()
Item = unicode:chardata()
insertRadioItem(This,Pos,Id,Item,Options::[Option])->
wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Pos = Id = integer()
Item = unicode:chardata()
Option = {help, unicode:chardata()}
Inserts a radio item at the given position.
See: insert/6, appendRadioItem/4insertSeparator(This,Pos)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Pos = integer()
Inserts a separator at the given position.
See: insert/6, appendSeparator/1isChecked(This,Id)->boolean()
Types:
This = wxMenu()
Id = integer()
Determines whether a menu item is checked.
Return: true if the menu item is checked, false otherwise.
See: check/3isEnabled(This,Id)->boolean()
Types:
This = wxMenu()
Id = integer()
Determines whether a menu item is enabled.
Return: true if the menu item is enabled, false otherwise.
See: enable/3prepend(This,Id)->wxMenuItem:wxMenuItem()prepend(This,Item)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Item = wxMenuItem:wxMenuItem()
Inserts the given item at position 0, i.e. before all the other existing items.
See: append/5, insert/6prepend(This,Id,Options::[Option])->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Id = integer()
Option =
{text, unicode:chardata()} |
{help, unicode:chardata()} |
{kind, wx:wx_enum()}
Inserts the given item at position 0, i.e. before all the other existing items.
See: append/5, insert/6prepend(This,Id,Text,Submenu)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Id = integer()
Text = unicode:chardata()
Submenu = wxMenu()
prepend(This,Id,Text,Submenu,Options::[Option])->
wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Id = integer()
Text = unicode:chardata()
Submenu = wxMenu()
Option = {help, unicode:chardata()}
Inserts the given submenu at position 0.
See: AppendSubMenu() (not implemented in wx), insert/6prependCheckItem(This,Id,Item)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Id = integer()
Item = unicode:chardata()
prependCheckItem(This,Id,Item,Options::[Option])->
wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Id = integer()
Item = unicode:chardata()
Option = {help, unicode:chardata()}
Inserts a checkable item at position 0.
See: prepend/5, appendCheckItem/4prependRadioItem(This,Id,Item)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Id = integer()
Item = unicode:chardata()
prependRadioItem(This,Id,Item,Options::[Option])->
wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Id = integer()
Item = unicode:chardata()
Option = {help, unicode:chardata()}
Inserts a radio item at position 0.
See: prepend/5, appendRadioItem/4prependSeparator(This)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Inserts a separator at position 0.
See: prepend/5, appendSeparator/1remove(This,Id)->wxMenuItem:wxMenuItem()remove(This,Item)->wxMenuItem:wxMenuItem()
Types:
This = wxMenu()
Item = wxMenuItem:wxMenuItem()
Removes the menu item from the menu but doesn't delete the associated C++ object.
This allows you to reuse the same item later by adding it back to the menu (especially useful with
submenus).
Return: A pointer to the item which was detached from the menu.
setHelpString(This,Id,HelpString)->ok
Types:
This = wxMenu()
Id = integer()
HelpString = unicode:chardata()
Sets an item's help string.
See: getHelpString/2setLabel(This,Id,Label)->ok
Types:
This = wxMenu()
Id = integer()
Label = unicode:chardata()
Sets the label of a menu item.
See: append/5, getLabel/2setTitle(This,Title)->ok
Types:
This = wxMenu()
Title = unicode:chardata()
Sets the title of the menu.
Remark: Notice that you can only call this method directly for the popup menus, to change the
title of a menu that is part of a menu bar you need to use wxMenuBar:setLabelTop/3.
See: getTitle/1
wxWidgets team. wx 2.1.1 wxMenu(3erl)