Frequently Asked Component Specific Questions
Options |
Display all FAQ items |
Displaying items 1 to 1 of 1, page 1 of 1
<< previous next >>
TMS FMX UI Pack
TTMSFMXCircularGauge: Subclassing TTMSFMXCircularGauge
TTMSFMXCircularGauge: Subclassing TTMSFMXCircularGauge
When subclassing TTMSFMXCircularGauge, make sure that in the new class, you override the protected method GetDefaultStyleLookupName to ensure your new gauge control uses the base class TTMSFMXCircularGauge default style resource. Additionally for this type of control, you also need to override the GetClassStyleName to return the correct default style. Below is a sample that demonstrates this:
type TFMXWireCircularGauge = class(TTMSFMXCircularGauge) private { Private declarations } protected { Protected declarations } function GetDefaultStyleLookupName: string; override; function GetClassStyleName: String; override; public { Public declarations } procedure ApplyStyle; override; published { Published declarations } end; ... { TFMXWireCircularGauge } procedure TFMXWireCircularGauge.ApplyStyle; begin inherited; end; function TFMXWireCircularGauge.GetClassStyleName: String; begin Result := ClassParent.ClassName + ''style''; Delete(Result, 1, 1); end; function TFMXWireCircularGauge.GetDefaultStyleLookupName: string; begin Result := GetClassStyleName; end;