Class Action

UI action

For using in menus, toolbars, etc.

Inherits from

  • Object (base class)

Constructors

Name Description
this deep copy constructor
this create action only with ID
this create action with id, labelResourceId, and optional icon and key accelerator.
this action with accelerator, w/o label
this 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
_stringParam string optional string parameter

Properties

Name Type Description
accelerators [get] const(Accelerator)[] returs const array of accelerators
accelerators [get] Accelerator[] returs array of accelerators
acceleratorText [get] dstring returns text description for first accelerator of action; null if no accelerators
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 [set] const(Action) update action state (can be changed even for const objects)
state [set] Action update action state (for non-const action)
state [get] const(ActionState) action state (can be used to enable/disable, show/hide, check/uncheck control)
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 adds one more accelerator
addMacAccelerator adds one more accelerator only if platform is OSX
addNonMacAccelerator adds one more accelerator only if platform is not OSX
checkAccelerator 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 compares id of this action with another action id
toString

Authors

Vadim Lopatin, coolreader.org@gmail.com

Copyright

Vadim Lopatin, 2014

License

Boost License 1.0