Class Action

UI action, used in menus, toolbars, etc.

class Action

Actions are stored globally, and you can fetch them with findBy* functions.

Constructors

NameDescription
this (label, key, modifiers) Create an action. All parameters are optional

Fields

TypeNameDescription
Signal!(...)
onCall Signals when action is called
Signal!(...)
onChange Signals when action content is changed
Signal!(...)
onStateChange Signals when action state is changed

Properties

TypeNameDescription
bool
checkable[get] When true, action is intended to use with checkbox/radiobutton-like controls
bool
checked[get, set] When true, checkbox/radiobutton-like controls should be shown as checked
context[get, set] Action context; default is ActionContext.window
bool
enabled[get, set] When false, action cannot be called and control showing this action should be disabled
string
iconID[get] Icon resource id
string
id[get]
bool
isRadio[get] When true, this action is included to a group of radio actions
dstring
label[get] Label unicode string to show in UI
shortcut[get, set] Action shortcut, Shortcut.init if none
dstring
shortcutText[get] Returns text description for the action shortcut, null if none
dstring
tooltipText[get] Returns tooltip text for action
bool
visible[get, set] When false, control showing this action should be hidden

Methods

NameDescription
bind (parent, func) Assign a delegate and a widget, which will be used to determine action context
call (chooser) Process the action
matchShortcut (key, modifiers) Returns true if shortcut matches provided key code and flags
setChecked (flag) Chained version of checked
setEnabled (flag) Chained version of enabled
setVisible (flag) Chained version of visible
toString ()
unbind (parent) Unbind action from the widget, if action is associated with it

Static methods

NameDescription
findByName (name) Find action globally by its id
findByShortcut (key, modifiers) Find action globally by a shortcut
groupActions (actions) Group actions to make them react as radio buttons
makeCheckable (label, key, modifiers) Create a checkable action. All parameters are optional