FMX.ActnList.TAction

From Appmethod Libraries
Jump to: navigation, search

FMX.ActnList.TCustomActionSystem.Actions.TContainedActionSystem.Classes.TBasicActionSystem.Classes.TComponentSystem.Classes.TPersistentSystem.TObjectTAction

Object Pascal

TAction = class(TCustomAction)

C++

class PASCALIMPLEMENTATION TAction : public TCustomAction

Properties

Type Visibility Source Unit Parent
class public
FMX.ActnList.pas
FMX.ActnList.hpp
FMX.ActnList FMX.ActnList

Description

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.

The TAction class is almost the same as TCustomAction. TAction extends only the following features of TCustomAction:

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.

Code Examples

See Also