Vcl.ActnList.TAction

From RAD Studio API Documentation
Jump to: navigation, search

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

Delphi

TAction = class(TCustomAction)

C++

class PASCALIMPLEMENTATION TAction : public TCustomAction

Properties

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

Description

TAction is the base class for VCL 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 Object Inspector assistance 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 Object Inspector's assistance) 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 or action bands.

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 Vcl.StdActns, Vcl.DBActns, and Vcl.ExtActns units.

See Also