[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 class for TSpeedButton

Declaration

Source position: buttons.pp line 256

type TCustomSpeedButton = class(TGraphicControl) end;

protected

  FState: TButtonState;

  

FState - local variable to hold the state of the speedbutton (whether checked or not)

  class procedure WSRegisterClass; override;

  

Registers this component class with the current WidgetSet.

  function GetNumGlyphs;

  

Find the number of Glyphs

  procedure GlyphChanged();

  

What to do if the Glyph has changed

  function DialogChar(); override;

  

Do something useful with accelerators etc.

  procedure CalculatePreferredSize(); override;

  procedure MeasureDraw();

  procedure MouseEnter; override;

  

Invokes the OnMouseEnter handler.

  procedure MouseLeave; override;

  

Invokes the OnMouseLeave handler.

  procedure MouseDown(); override;

  

Handler for MouseDown events.

  procedure MouseMove(); override;

  

Handler for MouseMove events.

  procedure MouseUp(); override;

  

Invokes the OnMouseUp handler.

  procedure Paint; override;

  

Override this method with your own painting code.

  procedure PaintBackground(); virtual;

  

Paint the background

  procedure SetDown();

  

SetDown - specifies the boolean value of Down (ie whether or not button was pressed)

  procedure SetGroupIndex();

  

SetGroupIndex - specifies the value of the Group Index

  procedure SetFlat();

  

SetFlat - specifies whether or not the button is displayed Flat

  procedure SetMargin();

  

SetMargin - specifies the size of the margin

  procedure SetNumGlyphs();

  

SetNumGlyphs - specifies the number of glyphs

  procedure SetSpacing();

  

SetSpacing - specifies the spacing between buttons

  procedure RealSetText(); override;

  

Sets the Caption property.

  procedure UpdateState(); virtual;

  

UpdateState - brings the state up oto date, implementing any pending changes, and rendering non-valid if InvalidateOnChange is True

  function GetDrawDetails; virtual;

  

GetDrawDetails - returns the structured details for drawing

  property MouseInControl: Boolean; [r]

  

MouseInControl - returns True if the mouse cursor is in the control

  procedure ActionChange(); override;

  

Handler for a changed Action.

  function GetActionLinkClass; override;

  

The default ActionLink class (TControlActionLink).

  class function GetControlClassDefaultSize; override;

  

Returns the default size for this class of controls (when added to a form).

  procedure Loaded; override;

  function GetGlyphSize(); virtual;

  

GetGlyphSize - returns the size of the glyoh within the specified PaintRect

  function GetTextSize(); virtual;

  

GetTextSize - returns the size of the text within the specified PaintRect

  function DrawGlyph(); virtual;

  

Draw the glyph in the specified canvas in the specified rectangle at a given offset within the client, with specified state and transparency

public

  constructor Create(); override;

  

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

  destructor Destroy; override;

  

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

  function FindDownButton;

  

FindDownButton - returns the button that is down

  procedure Click; override;

  

Invokes the OnClick and ActionLink.Execute handlers.

  procedure LoadGlyphFromResourceName();

  procedure LoadGlyphFromLazarusResource();

  

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

  property AllowAllUp: Boolean; [rw]

  

Boolean flag to determine whether all buttons are allowed to be Up (default false)

  property Color: TColor;

  property Down: Boolean; [rw]

  

The button has been set in the Down state

  property Flat: Boolean; [rw]

  

Whether the button is to be displayed Flat or in relief

  property Glyph: TBitmap; [rws]

  

The Bitmap glyph to be used on this button

  property GroupIndex: Integer; [rw]

  

The Index within the group of speedbuttons

  property Layout: TButtonLayout; [rw]

  

The button layout - Glyph at top, bottom, left or right

  property Margin: Integer; [rw]

  

Margin - the space around glyph and caption

  property NumGlyphs: Integer; [rw]

  

The number of Glyphs available

  property ShowAccelChar: Boolean; [rw]

  

Should accelerator character be shown (ie underlined character denoting key to be pressed for quick action)?

  property ShowCaption: Boolean; [rw]

  

Should caption be displayed?

  property Spacing: Integer; [rw]

  

Spacing between Glyph and Caption

  property Transparent: Boolean; [rw]

  

Whether button is transparent

Inheritance

TCustomSpeedButton

  

The ancestor class for TSpeedButton

|

TGraphicControl

  

TGraphicControl is the base class for all lightweight controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components associated with widgets.

|

TComponent

?

TObject

Description

TCustomSpeedButton is the ancestor for TSpeedButton. If you want to define your own speedbutton class, you should use this class to derive it from.

The Speed Button is designed to automate a process when it is selected. An user pushes a button to start an action or set a mode.

When a user clicks on a SpeedButton focus is not shifted; a Speed Button never gets focus. The button may carry an descriptive glyph, and has a state (checked or not, etc)

The latest version of this document can be found at lazarus-ccr.sourceforge.net.