TBasicAction
[Properties (by Name)][Methods (by Name)][Events (by Name)]
Abstract base class for all Actions.
Declaration
Source position: classesh.inc line 2175
Type
TBasicAction = class (TComponent)
private
FActionComponent : TComponent;
FOnChange : TNotifyEvent;
FOnExecute : TNotifyEvent;
FOnUpdate : TNotifyEvent;
protected
FClients : TFPList;
procedure Change; Virtual;
procedure SetOnExecute(Value: TNotifyEvent); Virtual;
OnChange : TNotifyEvent;
public
constructor Create(AOwner: TComponent); Override;
destructor Destroy; Override;
function HandlesTarget(Target: TObject) : Boolean; Virtual;
procedure UpdateTarget(Target: TObject); Virtual;
procedure ExecuteTarget(Target: TObject); Virtual;
function Execute : Boolean; Dynamic;
procedure RegisterChanges(Value: TBasicActionLink);
procedure UnRegisterChanges(Value: TBasicActionLink);
function Update : Boolean; Virtual;
ActionComponent : TComponent;
OnExecute : TNotifyEvent;
OnUpdate : TNotifyEvent;
end
;
Description
TBasicAction implements a basic action class from which all actions are derived. It introduces all basic methods of an action, and implements functionality to maintain a list of clients, i.e. components that are connected with this action.
Do not create instances of TBasicAction. Instead, create a descendant class and create an instance of this class instead.
Members
| Member | Type | Visibility | Description |
|---|---|---|---|
| ActionComponent | Property | public | Returns the component that initiated the action. |
| Change | Method | protected | Calls the OnChange]() handler. |
| Create | Method | public | Creates a new instance of a TBasicAction class. |
| Destroy | Method | public | Destroys the action. |
| Execute | Method | public | Triggers the OnExecute event |
| ExecuteTarget | Method | public | Executes the action on the Target object |
| FActionComponent | Field | private | |
| FClients | Field | protected | List with components linked to this action. |
| FOnChange | Field | private | |
| FOnExecute | Field | private | |
| FOnUpdate | Field | private | |
| HandlesTarget | Method | public | Determines whether Target can be handled by this action |
| OnChange | Property | protected | Occurs when one of the action's properties changes. |
| OnExecute | Property | public | Event triggered when the action executes. |
| OnUpdate | Property | public | Event triggered when the application is idle. |
| RegisterChanges | Method | public | Registers a new client with the action. |
| SetOnExecute | Method | protected | Assigns an OnExecute event handler |
| UnRegisterChanges | Method | public | Unregisters a client from the list of clients |
| Update | Method | public | Triggers the OnUpdate event |
| UpdateTarget | Method | public | Notify client controls when the action updates itself. |
Inheritance
| Class | Description |
|---|---|
| TBasicAction | Abstract base class for all Actions. |
See also
| Name | Description |
|---|---|
| TBasicActionLink | Link between actions and action clients (e.g. controls) |
| TComponent | Base class for all components that need owner-owned functionality. |
| TComponent | Base class for all components that need owner-owned functionality. |
| TComponent | Base class for all components that need owner-owned functionality. |
| TFPList | Class to manage collections of pointers. |
| TNotifyEvent | Standard event handler type. |
| TNotifyEvent | Standard event handler type. |
| TNotifyEvent | Standard event handler type. |
| TNotifyEvent | Standard event handler type. |
| TNotifyEvent | Standard event handler type. |
| TNotifyEvent | Standard event handler type. |