TAction = class(TCustomAction)
class PASCALIMPLEMENTATION TAction : public TCustomAction
TAction is the base class for FireMonkey action objects. TAction and descendant classes implement actions to be used with controls, menu items, and tool buttons. The published properties and events of TAction actions can be managed in the Object Inspector at design time.
- Changes the public scope to published for the AutoCheck, Checked, Enabled, GroupIndex, HelpType, HelpContext, HelpKeyword, Hint, ShortCut, SecondaryShortCuts, Text, Visible, UnsupportedArchitectures, and UnsupportedPlatforms properties.
- Sets the published scope for the OnExecute and OnUpdate events.
- The published scope of these properties and events provides the possibility to use the assistance of the Object Inspector for editing values of these properties and events.
- The DisableIfNoHandler property is set to True while an action is created, that is, the action is inaccessible if it does not have an OnExecute event handler.
TAction is a generic action component. It can be added to action lists when there is no predefined action class that implements the desired response to user commands. Unlike predefined action classes, which have built-in methods that respond when users click the client controls, TAction has no built-in response to user commands. Instead, when using TAction, you can provide the response when the action "fires" by writing (using the assistant of the Object Inspector) an OnExecute event handler, and configure the properties of TAction to reflect the current conditions by writing an OnUpdate event handler.
Action objects are used to centralize the response to user commands (actions) and to represent user interface elements in applications that use action lists.
The Visible property defines whether the action representation is visible. This Visible value can be propagated to a client of the action. Typically, IsVisibleLinked of an action link returns
True when the action belongs to TAction. In this case, when the Visible property of the action is set
False, then the Visible property of the client is also set
False. For example, if a client is a menu item or a control, then these menu item or control are set invisible. This behavior of Visible in TAction is opposite to behavior in TCustomViewAction.
TAction can also act as a base class for predefined action classes. You can derive from TAction if you want to retain the published scope of the supported properties and events. If you want to use the public scope to some of the supported properties and events, you can derive from TCustomAction.