CustomButton¶
Qualified name: delphifmx.CustomButton
- class CustomButton¶
Bases:
PresentedTextControlRepresents the base class for all buttons. TCustomButton is the base class for all button components such as TButton. If you need to create a custom button for your application, then you should consider deriving your component from TCustomButton, as it already implements basic button drawing and operating functionality.
Methods
TStyledControl.ApplyStyleLookup() Gets and applies the style of a TStyledControl.
TStyledControl.Inflate() Call this procedure to get and apply its style lookup.
TStyledControl.NeedStyleLookup() Call this procedure to indicate that this control requires to get and apply its style lookup.
TCustomButton.SetNewScene(AScene: IScene) -> None Sets a new Scene for the current control.
Attributes
AbsoluteClipRectSpecifies the absolute rectangle of the control after all its parent controls clip it.
AbsoluteEnabledSpecifies whether the control is absolutely enabled.
AbsoluteHeightSpecifies the absolute height of the control.
AbsoluteMatrixSpecifies the absolute transformation matrix of the control.
AbsoluteOpacitySpecifies the absolute opacity of the control.
AbsoluteRectSpecifies the absolute rectangle that bounds the control.
AbsoluteScaleSpecifies the absolute scale of the control.
AbsoluteWidthSpecifies the absolute width of the control.
Specifies the action associated with the control.
ActionClientSpecifies 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
AlignSpecifies the alignment options (top, left, client, and so on) of this control.
AnchorsSpecifies how the control is anchored to its parent.
ApplyingEffectA flag that signals when a control is in the process of applying an effect.
AutoCaptureSpecifies whether the control captures mouse events.
Specifies whether the control's text should be translated
AxisAlignedRectA TRectF defined by the width and height of the control.
BoundsRectSpecifies the bounding rectangle of the control.
CanParentFocusSpecifies whether the parent of this control should be evaluated to receive focus.
CanvasProvides the drawing surface of the control.
ChildrenStores an array of children attached to this parent component.
ChildrenCountRead-only property that specifies the number of children in the children list.
ChildrenRectSpecifies the bigger rectangle area occupied by parent and children controls.
ClassNameReturns the TObject.ClassName
ClipChildrenSpecifies if children of the control should be clipped to the control's on-screen region.
ClipParentSpecifies whether the current control has clipped its parent.
ClipRectSpecifies the bound rectangle to be clipped.
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
ControlTypeControlType:
ControlsReturns an iterator over contained controls
ControlsCountReturns the count of contained controls
CursorImage to use to represent the mouse pointer when it passes into the region covered by the control.
DataStores a Tvalue, which is a data structure that can store different kinds of data types.
DefaultSizeEmbarcadero Technologies does not currently have any additional information.
Returns a string with the name of the default style of this control
DefaultTextSettingsStores a TTextSettings type object that keeps the default values of the text representation properties.
DesignInfoContains information used by the Form designer.
DisableDisappearEmbarcadero Technologies does not currently have any additional information.
DisableFocusEffectSpecifies whether the control has the focus effect disabled.
DragModeSpecifies how the control initiates drag-and-drop operations.
EnableDragHighlightSpecifies whether the control is highlighted when the dragged object is over it.
EnabledSpecifies whether the control responds to mouse, keyboard, and timer events.
FixedSizeEmbarcadero Technologies does not currently have any additional information.
FontSpecifies the font to use when displaying the text.
FontColorSpecifies the font color to use when displaying the text.
HasAfterPaintEffectSpecifies whether the control has an effect that is applied after the control is painted.
HasClipParentControl that is a direct child of this control and has clipped this control.
HasDisablePaintEffectSpecifies whether the control's effect is painted.
HasEffectSpecifies whether the control has an applied effect.
HeightHeight specifies the vertical size of the control (in dp).
HelpContextContains the numeric context ID that identifies the Help topic for the control.
HelpKeywordContains the keyword string that identifies the Help topic for the control.
HelpTypeSpecifies whether the control's context-sensitive Help topic is identified by a context ID or by keyword.
HintSpecifies the text string that appears when the user moves the mouse over a control.
HitTestEnables 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.
InPaintToSpecifies whether the control is currently being painted.
IndexSpecifies the index of the child object in the children array attached to this object.
InheritedCursorImage used to represent the mouse pointer when it passes into the region covered by the control.
InvertAbsoluteMatrixSpecifies the inverse matrix of AbsoluteMatrix.
IsDragOverSpecifies whether a dragged object is over the area of the current control.
IsFocusedDetermines whether the control has input focus.
IsInflatedWhether the current style of this control has been actually applied to the control.
IsMouseOverSpecifies whether the mouse cursor is over the control.
Specifies whether the default state of this button is pressed or not.
IsVisibleSpecifies whether the control is visible.
LocalRectSpecifies the local rectangle for painting the control.
LockedSpecifies whether the control is locked at design time.
MarginsAligns the component to the margins points of other components.
Determines whether and how the button closes its (modal) parent form.
ModelDataModel:
NameSpecifies the name of the component as referenced in code.
ObserversIndicates the TObservers object added to the TComponent.
OnGestureCallable[[Object, GestureEventInfo, bool], None]:
OpacitySpecifies the control opacity.
OwnerReturns the Component Owner
PaddingAligns the component to the padding points of other components.
ParentReturns/Sets the Control Visibility
ParentClassStyleLookupNameThe name of the default style of the parent class of this control.
ParentControlSpecifies the parent control of this control.
ParentedRectSpecifies the bounding rectangle of the control within its parent.
ParentedVisibleSpecifies whether all the control's parents are visible.
PopupMenuSpecifies the context (pop-up) menu object.
PositionReturns an access to the position of the control inside its parent
PrefixStyleDetermines whether the ampersand character (&) is considered as a special prefix character.
PresentationObject:
PresentationProxyPresentationProxy:
PresentationStatePresentationState:
PressedIndicates whether the control is currently pressed.
PressedPositionA point that indicates where exactly on the control the click occured.
Specifies whether to automatically repeat the button click after a preset time.
ResultingTextSettingsKeeps final values of text representation properties.
RootSpecifies the root parent of this object.
SceneSpecifies the current scene in which the control is drawn.
ShowHintSpecifies whether the Hint can be shown.
SizeSpecifies the vertical and horizontal size (Size.Height and Size.Width) of the control (in pixels).
Specifies whether this button remains in a pressed state once you click it.
StoredSpecifies whether this object is stored in the .XFM file.
Specifies the name of the resource object to which the current TStyledControl is linked
StyleNameSpecifies the style name for this FMX component.
This property allows you to define the current state of style
StyledSettingsDefines the set of styled text representation properties whose values are loaded from the current style and cannot be changed manually.
StylesDataValue:
TabOrderIndicates the position of the control in its parent's tab order.
TabStopEmbarcadero Technologies does not currently have any additional information.
TagStores a NativeInt integral value as a part of a component.
TagFloatCustom property that stores any floating-point value.
TagObjectCustom property that stores any object value.
TagStringCustom property that stores any string value.
TextSpecifies the text that will be displayed over the surface of this control.
TextAlignSpecifies the horizontal alignment of the text in this control.
TextSettingsKeeps the values of styled text representation properties that are set in the Object Inspector or programmatically.
TouchSpecifies the touch manager component associated with the control.
TouchTargetExpansionSet of optional pixel values you can specify to expand the touch target of a FireMonkey styled control.
TrimmingSpecifies how the text is trimmed when it exceeds the edges of the text area in this control.
UpdateRectSpecifies the rectangle area of the control that needs to be updated.
VCLComObjectRepresents information used internally by components that support COM.
VertTextAlignSpecifies the vertical alignment of the text in this control.
VisibleReturns/Sets the Control Visibility
WidthSpecifies the horizontal size of the control (in pixels).
WordWrapSpecifies whether to wrap the text inside the control when the text length exceeds the text area width.
- 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.
- AutoTranslate¶
Specifies whether the control’s text should be translated
- DefaultStyleLookupName¶
Returns a string with the name of the default style of this control
- 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.
- IsPressed¶
Specifies whether the default state of this button is pressed or not. Set the IsPressed property to True in order to force this button’s default state to be pressed. The button comes back to its initial unpressed state once you click it.
Tip: Setting the IsPressed property only has an effect if the StaysPressed property is set to True.
- Type:
bool
- ModalResult¶
Determines whether and how the button closes its (modal) parent form. Setting the ModalResult property of a button is an easy way to make clicking the button to close the parent modal form. When a button is clicked, the ModalResult property of its parent form is set to the same value as the ModalResult property of a button. For example, if a dialog box has OK and Cancel buttons, their ModalResult properties could be set at design time to mrOk and mrCancel, respectively. At run time, clicking the OK button changes the ModalResult property of the dialog box to mrOk, and clicking the Cancel button changes the ModalResult property of the dialog box to mrCancel. Unless further processing is required, no OnClick event handlers are required for the buttons. The following table lists the constants defined in the System.UITypes unit to be used for the ModalResult property of the TModalResult type.
Constant
Value
Meaning
mrNone
0
None. Used as a default value before the user exits.
mrOk
idOK = 1
The user exited with the OK button.
mrCancel
idCancel = 2
The user exited with the CANCEL button.
mrAbort
idAbort = 3
The user exited with the ABORT button.
mrRetry
idRetry = 4
The user exited with the RETRY button.
mrIgnore
idIgnore = 5
The user exited with the IGNORE button.
mrYes
idYes = 6
The user exited with the YES button.
mrNo
idNo = 7
The user exited with the NO button.
mrClose
idClose = 8
The user exited with the CLOSE button.
mrHelp
idHelp = 9
The user exited with the HELP button.
mrTryAgain
idTryAgain = 10
The user exited with the TRY AGAIN button.
mrContinue
idContinue = 11
The user exited with the CONTINUE button.
mrAll
mrContinue + 1 (12 or $C)
The user exited with the ALL button.
mrNoToAll
mrAll +1 (13 or $D)
The user exited with the NO TO ALL button.
mrYesToAll
mrNoToAll +1 (14 or $E)
The user exited with the YES TO ALL button.
You can check a ModalResult value using the global IsAbortResult, IsAnAllResult, IsNegativeResult, or IsPositiveResult functions, and use the StripAllFromResult function to convert ModalResult values that refer to “ALL” buttons to identifying values corresponding to simple buttons (Ok, No, or Yes).
- Type:
int
- NeedStyleLookup()¶
Call this procedure to indicate that this control requires to get and apply its style lookup.
- RepeatClick¶
Specifies whether to automatically repeat the button click after a preset time. Set the RepeatClick property to True to make the button automatically repeat the clicking event, thus executing its OnClick event cyclically, after a preset time has passed since the last OnClick execution. The timer interval starts with 500 milliseconds for the first wait and then moves to 100 milliseconds per wait cycle. This interval cannot be modified by the user. Each time 100 milliseconds pass, DoRepeatDelayTimer is executed. DoRepeatDelayTimer internally calls the DoRepeatTimer method to perform the button’s OnClick event.
- Type:
bool
- SetNewScene(AScene: IScene) → None¶
Sets a new Scene for the current control. Sets a new Scene for the current control. FMX.StdCtrls.TCustomButton.SetNewScene inherits from FMX.Controls.TControl.SetNewScene. All content below this line refers to FMX.Controls.TControl.SetNewScene. Sets a new Scene for the current control. AScene specifies the new scene. If AScene is empty, SetNewScene does nothing. SetNewScene sets the same scene for the control’s children.
- StaysPressed¶
Specifies whether this button remains in a pressed state once you click it. Set the StaysPressed property to True to force this button to remain in a pressed state once you click it. The button comes back to its initial depressed state once you click it again. If StaysPressed is set to False, then this button behaves like a standard push button that comes back to its initial state once you release the mouse button over its surface.
- Type:
bool
- 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