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
Resets the application theme.
Gets the color reference for a specified TColor.
Draws the edge or edges of the rectangle that contains the element in the current style.
Draws the specified element.
Draws an icon over the given element.
Draws the background of the given user interface element's parent.
Draws text over an element, using the current style.
Determines the color of the element specified by Details.
Gets the background rectangle of the content area of the element.
Determines the margins of the element in the current style.
Determines the region of the element in the current style.
Determines the size for the specified part of a control.
Returns the color defined in the style for the element specified by Color.
Returns the font color for the element specified by Font.
Returns the system color defined in the current style.
Returns the rectangle that contains the given text, drawn in the current style.
Embarcadero Technologies does not currently have any additional information.
Determines whether the given element has transparent parts.
Checks whether the provided style is a valid style.
Loads a style from the specified file.
Draws the border of a control.
Saves the current style settings to the specified file.
Attributes
Determines whether the operating system supports styles.
Returns the TObject.ClassName
Embarcadero Technologies does not currently have any additional information.
Determines whether styles are enabled for the current application.
Returns the flags set for the current style.
Determines whether the current style is a system style.
Returns the name of the current style.
int:
int:
- 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.
- Type:
bool
- ClassName¶
Returns the TObject.ClassName
- ColorToRGB(Color: int, Details: PhemedElementDetails) int ¶
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: int, Details: ThemedElementDetails, BoundingRect: Rect) Rect ¶
- DesigningState¶
Embarcadero Technologies does not currently have any additional information.
- Type:
bool
- DrawEdge(DC: int, Details: ThemedElementDetails, R: Rect, Edges: int, Flags: int, ContentRect: PRect) bool ¶
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: int, Details: ThemedElementDetails, R: Rect, ClipRect: Rect, DPI: int) bool ¶
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: int, Details: ThemedElementDetails, R: Rect, Images: int, Index: int) bool ¶
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: int, Target: int, Details: PhemedElementDetails, OnlyIfTransparent: bool, Bounds: Rect) bool ¶
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: int, Details: ThemedElementDetails, S: str, R: Rect, Flags: int, Flags2: int, DPI: int) bool ¶
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.
- Type:
bool
- Flags¶
Returns the flags set for the current style. Use Flags to obtain the flags that are set for the current style.
- Type:
CustomStyleServices.TStyleFlags
- GetElementColor(Details: ThemedElementDetails, ElementColor: ElementColor, Color: int) bool ¶
Determines the color of the element specified by Details. GetElementColor determines the color value used for the property determined by ElementColor.
- GetElementContentRect(DC: int, Details: ThemedElementDetails, BoundingRect: Rect, ContentRect: Rect) bool ¶
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.
- GetElementDetails(Detail: ThemedButton) ThemedElementDetails ¶
- GetElementMargins(DC: int, Details: ThemedElementDetails, ElementMargin: ElementMargin, Margins: _MARGINS, DPI: int) bool ¶
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: int) bool ¶
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: int, Details: ThemedElementDetails, ElementSize: ElementSize, Size: Size, DPI: int) bool ¶
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) int ¶
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) int ¶
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: int) int ¶
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: int, Details: ThemedElementDetails, Text: str, Flags: TextFormat, ExtentRect: Rect) bool ¶
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.
- HasElementFixedPosition(Details: ThemedElementDetails) bool ¶
Embarcadero Technologies does not currently have any additional information.
- HasTransparentParts(Details: ThemedElementDetails) bool ¶
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.
- Type:
bool
- IsValidStyle(Stream: Stream) bool ¶
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: str) CustomStyleServices ¶
Loads a style from the specified file. Call LoadFromFile to load a style from the specified file.
- LoadFromStream(Stream: Stream) CustomStyleServices ¶
- 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.
- Type:
str
- PaintBorder(Control: WinControl, EraseLRCorner: bool) None ¶
Draws the border of a control. Call PaintBorder to draw the border of a control using the current style.
- SaveToFile(FileName: str) None ¶
Saves the current style settings to the specified file. Call SaveToFile to save the current style in the specified filename.
- Theme¶
int:
- ThemeForDPI¶
int:
- ThemesAvailable() Boolean ¶
- ThemesEnabled() Boolean ¶
- UpdateThemes()¶