CustomAction

Qualified name: delphivcl.CustomAction

class CustomAction

Bases: ContainedAction

TCustomAction is the base class for VCL actions intended to be used with menu items and controls. TCustomAction introduces support for the properties, events, and methods of menu items and controls that are clients of action objects. Most properties and events introduced in TCustomAction are public; therefore, use TCustomAction as a base class when deriving your own actions that publish specific subset of properties of associated controls. Action objects centralize the response to user commands (actions) and represent user interface elements in applications that use actions. They provide an easy way to synchronize, for example, the enabled state and caption of a speed button and a menu item, and handle the response when users click these components. Each such component, called the client, has its properties dynamically updated by the action and forwards user actions to the action for a response. At design time, you can work in the Action List editor with actions contained in an action list or in the Action Manager editor of the action manager. The action list or action manager is a container for actions, which it organizes into categories. Component and control public properties and events that are supported in TCustomAction, either directly or through an ancestor, are:

Caption Checked Enabled HelpType HelpContext HelpKeyword Hint ImageIndex ShortCut Visible OnHint OnUpdate OnExecute Because the OnHint, OnUpdate, and OnExecute events are public, they do not appear in the Object Inspector. That is, the Object Inspector does not support generating custom event handlers for these events. TCustomAction can also act as the base class for predefined action classes. You can derive from TCustomAction if you want to retain the public scope of supported properties and events or modify the public scope to the published scope. For predefined actions that augment the behavior of TCustomAction, see the action classes in the Vcl.StdActns, Vcl.DBActns, and Vcl.ExtActns units.

Methods

Execute

Generates an OnExecute event.

Update

Provides an opportunity to execute centralized code when an application is idle.

Attributes

ActionComponent

Indicates the client component that caused this action to execute.

ActionList

Holds the action list to which the action belongs.

AutoCheck

Controls whether the Checked property toggles when the action executes.

Caption

Represents the caption of the action.

Category

Group or category where the action belongs.

Checked

Indicates whether client controls and menu items appear checked.

ClassName

Returns the TObject.ClassName

ComObject

Specifies the interface reference implemented by the component.

ComponentCount

Returns the owned component count

ComponentIndex

Indicates the position of the component in its owner's Components property array.

ComponentState

Describes the current state of the component, indicating when a component needs to avoid certain actions.

ComponentStyle

Governs the behavior of the component.

Components

Returns an iterator over the owned components

DesignInfo

Contains information used by the Form designer.

DisableIfNoHandler

Indicates whether the action's clients should be disabled if no OnExecute event handler is found.

Enabled

Specifies the enabled state for the action.

GroupIndex

Indicates a group of actions in one action list.

HelpContext

Keeps the integer context ID that identifies the Help topic for the action.

HelpKeyword

Contains the keyword string that identifies the Help topic for the action.

HelpType

Keeps whether to use the HelpContext or HelpKeyword property to identify the Help topic.

Hint

Stores the Help hint text.

ImageIndex

Stores an index in a list of images.

ImageName

Displays the name of linked items from the Image Collection.

Images

Embarcadero Technologies does not currently have any additional information.

Index

Specifies the index of the action in its action list.

Name

Specifies the name of the component as referenced in code.

Observers

Indicates the TObservers object added to the TComponent.

Owner

Returns the Component Owner

SecondaryShortCuts

Stores shortcuts (in addition to ShortCut) for triggering the action.

ShortCut

Shortcut that triggers the action.

StatusAction

Stores the status for an input field in an action.

Tag

Stores a NativeInt integral value as a part of a component.

VCLComObject

Represents information used internally by components that support COM.

Visible

Stores whether the action representation is visible.

ActionComponent

Indicates the client component that caused this action to execute.

ActionList

Holds the action list to which the action belongs. Vcl.ActnList.TCustomAction.ActionList inherits from System.Actions.TContainedAction.ActionList. All content below this line refers to System.Actions.TContainedAction.ActionList. Holds the action list to which the action belongs.

Type:

CustomActionList

Execute()

Generates an OnExecute event.

ImageName

Displays the name of linked items from the Image Collection.

Type:

str

Images

Embarcadero Technologies does not currently have any additional information.

Type:

CustomImageList

Update()

Provides an opportunity to execute centralized code when an application is idle.