Class Action
UI action
class Action;
For using in menus, toolbars, etc.
Constructors
| Name | Description |
|---|---|
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
| Name | Type | Description |
|---|---|---|
_accelerators
|
Accelerator[] | accelerator list |
_defaultState
|
ActionState | |
_iconId
|
string | icon resource id |
_id
|
int | numerical id |
_label
|
UIString | label to show in UI |
_longParam
|
long | optional long parameter |
_objectParam
|
Object | optional object parameter |
_state
|
ActionState | |
_stateUpdateFlag
|
uint | |
_stringParam
|
string | optional string parameter |
Properties
| Name | Type | Description |
|---|---|---|
accelerators[get]
|
Accelerator[] | returs array of accelerators |
accelerators[get]
|
const(Accelerator)[] | returs const array of accelerators |
acceleratorText[get]
|
dstring | returns text description for first accelerator of action; null if no accelerators |
checked[set]
|
const(Action) | |
clone[get]
|
Action | deep copy |
defaultState[get, set]
|
const(ActionState) | default state for action if action state lookup failed |
iconId[set]
|
Action | sets icon resource id |
iconId[get]
|
string | returns icon resource id |
id[get]
|
int | returns action id |
id[set]
|
Action | sets action id |
isSeparator[get]
|
bool | returns true if it's dummy action to specify separator |
label[set]
|
Action | sets label string resource id |
label[set]
|
Action | sets label unicode string |
label[get]
|
dstring | returns label unicode string (translates if resource id is set) |
labelValue[get]
|
const(UIString) | access to label UIString |
longParam[get]
|
long | sets optional long parameter |
longParam[set]
|
Action | returns optional long parameter |
objectParam[get]
|
Object | returns additional custom (Object) parameter |
objectParam[set]
|
Action | sets additional custom (Object) parameter |
state[get]
|
const(ActionState) | action state (can be used to enable/disable, show/hide, check/uncheck control) |
state[set]
|
Action | update action state (for non-const action) |
state[set]
|
const(Action) | update action state (can be changed even for const objects) |
stateUpdateFlag[get]
|
uint | return action state update flag (see ActionStateUpdateFlag for details) |
stateUpdateFlag[set]
|
Action | sets action state update flag (see ActionStateUpdateFlag for details) |
stringParam[get]
|
string | returns optional string parameter |
stringParam[set]
|
Action | sets optional string parameter |
tooltipText[get]
|
dstring | returns tooltip text for action |
Methods
| Name | Description |
|---|---|
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
()
|