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

TCustomLabel

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

TCustomLabel : the base type from which TLabel is derived.

Declaration

Source position: stdctrls.pp line 1379

type TCustomLabel = class(TGraphicControl)

  class procedure WSRegisterClass; override;

  

WSRegisterClass - Register this Class for the current Widget Set

protected

  function CanTab; override;

  

CanTab - always set to False, as you can't tab to a label

  procedure DoMeasureTextPosition(); virtual;

  

DoMeasureTextPosition - method for measuring position of text; shows position of top and left edges

  function HasMultiLine;

  

HasMultiLine - returns True if label has multiple lines

  procedure CalculatePreferredSize(); override;

  

CalculatePreferredSize - find default/preferred height and width

  procedure CalculateSize();

  procedure DoAutoSize; override;

  

DoAutoSize - method for actually performing the AutoSize

  function DialogChar(); override;

  

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

  procedure TextChanged; override;

  

Procedure to deal with changes in text

  procedure DoSetBounds(); override;

  procedure FontChanged(); override;

  

FontChanged - method for dealing with a changed font

protected

  class function GetControlClassDefaultSize; override;

  

GetControlClassDefaultSize returns its own defaults, overriding inherited values

protected

  procedure WMActivate(); message;

  

WMActivate - LCL message to activate control

  procedure Notification(); override;

  

Notification calls inherited method and adjusts focus, if required

  function GetLabelText; virtual;

  

GetLabelText - returns the string for text of the label

  function GetTransparent;

  

GetTransparent - returns True if the control is to be transparent

  procedure SetColor(); override;

  

Set up the colour to be used by the control

  procedure SetFocusControl();

  

SetFocusControl - specifies which control has focus

  procedure SetLayout();

  

SetLayout - specifies text layout

  procedure SetShowAccelChar();

  

SetShowAccelChar - specifies whether accelerator characters are to be shown

  procedure SetTransparent();

  

SetTransparent - specifies whether the control is to be transparent

  procedure SetWordWrap();

  

SetWordWrap - specifies whether WordWrap is to be used

  procedure Loaded; override;

  

Loaded calls inherited method and adjusts size

  procedure UpdateSize;

  property Alignment: TAlignment; [rw]

  

Alignment - whether text is centered, left- or right-justified

  property FocusControl: TWinControl; [rw]

  

FocusControl - which control has focus

  property Layout: TTextLayout; [rw]

  

Layout - How the Text is to be laid out in the text rectangle: at the Bottom, Centre or Top

  property ShowAccelChar: Boolean; [rw]

  

ShowAccelChar - underline the character in the label that acts as an accelerator with a shortcut key

  property Transparent: Boolean; [rw]

  

Transparent - whether the viewer can see through the control. Default True

  property WordWrap: Boolean; [rw]

  

WordWrap - whether a word is to be wrapped to the next line if the text is about to become too long for the width available

  property OptimalFill: Boolean; [rw]

  

OptimalFill - boolean. If True, font size is adjusted for optimal fill of available space

public

  constructor Create(); override;

  

Create - constructor for TCustomLabel: calls inherited Create then initialises style, bounds, colour and some other properties

  function CalcFittingFontHeight();

  

Calculate the height of the font needed to fit the available space, given the MaxWidth and MaxHeight constraints

  function ColorIsStored; override;

  

Returns True if Colour is stored

  function AdjustFontForOptimalFill;

  

If True, attempts to adjust font for an optimal fill of the space available

  procedure Paint; override;

  

Virtual Paint method called in response to paint requests.

  procedure SetBounds(); override;

  property AutoSize;

  

Whether auto-size is to be used

  property Color;

  

Determine the colour for the current control

end;

Inheritance

TCustomLabel

  

TCustomLabel : the base type from which TLabel is derived.

|

TGraphicControl

  

TGraphicControl is the base class for all lightweight controls.

|

TControl

|

TLCLComponent

  

TLCLComponent - base class for LCL components

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent

|

TObject

Description

TCustomLabel : the base type from which TLabel is derived.

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