FMX.Controls.TTextSettingsInfo

Delphi
TTextSettingsInfo = class (TPersistent)
C++
class PASCALIMPLEMENTATION TTextSettingsInfo : public System::Classes::TPersistent
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
class | public | FMX.Controls.pas FMX.Controls.hpp |
FMX.Controls | FMX.Controls |
Description
This class is used by all text controls (such as TDateEdit) and presented text controls (such as TLabel) as the core engine for managing styled text representation properties.
TTextSettingsInfo manages the following sets of styled text representation properties:
- DefaultTextSettings -- Stores a TTextSettings type object keeping the default values of the text representation properties.
- TextSettings -- Keeps the values of styled text representation properties that are set in the Object Inspector or programmatically.
- ResultingTextSettings -- Keeps final values of text representation properties. These values are really used to draw texts in a control.
Also TTextSettingsInfo manages the StyledSettings property. StyledSettings defines the styled text representation properties whose values are loaded from the current style and cannot be changed manually.
The DefaultTextSettings, TextSettings, and ResultingTextSettings properties can keep the following styled text representation properties TFont.Family, TFont.Size, TFont.Style, FontColor, HorzAlign, VertAlign, Trimming, and WordWrap defining visual parameters of the text representation in controls.
Text controls using TTextSettingsInfo objects can be:
- Graphical text controls that display text, such as TTimeEdit, TListBoxItem, TTabItem, and others.
- Presented text controls that provide a separation between data and presentation, such as TLabel, TRadioButton, TCheckBox, TCustomButton, TGroupBox, TPopupBox, and others.
Typically, such text controls define a GetTextSettingsClass method that retrieves a class reference to an appropriate TTextSettingsInfo class type. Create constructors of such controls create a field keeping an object of the retrieved type. For example, the TTextControl.Create constructor creates and initializes the FTextSettingsInfo
field with the following call:
FTextSettingsInfo := TTextControlSettingsInfo.Create(Self, GetTextSettingsClass);
Now the control can retrieve value of the TTextControl.DefaultTextSettings, TTextControl.TextSettings, TTextControl.ResultingTextSettings, and TTextControl.StyledSettings properties from the corresponding properties stored in the TTextSettingsInfo type object in the FTextSettingsInfo
field.
See Also
- FMX.Controls.TTextControl.DefaultTextSettings
- FMX.Controls.TTextControl.TextSettings
- FMX.Controls.TTextControl.ResultingTextSettings
- FMX.Controls.TTextControl.StyledSettings