CustomAction¶
Qualified name: delphivcl.CustomAction
- class CustomAction¶
Bases:
ContainedActionTCustomAction 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
TBasicAction.Execute() Generates an OnExecute event.
TBasicAction.Update() Provides an opportunity to execute centralized code when an application is idle.
Attributes
Indicates the client component that caused this action to execute.
Holds the action list to which the action belongs.
AutoCheckControls whether the Checked property toggles when the action executes.
CaptionRepresents the caption of the action.
CategoryGroup or category where the action belongs.
CheckedIndicates whether client controls and menu items appear checked.
ClassNameReturns the TObject.ClassName
ComObjectSpecifies the interface reference implemented by the component.
ComponentCountReturns the owned component count
ComponentIndexIndicates the position of the component in its owner's Components property array.
ComponentStateDescribes the current state of the component, indicating when a component needs to avoid certain actions.
ComponentStyleGoverns the behavior of the component.
ComponentsReturns an iterator over the owned components
DesignInfoContains information used by the Form designer.
DisableIfNoHandlerIndicates whether the action's clients should be disabled if no OnExecute event handler is found.
EnabledSpecifies the enabled state for the action.
GroupIndexIndicates a group of actions in one action list.
HelpContextKeeps the integer context ID that identifies the Help topic for the action.
HelpKeywordContains the keyword string that identifies the Help topic for the action.
HelpTypeKeeps whether to use the HelpContext or HelpKeyword property to identify the Help topic.
HintStores the Help hint text.
ImageIndexStores an index in a list of images.
Displays the name of linked items from the Image Collection.
Embarcadero Technologies does not currently have any additional information.
IndexSpecifies the index of the action in its action list.
NameSpecifies the name of the component as referenced in code.
ObserversIndicates the TObservers object added to the TComponent.
OwnerReturns the Component Owner
SecondaryShortCutsStores shortcuts (in addition to ShortCut) for triggering the action.
ShortCutShortcut that triggers the action.
StatusActionStores the status for an input field in an action.
TagStores a NativeInt integral value as a part of a component.
VCLComObjectRepresents information used internally by components that support COM.
VisibleStores 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:
- 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.