TCoreButton
Base button component with theme support. Implements IThemeSubscriber for automatic theme updates.
UI ComponentIThemeSubscriber
Overview
TCoreButton extends TWebButton with theme integration and CSS class support. All buttons in the Framework should inherit from TCoreButton.
Published Properties
| Property | Type | Description |
|---|---|---|
| Caption | STRING | Button text. |
| Enabled | Boolean | Whether button is clickable. |
| ElementClassName | STRING | CSS class(es) to apply. |
IThemeSubscriber
TCoreButton implements IThemeSubscriber. Override ApplyThemeStyles to customize theme application:
PROCEDURE TCoreButton.ApplyThemeStyles(ThemeManager: TThemeManager);
VAR
ButtonStyle: TComponentStyleDef;
BEGIN
ButtonStyle := ThemeManager.GetStyleDef('button');
IF Assigned(ButtonStyle) THEN
BEGIN
TDom.SetStyle(ElementHandle, 'background-color', ButtonStyle.BackgroundColor);
TDom.SetStyle(ElementHandle, 'color', ButtonStyle.TextColor);
END;
END;
FUNCTION TCoreButton.GetSubscriberComponentType: STRING;
BEGIN
Result := 'button';
END;