[Overview][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 259

type TCustomSpeedButton = class(TGraphicControl)

protected

  FState: TButtonState;

  

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

protected

  class procedure WSRegisterClass; override;

  

WSRegisterClass - Register this Class for the current Widget Set

protected

  function GetNumGlyphs;

  

Find the number of Glyphs

  procedure GlyphChanged();

  

What to do if the Glyph has changed

  function DialogChar(); override;

  

DialogChar - a LCL Key Message; returns True if a Dialog character has an associated message

  procedure MouseEnter; override;

  

MouseEnter - a procedure that allows the programmer to simulate a mouse entering the control, and initiates the same Action as that associated with the OnMouseEnter event

  procedure MouseLeave; override;

  

MouseLeave - a procedure that allows the programmer to simulate a mouse leaving the control, and initiates the same Action as that associated with the OnMouseLeave event

  procedure MouseDown(); override;

  

MouseDown - a procedure that allows the programmer to simulate a mouse button being down over the control, and initiates the same Action as that associated with the OnMouseDown event

  procedure MouseMove(); override;

  

MouseMove - a procedure that allows the programmer to simulate a mouse being moved over the control, and initiates the same Action as that associated with the OnMouseMove event

  procedure MouseUp(); override;

  

MouseUp - a procedure that allows the programmer to simulate a mouse button being Up over the control, and initiates the same Action as that associated with the OnMouseUp event

  procedure Paint; override;

  

Virtual Paint method called in response to paint requests.

  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;

  

Procedure to store text associated with the control in a string

  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;

  

ActionChange - method for changing an action

  function GetActionLinkClass; override;

  

GetActionLinkClass - returns the class of the action link

r

  class function GetControlClassDefaultSize; override;

  

Find the default size for this class of controls (by reference to parents)

protected

  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;

  

Click - a procedure that allows the programmer to simulate a mouse click over the control, and initiates the same Action as that associated with the OnClick event

  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;

  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; [rw]

  

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 glyphs

  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 around button

  property Transparent: Boolean; [rw]

  

Whether button is transparent

end;

Inheritance

TCustomSpeedButton

  

The ancestor class for TSpeedButton

|

TGraphicControl

  

TGraphicControl is the base class for all lightweight controls.

|

TControl

|

TLCLComponent

  

TLCLComponent - base class for LCL components

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent

|

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.