TAction = class(TCustomAction)
class PASCALIMPLEMENTATION TAction : public TCustomAction
TAction is the base class for FireMonkey action objects. TAction implements actions to be used with menu items and controls. 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.
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.
For predefined actions that augment the behavior of TAction, see the action classes in the FMX.StdActns unit.