Class TProjectStyle

Unit

Declaration

type TProjectStyle = class(TObject)

Description

A singleton to manage current style in the project and get its properties.

Don't create or destroy instances of this class. Only use "Current()" method to access to its global unique instance.

Hierarchy

Overview

Methods

Protected constructor Create;
Public function GetStyles(const StyleType: TProjectStyleType): TStringDynArray;
Public procedure RegisterStyle(const StyleName: string; const StyleType: TProjectStyleType = TProjectStyleType.other);
Public class function Current: TProjectStyle;
Public destructor Destroy; override;

Properties

Public property StyleName: string read FStyleName write SetStyleName;
Public property StylesCount: integer read GetStyleCount;
Public property Styles[constIndex:integer]: TProjectStyleItem read GetStyle;

Description

Methods

Protected constructor Create;

Instance constructor method for this class.

Public function GetStyles(const StyleType: TProjectStyleType): TStringDynArray;

Returns an array of strings corresponding on registered styles name.

Public procedure RegisterStyle(const StyleName: string; const StyleType: TProjectStyleType = TProjectStyleType.other);

Add a style to the available styles for this project.

Public class function Current: TProjectStyle;

Returns the global TProjectStyle singleton class.

Never try to "Free()" the instance given by the "Current()" method. You will have access violations in your program and memory leaks !

Public destructor Destroy; override;

Instance destructor method for this class. don't call it. Use ".Free()" or "FreeAndNil()".

Properties

Public property StyleName: string read FStyleName write SetStyleName;

Name of the current style.

Public property StylesCount: integer read GetStyleCount;

Number of available registered styles.

Public property Styles[constIndex:integer]: TProjectStyleItem read GetStyle;

Give access to each registered styles as style item instances.

FMX Styles Utils (c) 2025 Patrick PREMARTIN and Serge GIRARD - Powered by PasDoc
Generated by PasDoc 0.16.0.