Action

UI action

For using in menus, toolbars, etc.

class Action {}

Constructors

this
this(Action a)

deep copy constructor

this
this(int id)

create action only with ID

this
this(int id, string labelResourceId, string iconResourceId, uint keyCode, uint keyFlags, uint stateUpdateFlag)

create action with id, labelResourceId, and optional icon and key accelerator.

this
this(int id, uint keyCode, uint keyFlags, uint stateUpdateFlag)

action with accelerator, w/o label

this
this(int id, dstring label, string iconResourceId, uint keyCode, uint keyFlags, uint stateUpdateFlag)

action with label, icon, and accelerator

Members

Functions

addAccelerator
Action addAccelerator(uint keyCode, uint keyFlags)

adds one more accelerator

addMacAccelerator
Action addMacAccelerator(uint keyCode, uint keyFlags)

adds one more accelerator only if platform is OSX

addNonMacAccelerator
Action addNonMacAccelerator(uint keyCode, uint keyFlags)

adds one more accelerator only if platform is not OSX

checkAccelerator
bool checkAccelerator(uint keyCode, uint keyFlags)

returns true if accelerator matches provided key code and flags

disableByDefault
Action disableByDefault()

set default state to disabled, visible, not-checked

hideByDefault
Action hideByDefault()

set default state to disabled, invisible, not-checked

opEquals
bool opEquals(int anotherActionId)

compares id of this action with another action id

opEquals
bool opEquals(Action action)

compares id of this action with another action id

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

acceleratorText
dstring acceleratorText [@property getter]

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

accelerators
Accelerator[] accelerators [@property getter]

returs array of accelerators

accelerators
const(Accelerator)[] accelerators [@property getter]

returs const array of accelerators

checked
bool checked [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
clone
Action clone [@property getter]

deep copy

clone
Action clone [@property getter]

deep copy

clone
Action clone [@property getter]

deep copy

defaultState
const(ActionState) defaultState [@property getter]

default state for action if action state lookup failed

defaultState
ActionState defaultState [@property setter]

default state for action if action state lookup failed

iconId
string iconId [@property setter]

sets icon resource id

iconId
string iconId [@property getter]

returns icon resource id

id
int id [@property getter]

returns action id

id
int id [@property setter]

sets action id

isSeparator
bool isSeparator [@property getter]

returns true if it's dummy action to specify separator

label
string label [@property setter]

sets label string resource id

label
dstring label [@property setter]

sets label unicode string

label
dstring label [@property getter]

returns label unicode string (translates if resource id is set)

labelValue
const(UIString) labelValue [@property getter]

access to label UIString

longParam
long longParam [@property getter]

sets optional long parameter

longParam
long longParam [@property setter]

returns optional long parameter

objectParam
Object objectParam [@property getter]

returns additional custom (Object) parameter

objectParam
const(Object) objectParam [@property getter]

returns additional custom (Object) parameter

objectParam
Object objectParam [@property setter]

sets additional custom (Object) parameter

state
const(ActionState) state [@property getter]

action state (can be used to enable/disable, show/hide, check/uncheck control)

state
ActionState state [@property setter]

update action state (for non-const action)

state
ActionState state [@property setter]

update action state (can be changed even for const objects)

stateUpdateFlag
uint stateUpdateFlag [@property getter]

return action state update flag (see ActionStateUpdateFlag for details)

stateUpdateFlag
uint stateUpdateFlag [@property setter]

sets action state update flag (see ActionStateUpdateFlag for details)

stringParam
string stringParam [@property getter]

returns optional string parameter

stringParam
string stringParam [@property setter]

sets optional string parameter

tooltipText
dstring tooltipText [@property getter]

returns tooltip text for action

Variables

_accelerators
Accelerator[] _accelerators;

accelerator list

_defaultState
ActionState _defaultState;
Undocumented in source.
_iconId
string _iconId;

icon resource id

_id
int _id;

numerical id

_label
UIString _label;

label to show in UI

_longParam
long _longParam;

optional long parameter

_objectParam
Object _objectParam;

optional object parameter

_state
ActionState _state;
Undocumented in source.
_stateUpdateFlag
uint _stateUpdateFlag;
Undocumented in source.
_stringParam
string _stringParam;

optional string parameter

Meta