CustomStyleServices#

Qualified name: delphivcl.CustomStyleServices

class CustomStyleServices#

Bases: Object

TCustomStyleServices is a class that provides access to style functionality. Use the methods and properties of TCustomStyleServices to get information about a style or to perform painting of custom controls. Do not instantiate TCustomStyleServices; instead, call the StyleServices function to access the methods and properties of TCustomStyleServices.

Methods

ApplyThemeChange

Resets the application theme.

ColorToRGB

Gets the color reference for a specified TColor.

ContentRect

<Delphi method ContentRect of type TCustomStyleServices at 21141C2DA40>

Create

Constructs an object and initializes its data before the object is first used.

DrawEdge

Draws the edge or edges of the rectangle that contains the element in the current style.

DrawElement

Draws the specified element.

DrawIcon

Draws an icon over the given element.

DrawParentBackground

Draws the background of the given user interface element's parent.

DrawText

Draws text over an element, using the current style.

GetElementColor

Determines the color of the element specified by Details.

GetElementContentRect

Gets the background rectangle of the content area of the element.

GetElementMargins

Determines the margins of the element in the current style.

GetElementRegion

Determines the region of the element in the current style.

GetElementSize

Determines the size for the specified part of a control.

GetStyleColor

Returns the color defined in the style for the element specified by Color.

GetStyleFontColor

Returns the font color for the element specified by Font.

GetSystemColor

Returns the system color defined in the current style.

GetTextExtent

Returns the rectangle that contains the given text, drawn in the current style.

GetTheme

<Delphi method GetTheme of type TCustomStyleServices at 21141C2F030>

GetThemeForDPI

<Delphi method GetThemeForDPI of type TCustomStyleServices at 21141C2F100>

HasElementFixedPosition

Embarcadero Technologies does not currently have any additional information.

HasTransparentParts

Determines whether the given element has transparent parts.

IsValidStyle

Checks whether the provided style is a valid style.

LoadFromFile

Loads a style from the specified file.

PaintBorder

Draws the border of a control.

SaveToFile

Saves the current style settings to the specified file.

ThemesAvailable

<Delphi method ThemesAvailable of type TCustomStyleServices at 21141C2EDC0>

ThemesEnabled

<Delphi method ThemesEnabled of type TCustomStyleServices at 21141C2EE90>

Attributes

Available

Determines whether the operating system supports styles.

ClassName

Returns the TObject.ClassName

DesigningState

Embarcadero Technologies does not currently have any additional information.

Enabled

Determines whether styles are enabled for the current application.

Flags

Returns the flags set for the current style.

IsSystemStyle

Determines whether the current style is a system style.

Name

Returns the name of the current style.

OnThemeChange

<Delphi property OnThemeChange of type TCustomStyleServices at 21141C2F6B0>

Theme

<Delphi indexed property Theme of type TCustomStyleServices at 21141267B30>

ThemeForDPI

<Delphi indexed property ThemeForDPI of type TCustomStyleServices at 21141267BF0>

ApplyThemeChange()#

Resets the application theme. ApplyThemeChange is called automatically by the TApplication object whenever the operating system theme is changed.

Note: ApplyThemeChange is used internally by the VCL and should not be called manually by applications.

Available#

Determines whether the operating system supports styles. Use Available to check whether the operating system supports styles.

ClassName#

Returns the TObject.ClassName

ColorToRGB(Color: Color, Details: PhemedElementDetails) Cardinal#

Gets the color reference for a specified TColor. Use ColorToRGB to convert the Color parameter to its RGB representation. If Details is not nil, the function returns the system color that is defined for Color under the current style. For example, if Color is clBtnFace, the function returns the system color defined for the button face in the current style, as a TColorRef value. Gets the color reference for a specified TColor. Use ColorToRGB to convert the Color parameter to its RGB representation. If Details is not nil, the function returns the system color that is defined for Color under the current style. For example, if Color is clBtnFace, the function returns the system color defined for the button face in the current style, as a TColorRef value.

ContentRect(DC: HDC, Details: ThemedElementDetails, BoundingRect: Rect) Rect#

<Delphi method ContentRect of type TCustomStyleServices at 21141C2DA40>

Create()#

Constructs an object and initializes its data before the object is first used. Vcl.Themes.TCustomStyleServices.Create inherits from System.TObject.Create. All content below this line refers to System.TObject.Create. Constructs an object and initializes its data before the object is first used. Create constructs an object. The purpose, size, and behavior of objects differ greatly. The Create constructor defined by TObject allocates memory but does not initialize data. Descendant objects usually define a constructor that creates the particular kind of object and initializes its data.

Note: If an exception escapes from a constructor, the object’s destructor is called to clean up the failed instance.

DesigningState#

Embarcadero Technologies does not currently have any additional information.

DrawEdge(DC: HDC, Details: ThemedElementDetails, R: Rect, Edges: Cardinal, Flags: Cardinal, ContentRect: PRect) Boolean#

Draws the edge or edges of the rectangle that contains the element in the current style. Call DrawEdge to draw one or more edges of the given element. Edge indicates the types of inner and outer edges and Flags specifies the types of borders.

Note: The first overload of this method is deprecated; use the second overload instead. Draws the edge or edges of the rectangle that contains the element in the current style. Call DrawEdge to draw one or more edges of the given element. Edge indicates the types of inner and outer edges and Flags specifies the types of borders.

Note: The first overload of this method is deprecated; use the second overload instead.

DrawElement(DC: HDC, Details: ThemedElementDetails, R: Rect, ClipRect: Rect, DPI: Integer) Boolean#

Draws the specified element. Call DrawElement to draw the element specified by Details, using the current style. R is the rectangle where the element is drawn and ClipRect is a clipping rectangle. Draws the specified element. Call DrawElement to draw the element specified by Details, using the current style. R is the rectangle where the element is drawn and ClipRect is a clipping rectangle.

DrawIcon(DC: HDC, Details: ThemedElementDetails, R: Rect, Images: NativeUInt, Index: Integer) Boolean#

Draws an icon over the given element. Call DrawIcon to draw the image that resides at the Index index in the image list specified by Images. The icon is drawn in the rectangle specified by R, over the element indicated by Details.

DrawParentBackground(Window: HWND, Target: HDC, Details: PhemedElementDetails, OnlyIfTransparent: Boolean, Bounds: Rect) Boolean#

Draws the background of the given user interface element’s parent. Call DrawParentBackground to draw the background of a user interface element’s parent, using the current style. If OnlyIfTransparent is True, the drawing is performed only if the element is transparent in the current style. Bounds represents the area to be drawn. Draws the background of the given user interface element’s parent. Call DrawParentBackground to draw the background of a user interface element’s parent, using the current style. If OnlyIfTransparent is True, the drawing is performed only if the element is transparent in the current style. Bounds represents the area to be drawn. Draws the background of the given user interface element’s parent. Call DrawParentBackground to draw the background of a user interface element’s parent, using the current style. If OnlyIfTransparent is True, the drawing is performed only if the element is transparent in the current style. Bounds represents the area to be drawn.

DrawText(DC: HDC, Details: ThemedElementDetails, S: string, R: Rect, Flags: Cardinal, Flags2: Cardinal, DPI: Integer) Boolean#

Draws text over an element, using the current style. Call DrawText to draw the S string in the rectangle specified by R. The S string has the format and additional options indicated by the Flags and Options parameters. The drawing is performed with the settings of the current style.

Note: The first overload of this function is deprecated. Use the following two overloads that use TTextFormat to specify the text formatting. Draws text over an element, using the current style. Call DrawText to draw the S string in the rectangle specified by R. The S string has the format and additional options indicated by the Flags and Options parameters. The drawing is performed with the settings of the current style.

Note: The first overload of this function is deprecated. Use the following two overloads that use TTextFormat to specify the text formatting. Draws text over an element, using the current style. Call DrawText to draw the S string in the rectangle specified by R. The S string has the format and additional options indicated by the Flags and Options parameters. The drawing is performed with the settings of the current style.

Note: The first overload of this function is deprecated. Use the following two overloads that use TTextFormat to specify the text formatting.

Enabled#

Determines whether styles are enabled for the current application. Use Enabled to check whether the current application has styles enabled.

Flags#

Returns the flags set for the current style. Use Flags to obtain the flags that are set for the current style.

GetElementColor(Details: ThemedElementDetails, ElementColor: ElementColor, Color: Color) Boolean#

Determines the color of the element specified by Details. GetElementColor determines the color value used for the property determined by ElementColor.

GetElementContentRect(DC: HDC, Details: ThemedElementDetails, BoundingRect: Rect, ContentRect: Rect) Boolean#

Gets the background rectangle of the content area of the element. Call GetElementContentRect to retrieve the rectangle that contains the background area of a control, when styles are enabled. Details represents the user interface element from which the information is being retrieved.

GetElementMargins(DC: HDC, Details: ThemedElementDetails, ElementMargin: ElementMargin, Margins: _MARGINS, DPI: Integer) Boolean#

Determines the margins of the element in the current style. Call GetElementMargins to retrieve the margins of the control specified by Details. Determines the margins of the element in the current style. Call GetElementMargins to retrieve the margins of the control specified by Details.

GetElementRegion(Details: ThemedElementDetails, Rect: Rect, Region: HRGN) Boolean#

Determines the region of the element in the current style. Call GetElementRegion to obtain the region of the element, bounded by the given rectangle. Determines the region of the element in the current style. Call GetElementRegion to obtain the region of the element, bounded by the given rectangle.

GetElementSize(DC: HDC, Details: ThemedElementDetails, ElementSize: ElementSize, Size: Size, DPI: Integer) Boolean#

Determines the size for the specified part of a control. Call GetElementSize to obtain the size of the rectangle that contains the part of the control specified by Details. ElementSize represents the type of size to be returned: minimum, actual, or stretch. Determines the size for the specified part of a control. Call GetElementSize to obtain the size of the rectangle that contains the part of the control specified by Details. ElementSize represents the type of size to be returned: minimum, actual, or stretch.

GetStyleColor(Color: StyleColor) Color#

Returns the color defined in the style for the element specified by Color. Use GetStyleColor to obtain the color defined for a certain control. For example, if Color is scButtonPressed, GetStyleColor returns the color assigned for the button when it is pressed. The style colors give you access to the colors used for controls in the current style. There are two categories of style colors. The first category includes colors used for control parts that are rendered directly from an image. In this case, the style color offers you a way to access the color of that image and is purely informational. The second category includes the colors used for controls that are rendered from code at run time (Panel, ListBox, Grid, and so on).

GetStyleFontColor(Font: StyleFont) Color#

Returns the font color for the element specified by Font. Call GetStyleFontColor to obtain the font color defined in the current style for a specific part and state of a control. For example, if Font is sfEditBoxDisabled, GetStyleFontColor returns the color of the text in an edit box, when the edit box is disabled.

GetSystemColor(Color: Color) Color#

Returns the system color defined in the current style. The current style has a set of colors defined for system color constants that resemble the style colors. For instance, you can call GetSystemColor with clBtnFace to obtain the styled color of a button face.

GetTextExtent(DC: HDC, Details: ThemedElementDetails, Text: string, Flags: TextFormat, ExtentRect: Rect) Boolean#

Returns the rectangle that contains the given text, drawn in the current style. Call GetTextExtent to obtain the rectangle required to draw the given text with the specified formatting in the current style. Returns the rectangle that contains the given text, drawn in the current style. Call GetTextExtent to obtain the rectangle required to draw the given text with the specified formatting in the current style.

GetTheme(Element: ThemedElement) NativeUInt#

<Delphi method GetTheme of type TCustomStyleServices at 21141C2F030>

GetThemeForDPI(Element: ThemedElement, DPI: Integer) NativeUInt#

<Delphi method GetThemeForDPI of type TCustomStyleServices at 21141C2F100>

HasElementFixedPosition(Details: ThemedElementDetails) Boolean#

Embarcadero Technologies does not currently have any additional information.

HasTransparentParts(Details: ThemedElementDetails) Boolean#

Determines whether the given element has transparent parts. Call HasTransparentParts to check whether the element specified by Details has transparent parts in the current style.

IsSystemStyle#

Determines whether the current style is a system style. IsSystemStyle returns True if the current style is a default operating system style, and False if it is a custom style.

IsValidStyle(Stream: Stream) Boolean#

Checks whether the provided style is a valid style. Call IsValidStyle to verify whether the style specified by Stream is a valid style. Checks whether the provided style is a valid style. Call IsValidStyle to verify whether the style specified by Stream is a valid style.

LoadFromFile(FileName: string) CustomStyleServices#

Loads a style from the specified file. Call LoadFromFile to load a style from the specified file.

Name#

Returns the name of the current style. Use Name to obtain a string that represents the name of the current style. This is the same name you can use with StyleManager.SetStyle to activate the style.

OnThemeChange#

<Delphi property OnThemeChange of type TCustomStyleServices at 21141C2F6B0>

PaintBorder(Control: WinControl, EraseLRCorner: Boolean)#

Draws the border of a control. Call PaintBorder to draw the border of a control using the current style.

SaveToFile(FileName: string)#

Saves the current style settings to the specified file. Call SaveToFile to save the current style in the specified filename.

Theme#

<Delphi indexed property Theme of type TCustomStyleServices at 21141267B30>

ThemeForDPI#

<Delphi indexed property ThemeForDPI of type TCustomStyleServices at 21141267BF0>

ThemesAvailable()#

<Delphi method ThemesAvailable of type TCustomStyleServices at 21141C2EDC0>

ThemesEnabled()#

<Delphi method ThemesEnabled of type TCustomStyleServices at 21141C2EE90>