Class MenuItem

menu item properties

Inherits from

  • Object (base class)

Constructors

Name Description
this
this
this

Fields

Name Type Description
menuItemAction Signal!(dlangui.widgets.menu.MenuItemActionHandler) handle menu item click action (parameter is Action)
menuItemClick Signal!(dlangui.widgets.menu.MenuItemClickHandler) handle menu item click (parameter is MenuItem)
onMenuItem Signal!(void,dlangui.widgets.menu.MenuItem) handle menu item click
openingSubmenu Signal!(bool,dlangui.widgets.menu.MenuItem) prepare for opening of submenu, return true if opening is allowed
_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 [get] const(Action) returns item action
action [set] MenuItem sets 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(s) from one or more actions (will return item for last action)
add adds submenu item
addSeparator Add separator item
findKeyAction map key to action
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
updateActionState call to update state for action (if action is assigned for widget)
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