wMenuItem

A menu item represents an item in a menu.

Seealso:wMenu wMenuBar

Procs

proc getMenu(self: wMenuItem): wMenu {...}{.inline, raises: [KeyError, wNilAccess],
                                   tags: [RootEffect].}
Returns the menu this item is in, or NULL if this item is not attached.
proc getKind(self: wMenuItem): wMenuItemKind {...}{.inline, raises: [], tags: [].}
Returns the item kind, one of wMenuItemNormal, wMenuItemCheck, wMenuItemRadio, wMenuItemSeparator, or wMenuItemSubMenu.
proc getSubMenu(self: wMenuItem): wMenu {...}{.inline, raises: [], tags: [].}
Returns the submenu for the menu item, or nil if there isn't one.
proc getText(self: wMenuItem): string {...}{.inline, raises: [], tags: [].}
Returns the text for the menu item.
proc getLabel(self: wMenuItem): string {...}{.inline, raises: [], tags: [].}
Returns the text for the menu item.
proc setText(self: wMenuItem; text: string) {...}{.raises: [KeyError, wNilAccess],
    tags: [RootEffect].}
Sets the text for the menu item.
proc setLabel(self: wMenuItem; text: string) {...}{.raises: [KeyError, wNilAccess],
    tags: [RootEffect].}
Sets the text for the menu item.
proc getLabelText(self: wMenuItem): string {...}{.inline, raises: [], tags: [].}
Returns the text for the menu item, not include any accelerator characters.
proc getHelp(self: wMenuItem): string {...}{.inline, raises: [], tags: [].}
Returns the help string.
proc setHelp(self: wMenuItem; help: string) {...}{.inline, raises: [], tags: [].}
Sets the help string.
proc getBitmap(self: wMenuItem): wBitmap {...}{.inline, raises: [], tags: [].}
Returns the bitmap.
proc setBitmap(self: wMenuItem; bitmap: wBitmap = nil) {...}{.
    raises: [KeyError, wNilAccess], tags: [RootEffect].}
Sets the bitmap for the menu item, nil for clear the bitmap.
proc getId(self: wMenuItem): wCommandID {...}{.inline, raises: [], tags: [].}
Returns the menu item identifier.
proc setId(self: wMenuItem; id: wCommandID) {...}{.raises: [KeyError, wNilAccess],
    tags: [RootEffect].}
Sets the id for the menu item.
proc getData(self: wMenuItem): int {...}{.inline, raises: [], tags: [].}
Returns the data associated with the item.
proc setData(self: wMenuItem; data: int) {...}{.raises: [], tags: [].}
Sets the item associated data.
proc isCheck(self: wMenuItem): bool {...}{.raises: [], tags: [].}
Determines whether a menu item is a kind of check item.
proc isRadio(self: wMenuItem): bool {...}{.raises: [], tags: [].}
Determines whether a menu item is a kind of radio item.
proc isSeparator(self: wMenuItem): bool {...}{.raises: [], tags: [].}
Determines whether a menu item is a kind of separator.
proc isSubMenu(self: wMenuItem): bool {...}{.raises: [], tags: [].}
Determines whether a menu item is a kind of submenu.
proc enable(self: wMenuItem; flag = true) {...}{.raises: [KeyError, wNilAccess],
                                      tags: [RootEffect].}
Enables or disables (greys out) a menu item.
proc disable(self: wMenuItem) {...}{.inline, raises: [KeyError, wNilAccess],
                             tags: [RootEffect].}
Disables (greys out) a menu item.
proc isEnabled(self: wMenuItem): bool {...}{.raises: [KeyError, wNilAccess],
                                    tags: [RootEffect].}
Determines whether a menu item is enabled.
proc check(self: wMenuItem; flag = true) {...}{.raises: [KeyError, wNilAccess],
                                     tags: [RootEffect].}
Checks or unchecks the menu item.
proc isChecked(self: wMenuItem): bool {...}{.raises: [KeyError, wNilAccess],
                                    tags: [RootEffect].}
Determines whether a menu item is checked.
proc toggle(self: wMenuItem) {...}{.raises: [KeyError, wNilAccess], tags: [RootEffect].}
Toggle the menu item.
proc detach(self: wMenuItem) {...}{.raises: [KeyError, wNilAccess], tags: [RootEffect].}
Detach a menu item from all menu.
proc init(self: wMenuItem; id: wCommandID = wIdAny; text = ""; help = "";
         kind = wMenuItemNormal; bitmap: wBitmap = nil; submenu: wMenu = nil) {...}{.
    raises: [wError], tags: [RootEffect].}
Initializer.
proc MenuItem(id: wCommandID = wIdAny; text = ""; help = ""; kind = wMenuItemNormal;
             bitmap: wBitmap = nil; submenu: wMenu = nil): wMenuItem {...}{.inline,
    raises: [wError], tags: [RootEffect].}
Constructor.