[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Buttons' (#lcl)

TCustomSpeedButton

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

The ancestor for the TSpeedButton class.

Declaration

Source position: buttons.pp line 321

type TCustomSpeedButton = class(TGraphicControl)

protected

  FState: TButtonState;

  

Internal member used to store the TButtonState for the control.

  class procedure WSRegisterClass; override;

  

Registers this component class with the current WidgetSet.

  function ButtonGlyph;

  

Gets the TButtonGlyph used for the control.

  function GetNumGlyphs;

  

Gets the value for the NumGlyphs property.

  procedure GlyphChanged(); virtual;

  

Performs actions needed when the value in the Glyph property has been changed.

  function DialogChar(); override;

  

Performs actions needed to handle an accelerator key for the control.

  procedure CalculatePreferredSize(); override;

  

Calculates the default height and Width required for the control.

  procedure MeasureDraw();

  

Calculates the Width, Height, and layout for the speed button and optionally renders the control.

  procedure MouseEnter; override;

  

Signals the OnMouseEnter event handler (when assigned).

  procedure MouseLeave; override;

  

Signals the OnMouseLeave event handler (when assigned).

  procedure MouseDown(); override;

  

Performs actions needed for a mouse down event on the control.

  procedure MouseMove(); override;

  

Performs actions needed for a mouse move message received for the control.

  procedure MouseUp(); override;

  

Signals the OnMouseUp handler.

  procedure Notification(); override;

  

Performs actions needed when a sub-component is added or removed for the control.

  procedure Paint; override;

  

Updates the state for the control, and paints it to the control Canvas.

  procedure PaintBackground(); virtual;

  

Paints the background for the control to the specified rectangle.

  procedure SetDown();

  

Sets the value for the Down property.

  procedure SetGroupIndex();

  

Sets the value for the GroupIndex property.

  procedure SetFlat();

  

Sets the value for the Flat property.

  procedure SetMargin();

  

Sets the value for the Margin property.

  procedure SetNumGlyphs();

  

Sets the value for the NumGlyphs property.

  procedure SetSpacing();

  

Sets the value for the Spacing property.

  procedure RealSetText(); override;

  

Sets the value for the Caption property.

  procedure UpdateState(); virtual;

  

Updates internal members used to track state changes in the control.

  function GetDrawDetails; virtual;

  

Gets the theme element details used to draw the control.

  property MouseInControl: Boolean; [r]

  

Returns True if the mouse pointer is in the display area for the control.

  procedure ActionChange(); override;

  

Performs action when a new value is assigned to the Action property for the control.

  function GetActionLinkClass; override;

  

The default ActionLink class (TControlActionLink).

  class function GetControlClassDefaultSize; override;

  

Returns the default dimensions for new instances of the class.

  procedure Loaded; override;

  

Performs actions needed when LCL component streaming is completed for the control.

  function GetGlyphSize(); virtual;

  

Gets the size of the glyph within the specified PaintRect.

  function GetTextSize(); virtual;

  

Gets the size of the Caption text within the specified PaintRect.

  function DrawGlyph(); virtual;

  

Draws the glyph image on the canvas at a given offset in the specified client rectangle.

public

  constructor Create(); override;

  

Create - constructor for TCustomSpeedButton: calls inherited Create and initializes many defaults and properties.

  destructor Destroy; override;

  

Destroy - destructor for TCustomSpeedButton: frees Glyph then calls inherited Destroy.

  function FindDownButton;

  

Gets the speed button with the same GroupIndex that has its Down property set.

  procedure Click; override;

  

Signals OnClick and/or executes the ActionLink when the control has been clicked.

  procedure LoadGlyphFromResourceName();

  

Loads the image for the Glyph with the specified name from a resource instance.

  procedure LoadGlyphFromLazarusResource();

  

LoadGlyphFromLazarusResource - method for loading a glyph from a Lazarus Resource file (.lrs).

  property Alignment: TAlignment; [rw]

  

Horizontal alignment for the text displayed on the button control.

  property AllowAllUp: Boolean; [rw]

  

Indicates if all buttons in a group can be in an up state.

  property Color: TColor;

  

The background color for the control.

  property DisabledImageIndex: TImageIndex; [rw]

  

Ordinal position for the image displayed when the control is disabled.

  property Down: Boolean; [rw]

  

Indicates if the button has been set to the Down state.

  property Flat: Boolean; [rw]

  

Indicates whether the button is displayed with a Flat (non-relief) appearance.

  property Glyph: TBitmap; [rws]

  

The bitmap with the glyph image(s) displayed for button states.

  property GroupIndex: Integer; [rw]

  

Identifies the group to which the speed button control belongs.

  property HotImageIndex: TImageIndex; [rw]

  

Ordinal position for the glyph bitmap displayed when the mouse is hovered over the button control.

  property Images: TCustomImageList; [rw]

  

List of images available for use as state glyphs on the control.

  property ImageIndex: TImageIndex; [rw]

  

Ordinal position for the glyph bitmap displayed when the button is in its up state.

  property ImageWidth: Integer; [rw]

  

Width for the glyph bitmap displayed on the control.

  property Layout: TButtonLayout; [rw]

  

Indicates the alignment of the glyph bitmap relative to the caption for the control.

  property Margin: Integer; [rw]

  

Space between the glyph bitmap and the aligned edge in the button layout.

  property NumGlyphs: Integer; [rw]

  

The number of glyph bitmaps available for the control.

  property PressedImageIndex: TImageIndex; [rw]

  

Ordinal position for the glyph bitmap displayed when the button is in a pressed (down) state.

  property SelectedImageIndex: TImageIndex; [rw]

  

Ordinal position for the glyph bitmap displayed when the button is selected.

  property ShowAccelChar: Boolean; [rw]

  

Indicates if the accelerator key (shortcut) is displayed in the Caption for the control.

  property ShowCaption: Boolean; [rw]

  

Indicates if the Caption for the speed button is displayed.

  property Spacing: Integer; [rw]

  

Spacing between the Glyph bitmap and the Caption for the control.

  property Transparent: Boolean; [rw]

  

Indicates if the control is drawn with transparency.

end;

Inheritance

TCustomSpeedButton

  

The ancestor for the TSpeedButton class.

|

TGraphicControl

  

TGraphicControl is the base class for all lightweight controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components which have an associated widget.

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent,IFPObserved

|

TObject

Description

TCustomSpeedButton is a TGraphicControl descendant, and the ancestor for TSpeedButton. If you want to define your own speed button class, you should derive it from TCustomSpeedButton.

A speed button is designed to automatically perform a process when it is pressed or clicked. The user can push the button to start an action or set a mode. When a user clicks on a speed button, focus is not shifted; a speed button never receives focus. The button may have a descriptive glyph (symbol or pictograph), and has state (checked, unchecked, Up, Down, Hovered, Selected, Disabled).


Version 3.2 Generated 2024-02-25 Home