[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'ActnList' (#lcl)

# TCustomActionList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TCustomActionList - the ancestor class for TActionList.

## Declaration

Source position: actnlist.pas line 76

`type TCustomActionList = class(TLCLComponent)`
`protected`
`procedure AddAction(); virtual;` |  | Adds the specified action to the action list.
`procedure RemoveAction(); virtual;` |  | Removes the specified action from the action list.
`procedure Change; virtual;` |  | Performs action needed when the action list or one of its Actions has been changed.
`procedure GetChildren(); override;` |  | Executes the specified procedure for each of the children in Actions.
`procedure Notification(); override;` |  | Handles the notification performed when a component is added to or removed from the class instance.
`procedure SetChildOrder(); override;` |  | Set the order for the specified child (Action).
`procedure SetImages(); virtual;` |  | Sets the value for the Images property.
`property OnChange: TNotifyEvent; [rw]` |  | Event handler signalled when the action list has been changed.
`property OnExecute: TActionEvent; [rw]` |  | OnExecute - event handler for execution of the action.
`property OnUpdate: TActionEvent; [rw]` |  | OnUpdate - event handler for updating the action.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`destructor Destroy; override;` |  | Destructor for the class instance.
`function ActionByName();` |  | Returns an action identified by its name.
`function ExecuteAction(); override;` |  | Examines and executes the specified Action.
`function GetEnumerator;` |  | Gets an enumerator for actions in the action list.
`function IndexOfName();` |  | Gets the ordinal position for the action with the specified name.
`function IsShortCut();` |  | Indicates whether the specified message contains a shortcut (accelerator key) for an action in the list.
`function UpdateAction(); override;` |  | Examines and updates the target for the specified Action.
`property Actions []: TContainedAction; default; [rw]` |  | Provides indexed access to actions in the list by their ordinal position.
`property ActionCount: Integer; [r]` |  | The total number of actions in the action list.
`property Images: TCustomImageList; [rw]` |  | Image list with images for the actions in the list.
`property State: TActionListState; [rw]` |  | State for the action: Normal, Suspended or SuspendedEnabled.
`end;`

## Inheritance

`TCustomActionList` |  | TCustomActionList - the ancestor class for TActionList.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

TCustomActionList - the ancestor class for TActionList. If you want to define your own action list class, you should derive it from this class.

TActionList, TAction, TActionLink and TContainedAction are used to centralize the implementation of user commands, and can then be linked to the appropriate button, menu or another component. This is an Object-Oriented programming strategy to reuse the code, as opposed to the Event-Oriented approach of writing an OnClick event for each component.

## See also

TActionList |  | TActionList - The basic actions list class.