MenuItem

One menu command.

Construct with an id (pass 0 to have one generated), a label (an & marks the keyboard mnemonic), and an optional accelerator string. Attach a handler to onClicked before appending the item to a Menu, or look the stored item up later with Menu.findItem.

Constructors

this
this(int id, string label, string accelerator, MenuItemKind kind)

Build a menu item.

Members

Variables

accelerator
string accelerator;

Accelerator description, for example "Ctrl+Shift+N"; empty for none.

checked
bool checked;

Current checked state (only meaningful for MenuItemKind.checkable).

enabled
bool enabled;

Whether the item can be invoked.

id
int id;

Command identifier. Unique within the application's menus.

kind
MenuItemKind kind;

Whether the item is a normal command, a separator, or checkable.

label
string label;

Display label, with & marking the mnemonic letter.

onClicked
Event!() onClicked;

Fired when the item is chosen (by mouse, mnemonic, or accelerator).

Meta