MenuItem¶
Qualified name: delphifmx.MenuItem
- class MenuItem¶
Bases:
TextControl
Methods
Gets and applies the style of a TStyledControl.
CalcRenderSize determines the render size of this TMenuItem as a TPointF.
Calculates the size of a TMenuItem as a TPointF.
Embarcadero Technologies does not currently have any additional information.
Clears this TMenuItem.
Decides whether the current TMenuItem needs a pop-up menu.
Call this procedure to get and apply its style lookup.
Displays the pop-up menu of the current TMenuItem object, after a short delay.
Call this procedure to indicate that this control requires to get and apply its style lookup.
Creates and displays the TMenuItem's pop-up menu.
Attributes
AbsoluteClipRect
Specifies the absolute rectangle of the control after all its parent controls clip it.
AbsoluteEnabled
Specifies whether the control is absolutely enabled.
AbsoluteHeight
Specifies the absolute height of the control.
AbsoluteMatrix
Specifies the absolute transformation matrix of the control.
AbsoluteOpacity
Specifies the absolute opacity of the control.
AbsoluteRect
Specifies the absolute rectangle that bounds the control.
AbsoluteScale
Specifies the absolute scale of the control.
AbsoluteWidth
Specifies the absolute width of the control.
Specifies the action associated with the control.
ActionClient
Specifies whether the component object has an associated action.
Updates the width and height of this control according to its current style
Determines if and how the width and height of this control should be modified to take the fixed space dictated by the style of this control
Align
Specifies the alignment options (top, left, client, and so on) of this control.
Anchors
Specifies how the control is anchored to its parent.
ApplyingEffect
A flag that signals when a control is in the process of applying an effect.
AutoCapture
Specifies whether the control captures mouse events.
Controls whether the IsChecked property toggles when the TMenuItem is clicked.
Specifies whether the control's text should be translated
AxisAlignedRect
A TRectF defined by the width and height of the control.
A bitmap that is drawn on the TMenuItem menu item.
BoundsRect
Specifies the bounding rectangle of the control.
CanParentFocus
Specifies whether the parent of this control should be evaluated to receive focus.
Canvas
Provides the drawing surface of the control.
Children
Stores an array of children attached to this parent component.
ChildrenCount
Read-only property that specifies the number of children in the children list.
ChildrenRect
Specifies the bigger rectangle area occupied by parent and children controls.
ClassName
Returns the TObject.ClassName
ClipChildren
Specifies if children of the control should be clipped to the control's on-screen region.
ClipParent
Specifies whether the current control has clipped its parent.
ClipRect
Specifies the bound rectangle to be clipped.
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
Controls
Returns an iterator over contained controls
ControlsCount
Returns the count of contained controls
Cursor
Image to use to represent the mouse pointer when it passes into the region covered by the control.
Data
Stores a Tvalue, which is a data structure that can store different kinds of data types.
DefaultSize
Embarcadero Technologies does not currently have any additional information.
Returns a string with the name of the default style of this control
DefaultTextSettings
Stores a TTextSettings type object keeping the default values of the text representation properties.
DesignInfo
Contains information used by the Form designer.
DisableDisappear
Embarcadero Technologies does not currently have any additional information.
DisableFocusEffect
Specifies whether the control has the focus effect disabled.
DragMode
Specifies how the control initiates drag-and-drop operations.
EnableDragHighlight
Specifies whether the control is highlighted when the dragged object is over it.
Specifies whether the control responds to mouse, keyboard, and timer events.
FixedSize
Embarcadero Technologies does not currently have any additional information.
Font
Specifies the font to use when rendering the text.
FontColor
Specifies the font color of the text in this TTextControl control.
Identifies the group of TMenuItems to which this TMenuItem belongs.
HasAfterPaintEffect
Specifies whether the control has an effect that is applied after the control is painted.
HasClipParent
Control that is a direct child of this control and has clipped this control.
HasDisablePaintEffect
Specifies whether the control's effect is painted.
HasEffect
Specifies whether the control has an applied effect.
Height
Height specifies the vertical size of the control (in dp).
HelpContext
Contains the numeric context ID that identifies the Help topic for the control.
HelpKeyword
Contains the keyword string that identifies the Help topic for the control.
HelpType
Specifies whether the control's context-sensitive Help topic is identified by a context ID or by keyword.
Hint
Specifies the text string that appears when the user moves the mouse over a control.
HitTest
Enables the control to capture mouse events.
Defines the zero-based index enumerating images in the Images list of images.
Defines the reference to a TCustomImageList list of images to be used to draw images on the component.
InPaintTo
Specifies whether the control is currently being painted.
Index
Specifies the index of the child object in the children array attached to this object.
InheritedCursor
Image used to represent the mouse pointer when it passes into the region covered by the control.
InvertAbsoluteMatrix
Specifies the inverse matrix of AbsoluteMatrix.
Specifies whether a check mark is displayed beside the text of the TMenuItem.
IsDragOver
Specifies whether a dragged object is over the area of the current control.
IsFocused
Determines whether the control has input focus.
IsInflated
Whether the current style of this control has been actually applied to the control.
IsMouseOver
Specifies whether the mouse cursor is over the control.
Specifies whether the TMenuItem is selected.
Embarcadero Technologies does not currently have any additional information.
IsVisible
Specifies whether the control is visible.
MenuItem:
Represents the number of child TMenuItems of this menu item.
LocalRect
Specifies the local rectangle for painting the control.
Specifies whether the control is locked at design time.
It returns the main menu to which the menu item is attached.
Aligns the component to the margins points of other components.
Name
Specifies the name of the component as referenced in code.
Observers
Indicates the TObservers object added to the TComponent.
OnGesture
Callable[[Object, GestureEventInfo, bool], None]:
Specifies the control opacity.
Owner
Returns the Component Owner
Aligns the component to the padding points of other components.
Parent
Returns/Sets the Control Visibility
ParentClassStyleLookupName
The name of the default style of the parent class of this control.
ParentControl
Specifies the parent control of this control.
It returns the parent menu item.
ParentedRect
Specifies the bounding rectangle of the control within its parent.
ParentedVisible
Specifies whether all the control's parents are visible.
Specifies the context (pop-up) menu object.
Position
Returns an access to the position of the control inside its parent
PrefixStyle
Determines whether the ampersand character (&) is considered as a special prefix character.
Pressed
Indicates whether the control is currently pressed.
PressedPosition
A point that indicates where exactly on the control the click occured.
Specifies whether the TMenuItem is mutually exclusive with other menu items in its group.
ResultingTextSettings
Keeps final values of text representation properties.
Root
Specifies the root parent of this object.
Scene
Specifies the current scene in which the control is drawn.
Shortcut that opens the menu item.
ShowHint
Specifies whether the Hint can be shown.
Size
Specifies the vertical and horizontal size (Size.Height and Size.Width) of the control (in pixels).
Stored
Specifies whether this object is stored in the .XFM file.
Specifies the name of the resource object to which the current TStyledControl is linked
StyleName
Specifies the style name for this FMX component.
This property allows you to define the current state of style
StyledSettings
Defines the set of styled text representation properties whose values are loaded from the current style and cannot be changed manually.
StylesData
Value:
TabOrder
Indicates the position of the control in its parent's tab order.
TabStop
Embarcadero Technologies does not currently have any additional information.
Tag
Stores a NativeInt integral value as a part of a component.
TagFloat
Custom property that stores any floating-point value.
TagObject
Custom property that stores any object value.
TagString
Custom property that stores any string value.
Specifies the text that will be rendered over the surface of this TTextControl object.
TextAlign
Specifies how the text will be displayed in terms of horizontal alignment.
TextSettings
Keeps the values of styled text representation properties that are set in the Object Inspector or programmatically.
Touch
Specifies the touch manager component associated with the control.
Set of optional pixel values you can specify to expand the touch target of a FireMonkey styled control.
Trimming
Specifies the behavior of the text, when it overflows the area for drawing the text.
UpdateRect
Specifies the rectangle area of the control that needs to be updated.
VCLComObject
Represents information used internally by components that support COM.
VertTextAlign
Specifies how the text will be displayed in terms of vertical alignment.
For internal use.
Specifies whether the component appears onscreen.
Width
Specifies the horizontal size of the control (in pixels).
WordWrap
Specifies whether the text inside the TTextControl object wraps when it is longer than the width of the control.
- Action¶
Specifies the action associated with the control. Action allows an application to centralize the response to user commands. When a control is associated with an action, the action determines the appropriate properties and events of the control (such as whether the control is enabled or how it responds to an OnClick event). If an object of the descendant from the TFmxObject class does not support actions, and when this object tries to assign a value to the Action property, the setter method for Action calls GetActionLinkClass that should return nil. In this case, attempting to set a value to the Action property raises the following exception:
StrEActionNoSuported = ‘Class %s does not support the action’
- Type:
- AdjustSizeValue¶
Updates the width and height of this control according to its current style
- AdjustType¶
Determines if and how the width and height of this control should be modified to take the fixed space dictated by the style of this control
- ApplyStyleLookup()¶
Gets and applies the style of a TStyledControl.
- AutoCheck¶
Controls whether the IsChecked property toggles when the TMenuItem is clicked. Set the AutoCheck property to True if the toggling of the IsChecked property is desired when the TMenuItem is clicked, and to False otherwise.
- Type:
bool
- AutoTranslate¶
Specifies whether the control’s text should be translated
- Bitmap¶
A bitmap that is drawn on the TMenuItem menu item. Use Bitmap to provide a custom image that appears next to the text of the TMenuItem. Bitmap is an obsolete feature. We recommend to show images stored in a centralized collection of images. Such image is specified with the ImageIndex property from the image list specified with Images. If an image specified with ImageIndex and Images is not empty, the TMenuItem object shows this image. Otherwise, the TMenuItem object shows the image specified in Bitmap.
- Type:
Bitmap
- CalcRenderSize()¶
CalcRenderSize determines the render size of this TMenuItem as a TPointF.
- CalcSize()¶
Calculates the size of a TMenuItem as a TPointF. Use CalcSize to determine the size of a TMenuItem object as a TPointF.
Note: The Y value of the TPointF returned is 8 for a separator, and 23 for a regular TMenuItem.
- CanBeClicked()¶
Embarcadero Technologies does not currently have any additional information.
- Clear()¶
Clears this TMenuItem. Clear removes all the children menu items of this menu item.
- DefaultStyleLookupName¶
Returns a string with the name of the default style of this control
- Enabled¶
Specifies whether the control responds to mouse, keyboard, and timer events. Use Enabled to change the availability of the control to the user. To disable a control, set Enabled to False. Some disabled controls appear dimmed (for example: buttons, check boxes, labels), while others (container controls) simply lose their functionality without changing their appearance. If Enabled is set to False, the control ignores mouse, keyboard, and timer events. To re-enable a control, set Enabled to True. This property applies to all TControl descendants.
- Type:
bool
- GroupIndex¶
Identifies the group of TMenuItems to which this TMenuItem belongs. A group of TMenuItems represents a set of TMenuItem objects belonging to the same pop-up menu, out of which only one TMenuItem, having the RadioItem property set to True, can be selected.
Note: TMenuItems belonging to different pop-up menus (that do not have the same value for the Parent property) can be simultaneously selected, even if their RadioItem property is True. Note: By default, all TMenuItems belonging to the same pop-up menu have the same value for the GroupIndex property.
- Type:
int
- HavePopup()¶
Decides whether the current TMenuItem needs a pop-up menu. A TMenuItem object needs a pop-up menu if at least one of the object’s children is a TMenuItem.
- ImageIndex¶
Defines the zero-based index enumerating images in the Images list of images. If you use a non-existing ImageIndex value to access an image in the Images list, then no image is retrieved and no exception is raised. The usual default value is -1. Call ImagesChanged when ImageIndex is changed.
- Type:
int
- Images¶
Defines the reference to a TCustomImageList list of images to be used to draw images on the component. If the TCustomImageList list is empty, then Images is nil/null. Call ImagesChanged when Images is changed.
- Type:
CustomImageList
- Inflate()¶
Call this procedure to get and apply its style lookup.
- IsChecked¶
Specifies whether a check mark is displayed beside the text of the TMenuItem. Use IsChecked to allow the TMenuItem to work like a check box. The menu item appears selected if IsChecked is True, and cleared otherwise.
Note: If AutoCheck is False, the menu item remains cleared even if IsChecked is True.
- Type:
bool
- IsSelected¶
Specifies whether the TMenuItem is selected. IsSelected is True if the TMenuItem is selected, and False otherwise.
- Type:
bool
- IsSeparator¶
Embarcadero Technologies does not currently have any additional information.
- Type:
bool
- Items¶
MenuItem:
- ItemsCount¶
Represents the number of child TMenuItems of this menu item.
- Type:
int
- Locked¶
Specifies whether the control is locked at design time. A locked control prohibits to move the control at design time, all the other properties can be modified at design time. To lock the control, set Locked to True. By default, Locked is False, and the control can be modified at design time.
- Type:
bool
- Margins¶
Aligns the component to the margins points of other components. The Margins of a control are the distances (in pixels) from each edge (top, left, bottom, right) to another control within the same Parent or to the edge of its Parent. The Margins add space to the outer side of the control. It only applies for controls that do not use TAlignLayout None and the components are located to each other. If a margin is not 0, no other control will come closer to the control than the specified distance. If the distance from a Parent edge to the corresponding control edge is smaller than the specified Margins for that edge, the control is repositioned and resized, if necessary, to maintain the specified distance. If the Margins control has zero values, RAD Studio uses the default values (Left=4, Top=4, Right=4, Bottom=4). You can also set your own Margins values. It only applies to the IDE control’s guidelines, when you are dragging control. But if you use Align=Client (for example), it will use the specified values in Margins. The following image shows how Padding and Margins properties affect alignment, position, and size of controls.
- Type:
- NeedPopup()¶
Displays the pop-up menu of the current TMenuItem object, after a short delay. Use NeedPopup to display the pop-up menu of the current TMenuItem object, after a short delay.
- NeedStyleLookup()¶
Call this procedure to indicate that this control requires to get and apply its style lookup.
- Opacity¶
Specifies the control opacity. Set Opacity to customize the transparency of the current control. Opacity takes values between 0 and 1. If Opacity is 1, the control is completely opaque; if it is 0, the control is completely transparent. The values over 1 are treated as 1, and the ones under 0 are treated as 0. Opacity applies to the control’s children.
- Type:
float
- Padding¶
Aligns the component to the padding points of other components. The Padding of a control specifies how close, in pixels, the control’s children can come to each of its edges (top, left, bottom, right). Padding adds space to the inner side of the control. The control’s children are repositioned and resized, if necessary, to maintain the Padding. If the Padding control has zero values, RAD Studio uses the default values (Left=4, Top=4, Right=4, Bottom=4). You can also set your own Padding values. The following image shows how Padding and Margins properties affect alignment, position, and size of controls.
Note: Padding constraints do not work for TScrollBox, TListBox, TTreeView, and TGrid based controls.
- Type:
- Popup()¶
Creates and displays the TMenuItem’s pop-up menu. Popup creates and displays a pop-up menu containing all the visible TMenuItem children of the current object.
Note: The TMenuItem children for which the Visible property is False are not displayed.
- PopupMenu¶
Specifies the context (pop-up) menu object. Use PopupMenu to set the context menu of the current control. The pop-up window is displayed when ShowContextMenu is called.
- Type:
- RadioItem¶
Specifies whether the TMenuItem is mutually exclusive with other menu items in its group. Use RadioItem to make the menu item behave like a radio button with a group of other menu items. The group of menu items is the set of all menu items in a pop-up menu that have the same value of GroupIndex. When RadioItem is True, only one menu item in the group that contains the menu item can be selected at a time. The single selected menu item in the group is indicated by a check mark beside its text.
Note: RadioItem does not work for the top-level items in a main menu.
- Type:
bool
- ShortCut¶
Shortcut that opens the menu item.
- Type:
int
- StyleLookup¶
Specifies the name of the resource object to which the current TStyledControl is linked
- StyleState¶
This property allows you to define the current state of style
- Text¶
Specifies the text that will be rendered over the surface of this TTextControl object. Set the Text property to specify the text that will be displayed by this TTextControl. Text can be any string. If there are any effects already applied before changing the Text property, they will be preserved for the new text. Also, the surface of this TTextControl is repainted. 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 button, type &Save. On Windows platforms, accelerator keys enable the user to access controls pressing Alt+<accelerator_letter> key combination. When run on not Windows platforms, a single ampersand is simply stripped from the text. To show a single ampersand & character in a Text property specify doubled ampersand && characters.
Tip: If you specify a new text string that is exactly the same as the one already displayed, the effects will not be re-updated and this TTextControl object will not be repainted. Note: FMX.ExtCtrls.TPopupBox.Text is not a writable property in the same way as FMX.Controls.TTextControl.Text. The FMX.ExtCtrls.TPopupBox.Text property cannot be “any string”, but instead must be just one of the strings in the FMX.ExtCtrls.TPopupBox.Items property and, in this case, FMX.ExtCtrls.TPopupBox.ItemIndex is updated accordingly.
- Type:
str
- TouchTargetExpansion¶
Set of optional pixel values you can specify to expand the touch target of a FireMonkey styled control. FMX.Controls.TControl.TouchTargetExpansion is a published property of all FireMonkey styled controls that support Touch. Defined as an FMX.Types.TBounds, TouchTargetExpansion takes four optional parameters representing the expansion of the four sides of the control in pixels (Bottom, Left, Right, Top). Each parameter specifies the size of an additional screen area that is to be treated as part of the touch target of the control. The following figure illustrates how TouchTargetExpansion expands the touch target for a FireMonkey control:
- Type:
- View¶
For internal use. Do not use this property. It is for internal use.
- Type:
IMenuView
- Visible¶
Specifies whether the component appears onscreen. Use the Visible property to control the visibility of the control at run time. If Visible is True, the control appears. If Visible is False, the control is not visible.
- Type:
bool