Class Action

UI action

class Action;

For using in menus, toolbars, etc.

Constructors

NameDescription
this (a) deep copy constructor
this (id) create action only with ID
this (id, labelResourceId, iconResourceId, keyCode, keyFlags, stateUpdateFlag) create action with id, labelResourceId, and optional icon and key accelerator.
this (id, keyCode, keyFlags, stateUpdateFlag) action with accelerator, w/o label
this (id, label, iconResourceId, keyCode, keyFlags, stateUpdateFlag) action with label, icon, and accelerator

Fields

NameTypeDescription
_accelerators Accelerator[]accelerator list
_defaultState ActionState
_iconId stringicon resource id
_id intnumerical id
_label UIStringlabel to show in UI
_longParam longoptional long parameter
_objectParam Objectoptional object parameter
_state ActionState
_stateUpdateFlag uint
_stringParam stringoptional string parameter

Properties

NameTypeDescription
accelerators[get] Accelerator[]returs array of accelerators
accelerators[get] const(Accelerator)[]returs const array of accelerators
acceleratorText[get] dstringreturns text description for first accelerator of action; null if no accelerators
checked[set] const(Action)
clone[get] Actiondeep copy
defaultState[get, set] const(ActionState)default state for action if action state lookup failed
iconId[set] Actionsets icon resource id
iconId[get] stringreturns icon resource id
id[get] intreturns action id
id[set] Actionsets action id
isSeparator[get] boolreturns true if it's dummy action to specify separator
label[set] Actionsets label string resource id
label[set] Actionsets label unicode string
label[get] dstringreturns label unicode string (translates if resource id is set)
labelValue[get] const(UIString)access to label UIString
longParam[get] longsets optional long parameter
longParam[set] Actionreturns optional long parameter
objectParam[get] Objectreturns additional custom (Object) parameter
objectParam[set] Actionsets additional custom (Object) parameter
state[get] const(ActionState)action state (can be used to enable/disable, show/hide, check/uncheck control)
state[set] Actionupdate action state (for non-const action)
state[set] const(Action)update action state (can be changed even for const objects)
stateUpdateFlag[get] uintreturn action state update flag (see ActionStateUpdateFlag for details)
stateUpdateFlag[set] Actionsets action state update flag (see ActionStateUpdateFlag for details)
stringParam[get] stringreturns optional string parameter
stringParam[set] Actionsets optional string parameter
tooltipText[get] dstringreturns tooltip text for action

Methods

NameDescription
addAccelerator (keyCode, keyFlags) adds one more accelerator
addMacAccelerator (keyCode, keyFlags) adds one more accelerator only if platform is OSX
addNonMacAccelerator (keyCode, keyFlags) adds one more accelerator only if platform is not OSX
checkAccelerator (keyCode, keyFlags) returns true if accelerator matches provided key code and flags
disableByDefault () set default state to disabled, visible, not-checked
hideByDefault () set default state to disabled, invisible, not-checked
opEquals (anotherActionId) compares id of this action with another action id
toString ()