Class MenuItem

menu item properties

Inherits from

  • Object (base class)

Constructors

Name Description
this
this

Fields

Name Type Description
onBeforeOpeningSubmenu Signal!(bool,dlangui.widgets.menu.MenuItem) prepare for opening of submenu, return true if opening is allowed
onMenuItem Signal!(void,dlangui.widgets.menu.MenuItem) handle menu item click
onMenuItemAction Signal!(dlangui.widgets.menu.MenuItemActionHandler) handle menu item click action (parameter is Action)
onMenuItemClick Signal!(dlangui.widgets.menu.MenuItemClickHandler) handle menu item click (parameter is MenuItem)
_action Action
_checked bool
_enabled bool
_parent MenuItem
_subitems MenuItem[]
_type MenuItemType

Properties

Name Type Description
acceleratorText [get] dstring returns text description for first accelerator of action; null if no accelerators
action [set] MenuItem sets item action
action [get] const(Action) returns item action
checked [set] MenuItem set check for checkbox or radio button item
checked [get] bool get check for checkbox or radio button item
enabled [get, set] bool menu item Enabled flag
id [get] int item action id, 0 if no action
isSubmenu [get] bool returns true if item is submenu (contains subitems)
label [get] UIString returns item label
subitemCount [get] int returns count of submenu items
subitemIndex [set] int returns subitem index for item, -1 if item is not direct subitem of this
type [set] MenuItem set new MenuItemType
type [get] MenuItemType

Methods

Name Description
add adds submenu item
add adds submenu item(s) from one or more actions (will return item for last action)
addSeparator Add separator item
findSubitemByHotkey find subitem by hotkey character, returns subitem index, -1 if not found
getHotkey get hotkey character from label (e.g. 'F' for item labeled "&File"), 0 if no hotkey
subitem returns submenu item by index
checkRadioButton check radio button with specified index, uncheck other radio buttons in group (group consists of sequence of radio button items; other item type - end of group)

Authors

Vadim Lopatin, coolreader.org@gmail.com

Copyright

Vadim Lopatin, 2014

License

Boost License 1.0