Defines classes for Actions and Lists of actions to be used with LCL components TContainedAction - parent class for TCustomAction; defines some properties especially relationships with parents If you call Destroy for an object witch hasn´t being initialized yet it will generate an error. Always use the Free method to deallocate objects, because it verifies if object variable doesn´t contain the value nil. Take the following precautions when creating your own Destroy method: * Declare Destroy with the override directive, because it is a virtual method. * Always call 'inherited Destroy;' as the last thing on the destructor code. * An exception may be raised on the constructor in case there is not enought memory to create an object, or something else goes wrong. If the exception is not handled inside the constructor, the object will be only partially built. In this case Destroy will be called, so your destructor must check if the resources were really allocated before disposing of them. * Remember to call Free for all objects created on the constructor. The ActionList in which this action is contained The Index of this action in the list of actions The Category of this action TCustomActionList - the ancestor class for TActionList

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.

AddAction - adds an action to the list RemoveAction - removes an action from the list Change the action SetImages - stores a list of images OnChange - event handler for a change in the action OnExecute - event handler for execution of the action OnUpdate - event handler for updating the action Create - constructor for TCustomActionList: calls inherited Create then initialises some local variables Destroy sends a opRemove notification to all components in the free-notification list. After that, all owned components are destroyed by calling DestroyComponents (and hence removed from the list of owned components). When this is done, the component removes itself from its owner's child component list. After that, the parent's destroy method is called. Destroy - destructor for TCustomActionList: frees various links then calls inherited Destroy ExecuteAction checks whether Action handles the current component, and if yes, calls the ExecuteAction method, passing itself as a parameter. The function returns True if the action handles the current component. UpdateAction checks whether Action handles the current component, and if yes, calls the UpdateTarget method, passing itself as a parameter. The function returns True if the action handles the current component. The Index value of the name of this action in the ActionList Returns an action identified by its name (as a string) The indexed list of actions The total number of actions in the actionlist The Images from an ImageList to be associated with the actions, eg in a Menu display State of the action : Normal, Suspended or SuspendedEnabled TActionList - The basic actions list class

TActionList - The basic actions list class

TActionList is the last component on the "Standard" component pallete on the Lazarus IDE.

To use an ActionList, click on the icon on the IDE Standard Components toolbar, then click anywhere on the main form and an ActionList icon will appear. It doesn't matter where you position it, because it is not visible at run-time.

You can add, remove or modify actions on the list by right-clicking on the ActionList icon on the form editor and then choosing "Edit action list...", or by double-clicking on the icon with the left mouse button. This will open the "Action List Editor".

You can now use the "+" and "-" buttons to add and remove actions. The ActionList editor menu allows you to select standard actions from a selection (option 'New Standard Action') or create a new action (option 'New Action'). To edit an action, click it and then open the object inspector. To add code to be executed when an action is triggered, double-click the action's name on the "Action List Editor".

The TActionList Class introduces very few properties of its own, but inherits a lot from its ancestor, TCustomActionList, and related components TAction, TCustomAction, TContainedAction and TBasicAction

Each entry in the ActionList appears in the Object Inspector as an instance of TAction, and its properties are accessible and modifiable from the Object Inspector

TShortCutList - a list of shortcuts for actions in an ActionList Add a shortcut to the list; implements the function The index number of the shortcut in the list The indexed list of short cuts TCustomAction is the ancestor class for TAction

TCustomAction is a generic class for all components that represent actions that can be be set on the user interface for buttons and other controls. TCustomAction is the ancestor for TAction. If you want to define your own action class, you should derive it from this class.

You can assign a action to a component by using the Object Inspector.

AssignTo is the generic function to assign the class' contents to another class. This method must be overridden by descendent classes to actually assign the content of the source instance to the destination instance.

The implementation of Assignto raises an EConvertError exception. This is done for the following reason: If the source class doesn't know how to assign itself to the destination class (using AssignTo), the destination class may know how get the data from the source class (using Assign). If all descendent methods are implemented correctly, then if neither of the two classes knows how to assign their contents to each other, execution will end up at , which will simply execute

Dest.AssignTo(Self);

If neither of the classes knows how to assign to/from each other, then execution will end up at the TPersistent implementation of AssignTo, and an exception will be raised.

HandleShortCut - returns True if there is a short cut associated with the handle SavedEnabledState - if True, the Enabled state has been saved Create - constructor for TCustomAction: calls inherited Create then initialises some local variables Destroy - destructor for TCustomAction: frees various lists and images, then calls inherited Destroy DoHint - method for displaying the hint contained in HintStr if True value is returned True if hint is to be displayed HintStr - the text-string for display as a hint True if action is to be performed AutoCheck - whether the control (eg a CheckBox) is to be automatically checked The Caption to be used if this action is associated with a visible component Whether the CheckBox associated with the action is Checked (default False) DisableIfNoHandler - don't use this action if no Handler has been provided Enabled - whether this action is able to be used (default True) GroupIndex - Index of the action within its group HelpContext - the index for a context-based help message HelpKeyWord - the keyword of a context-based help message HelpType - the sort of help message to be offered: default Context-based Hint - a pop-up message that appears when the mouse hovers over an object ImageIndex - the index number of the image to be associated with this action ShortCut - an index to a shortcut list SecondaryShortCuts - a stringlist containing shortcuts Visible - is this action visible? (default True) OnHint - action to be taken when a hint is required TAction is the basic action object used on the LCL.

TAction is the basic action object used on the LCL.

It redeclares many properties inherited from TCustomAction on the public section, but does not add any new features. For more details look at the See Also section for TCustomAction.

The properties of each Action can be modified at design time in the Object Inspector

OnExecute is the event triggered when the action is activated (executed). The event is triggered e.g. when the user clicks e.g. on a menu item or a button associated to the action. The application programmer should provide a OnExecute event handler to execute whatever code is necessary when the button is pressed or the menu item is chosen.

Note that assigning an OnExecute handler will result in the Execute method returning a True value. Predefined actions (such as dataset actions) will check the result of Execute and will not perform their normal task if the OnExecute handler was called.

OnUpdate is the event triggered when the application is idle, and the action is being updated. The OnUpdate event can be used to set the state of the action, for instance disable it if the action cannot be executed at this point in time. A link between an action and a client class The class definition includes a number of protected procedures for setting properties for the action (as defined in ), and a number of public boolean functions to indicate which part of the action is linked to the client SetAutoCheck - specifies the value of AutoCheck, whether True or False SetCaption - specifies the string to be used as caption SetChecked - specifies the value of the Checked property: True or False SetEnabled - specifies the value of the Enabled property: True or False SetGroupIndex - specifies the value for the Group Index SetHelpContext - specifies the value to be used for context-sensitive Help SetHelpKeyword - specifies the keyword to be used for Help SetHelpType - specifies the trpe of Help to be used SetHint - specifies the string to be used for Hints SetImageIndex - specifies the index value for the image associated with the action SetShortCut - specifies the shortcut for the action SetVisible - specifies whether or not the control for the action is Visible Is the action's Caption linked to the client? Is the action's Checked property linked to the client? Is the action's Enabled property linked to the client? Is the action's GroupIndex property linked to the client? Is the action's HelpContext property linked to the client? Is the action's Help property linked to the client? Is the action's Hint property linked to the client? Is the action's ImageIndex property linked to the client? Is the action's ShortCut property linked to the client? Is the action's Visible property linked to the client? TActionLinkClass - class of TActionLink This action is associated with a shortcut