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

TCustomLabel

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

The base class for TLabel.

Declaration

Source position: stdctrls.pp line 1484

type TCustomLabel = class(TGraphicControl) end;

protected

  class procedure WSRegisterClass; override;

  

Registers this component class with the current WidgetSet.

  function CanTab; override;

  

Always False, as you can't tab to a label.

  procedure DoMeasureTextPosition(); virtual;

  

Determines the origin of the text, within the control.

  function HasMultiLine;

  

Searches for newline characters in the text.

  procedure CalculatePreferredSize(); override;

  

Override this method to return the preferred height and width.

  procedure CalculateSize();

  

Determines the text extent, base on a maximum field width.

  procedure DoAutoSize; override;

  

For internal use only - call AdjustSize instead!

  function DialogChar(); override;

  

Do something useful with accelerators etc.

  procedure TextChanged; override;

  

Handles changes of the Text property.

  procedure DoSetBounds(); override;

  procedure FontChanged(); override;

  

Handles changes of the Font property.

  class function GetControlClassDefaultSize; override;

  procedure WMActivate(); message;

  

Defers the focus to the FocusControl.

  procedure Notification(); override;

  

Notification handler for insertion or deletion of components.

  function GetLabelText; virtual;

  

Returns the Caption string.

  function GetTransparent;

  procedure SetColor(); override;

  procedure SetFocusControl();

  procedure SetLayout();

  procedure SetShowAccelChar();

  procedure SetTransparent();

  procedure SetWordWrap();

  procedure Loaded; override;

  procedure UpdateSize;

  

Handles OptimalFill.

  property Alignment: TAlignment; [rw]

  

Horizontal text justification (centered, left- or right-justified).

  property FocusControl: TWinControl; [rw]

  

The control associated with the label and its accelerator key (AccelChar).

  property Layout: TTextLayout; [rw]

  

Vertical alignment of the text (at top, bottom or centered).

  property ShowAccelChar: Boolean; [rw]

  

Underlines the character in the label that acts as an accelerator with a shortcut key.

  property Transparent: Boolean; [rw]

  

Whether the viewer can see through the control. The default value is true

  property WordWrap: Boolean; [rw]

  

Allows text to wrap into multiple lines, when the text is too long for the available Width.

  property OptimalFill: Boolean; [rw]

  

If True, the font size is adjusted for optimal fill of the available space.

public

  constructor Create(); override;

  function CalcFittingFontHeight();

  

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

  function ColorIsStored; override;

  function AdjustFontForOptimalFill;

  

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

  procedure Paint; override;

  

Override this method with your own painting code.

  procedure SetBounds(); override;

  property AutoSize: Boolean;

  

Allows to automatically adjust the size of the control, according to its content.

  property Color: TColor;

  

The background color of the control.

Inheritance

TCustomLabel

  

The base class for TLabel.

|

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

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