MenuItem

menu item properties

Constructors

this
this()
Undocumented in source.
this
this(Action action)
Undocumented in source.
this
this(Action action)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

add
MenuItem add(MenuItem subitem)

adds submenu item

add
MenuItem add(Action[] subitemActions)

adds submenu item(s) from one or more actions (will return item for last action)

add
MenuItem add(Action[] subitemActions)

adds submenu item(s) from one or more actions (will return item for last action)

addCheck
MenuItem addCheck(Action a)

adds submenu checkbox item

addSeparator
MenuItem addSeparator()

Add separator item

checkRadioButton
void checkRadioButton(int 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)

clear
void clear()

removes all subitems

findKeyAction
Action findKeyAction(uint keyCode, uint flags)

map key to action

findSubitemByHotkey
int findSubitemByHotkey(dchar ch)

find subitem by hotkey character, returns subitem index, -1 if not found

findSubitemByHotkeyRecursive
MenuItem findSubitemByHotkeyRecursive(dchar ch)

find subitem by hotkey character, returns subitem index, -1 if not found

getHotkey
dchar getHotkey()

get hotkey character from label (e.g. 'F' for item labeled "&File"), 0 if no hotkey

subitem
MenuItem subitem(int index)

returns submenu item by index

updateActionState
void updateActionState(Widget w)

call to update state for action (if action is assigned for widget)

Properties

acceleratorText
dstring acceleratorText [@property getter]

returns text description for first accelerator of action; null if no accelerators

action
const(Action) action [@property getter]

returns item action

action
Action action [@property setter]

sets item action

checked
bool checked [@property getter]

get check for checkbox or radio button item

checked
bool checked [@property setter]

set check for checkbox or radio button item

enabled
bool enabled [@property getter]

menu item Enabled flag

enabled
bool enabled [@property setter]

menu item Enabled flag

id
int id [@property getter]

item action id, 0 if no action

isSubmenu
bool isSubmenu [@property getter]

returns true if item is submenu (contains subitems)

label
UIString label [@property getter]

returns item label

subitemCount
int subitemCount [@property getter]

returns count of submenu items

subitemIndex
MenuItem subitemIndex [@property setter]

returns subitem index for item, -1 if item is not direct subitem of this

type
MenuItemType type [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
type
MenuItemType type [@property setter]

set new MenuItemType

Variables

_action
Action _action;
Undocumented in source.
_checked
bool _checked;
Undocumented in source.
_enabled
bool _enabled;
Undocumented in source.
_parent
MenuItem _parent;
Undocumented in source.
_subitems
MenuItem[] _subitems;
Undocumented in source.
_type
MenuItemType _type;
Undocumented in source.
menuItemAction
Signal!MenuItemActionHandler menuItemAction;

handle menu item click action (parameter is Action)

menuItemClick
Signal!MenuItemClickHandler menuItemClick;

handle menu item click (parameter is MenuItem)

onMenuItem
Signal!(void, MenuItem) onMenuItem;

handle menu item click

openingSubmenu
Signal!(bool, MenuItem) openingSubmenu;

prepare for opening of submenu, return true if opening is allowed

Meta