Class MenuItem
menu item properties
class MenuItem;
Constructors
| Name | Description |
|---|---|
this
(action)
|
|
this
(action)
|
|
this
()
|
Fields
| Name | Type | Description |
|---|---|---|
menuItemAction
|
Signal!(dcanvas.widgets.menu.MenuItemActionHandler) | handle menu item click action (parameter is Action) |
menuItemClick
|
Signal!(dcanvas.widgets.menu.MenuItemClickHandler) | handle menu item click (parameter is MenuItem) |
onMenuItem
|
Signal!(void,dcanvas.widgets.menu.MenuItem) | handle menu item click |
openingSubmenu
|
Signal!(bool,dcanvas.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[get]
|
bool | get check for checkbox or radio button item |
checked[set]
|
MenuItem | set 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[get]
|
MenuItemType | |
type[set]
|
MenuItem | set new MenuItemType |
Methods
| Name | Description |
|---|---|
add
(subitem)
|
adds submenu item |
add
(subitemActions)
|
adds submenu item(s) from one or more actions (will return item for last action) |
addCheck
(a)
|
adds submenu checkbox item |
addSeparator
()
|
Add separator item |
clear
()
|
removes all subitems |
findKeyAction
(keyCode, flags)
|
map key to action |
findSubitemByHotkey
(ch)
|
find subitem by hotkey character, returns subitem index, -1 if not found |
findSubitemByHotkeyRecursive
(ch)
|
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
(index)
|
returns submenu item by index |
updateActionState
(w)
|
call to update state for action (if action is assigned for widget) |
checkRadioButton
(index)
|
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) |
Aliases
| Name | Description |
|---|---|
~this
|