ViewAction¶
Qualified name: delphifmx.ViewAction
- class ViewAction¶
Bases:
ObjectViewAction
Shows a component stored in the FmxObject property. TViewAction standard action is executed by clients (controls, menu commands, toolbar buttons) linked to this action and it shows the TFmxObject type component stored in the FmxObject property. TViewAction extends TCustomViewAction by redeclaring some public properties and events as having published visibility, which makes them editable in the Object Inspector. The following properties are the most important: Enabled, FmxObject, ImageIndex, SecondaryShortCuts, ShortCut, Text, ShortCut, and Visible. Contrary to ordinary actions (like TAction, TControlAction, TCustomValueRangeAction, and so on) TViewAction, as the TCustomViewAction descendant, does not distribute changes in Visible, Enabled, Checked, GroupIndex, and OnExecute to the linked clients.
Methods
Generates an OnExecute event.
Introduces an interface for invoking an action on a target client component or control.
Provides an opportunity to execute centralized code when an application is idle.
Attributes
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.
Component
Keeps a component that executes an action and whose image becomes visible during the action execution.
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.
Specifies the enabled state for the action.
Keeps an FMX object (of the component) that executes an action and whose image becomes visible during the execution of the action.
GroupIndex
Indicates a group of actions in one action list.
Keeps the integer context ID that identifies the Help topic for the action.
Contains the keyword string that identifies the Help topic for the action.
Keeps whether to use the HelpContext or HelpKeyword property to identify the Help topic.
HideIfUnsupportedInterface
Defines whether the UnSupported action can be visible and accessible.
Hint
Stores the Help hint text.
Stores an index in a list of images.
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.
Callable[[Object, bool], None]:
Callable[[Object, Component], None]:
Owner
Returns the Component Owner
Stores shortcuts (in addition to ShortCut) for triggering the action.
Shortcut that triggers the action.
ShortCutPressed
Specifies that the action is fired by pressing a keyboard key, not by clicking with the mouse.
StatusAction
Stores the status for an input field in an action.
Supported
Defines whether the action can work on the current platform and CPU architecture.
Tag
Stores a NativeInt integral value as a part of a component.
Target
Defines the component for which the action is executed.
Represents the caption of the action.
Defines the set of unsupported CPU architectures.
Defines the set of unsupported OS platforms.
VCLComObject
Represents information used internally by components that support COM.
Stores whether the action representation is visible.
- ActionComponent¶
Indicates the client component that caused this action to execute.
- Enabled¶
Specifies the enabled state for the action. The value of Enabled can be propagated to all client controls and client menu items linked to the action.
- Type:
bool
- Execute()¶
Generates an OnExecute event.
- ExecuteTarget(Target: Object) None ¶
Introduces an interface for invoking an action on a target client component or control. FMX.StdActns.TViewAction.ExecuteTarget inherits from System.Classes.TBasicAction.ExecuteTarget. All content below this line refers to System.Classes.TBasicAction.ExecuteTarget. Introduces an interface for invoking an action on a target client component or control. ExecuteTarget does nothing in TBasicAction. ExecuteTarget was introduced in TBasicAction so that descendants can override it to initiate the action on the target. For example, an edit action that performs copying might copy the contents of an edit control to the clipboard.
- FmxObject¶
Keeps an FMX object (of the component) that executes an action and whose image becomes visible during the execution of the action.
- Type:
- HelpContext¶
Keeps the integer context ID that identifies the Help topic for the action. HelpContext specifies the integer context ID to identify the Help topic to show when invoking Help for the action. The value of HelpContext can be propagated to all client controls and client menu items linked to the action. See also IsHelpLinked. HelpContext is only used when htContext is selected in the HelpType property.
Note: To use Help, you need to enable Help in your application. When your application supports usage of the appropriate Help system, then it can show Help topics from the associated Help file. When a client control has focus and the user presses the F1 key, the control uses the value of the HelpContext property to invoke the online Help that shows the topic with this context ID. The target topic is uniquely identified by a HelpContext context ID value.
- Type:
int
- HelpKeyword¶
Contains the keyword string that identifies the Help topic for the action. The value of HelpKeyword can be propagated to all client controls and client menu items linked to the action. HelpKeyword is only used when htKeyword is selected in the HelpType property.
Note: To use Help, you need to enable Help in your application. When your application supports usage of the appropriate Help system, then it can show Help topics from the associated Help file. When a client control has focus and the user presses the F1 key, the control uses the HelpKeyword property’s value to invoke the online Help showing the topic with this keyword.
- Type:
str
- HelpType¶
Keeps whether to use the HelpContext or HelpKeyword property to identify the Help topic. The value of HelpType can be propagated to all client controls and client menu items linked to the action. HelpType can keep one of the following constants:
htContext instructs to use the HelpContext property to identify the Help topic to show when invoking Help. htKeyword instructs to use the HelpKeyword property to identify the Help topic to show when invoking Help.
- Type:
HelpType
- ImageIndex¶
Stores an index in a list of images. ImageIndex is a zero-based index in a list of images. TContainedAction does not provide the actual list of images, only implementations of actions in GUI application frameworks provide such a property. In general, this list of images contains images that are associated with controls and menu items that use this action. The value of ImageIndex can be propagated to all client controls and client menu items linked to the action.
Note: When ImageIndex is -1, this means that the list does not contain any images. In typical implementations of controls, an image is drawn at the leftmost position in the control, and a control’s text is drawn to the right of the image. If ImageIndex is -1, then a control does not offset the text to the right to reserve a placeholder for the image. Otherwise, if ImageIndex is not -1, then the control’s text is always drawn with the offset to the right to reserve a place for drawing an image.
- Type:
int
- OnBeforeShow¶
Callable[[Object, bool], None]:
- OnCreateComponent¶
Callable[[Object, Component], None]:
- SecondaryShortCuts¶
Stores shortcuts (in addition to ShortCut) for triggering the action. Actions can execute in response to multiple shortcut key combinations. SecondaryShortCuts lists all the shortcut key combinations (other than the one specified by the ShortCut property) that can trigger the action. This lets you provide additional, secondary shortcuts. When the user types one of the key combinations listed in SecondaryShortCuts, the action’s Execute method is called.
- Type:
CustomShortCutList
- ShortCut¶
Shortcut that triggers the action. The value of Shortcut can be propagated to all client controls and client menu items linked to the action.
- Type:
int
- Text¶
Represents the caption of the action. Text holds the string that is used in the same way as the Caption of the action, when it is set. The value of Text is propagated to the action’s clients. Text is the same as Caption. You can use both Text and Caption, but descendant classes should only use the published property Text, so that the Object Inspector displays only the Text property, as in most FireMonkey components. In the Text property you can define an accelerator key. On Windows platforms, an accelerator key is shown as an underlined letter. To specify an accelerator key, precede an <accelerator_letter> with an ampersand & character. The letter after the ampersand appears underlined. For example, to set the S character as an accelerator key for a Save action, type &Save. On Windows platforms, accelerator keys enable the user to activate actions pressing Alt+<accelerator_letter> key combination. To show a single ampersand & character in a Text property specify doubled ampersand && characters. Notice that & and _ are seen and can be used only under Windows.
- Type:
str
- UnsupportedArchitectures¶
Defines the set of unsupported CPU architectures. The TArchitecture type defines the arIntelX86 and arIntelX64 constants that identify the processor architectures Intel x86 and Intel x64. Use UnsupportedArchitectures to identify sets of unsupported processor architectures.
- Type:
Architectures
- UnsupportedPlatforms¶
Defines the set of unsupported OS platforms. The TPlatform type defines the pfWindows, pfMacOS, pfiOS, pfAndroid, and pfLinux constants that identify the Windows, Mac OS, Android, and other platforms. Use UnsupportedPlatforms to identify sets of unsupported OS platforms.
- Type:
Platforms
- Update()¶
Provides an opportunity to execute centralized code when an application is idle.
- Visible¶
Stores whether the action representation is visible. Visible specifies the visible state for the action (True means visible, False means invisible). This Visible value is propagated to a client of the action if IsVisibleLinked method of the action link linking the client to the action returns True. If the Visible of an action is False and IsVisibleLinked of an action link returns True, then the Visible of the client (a control, menu item, or others) is also set False and this client is also invisible. Typically, IsVisibleLinked of an action link returns False if the action belongs to TCustomViewAction. Otherwise, when the action belongs to TAction, then IsVisibleLinked of an action link returns True. That is, TCustomViewAction is used when one need to provide visible representation of clients of actions that have Visible set True.
- Type:
bool