TChart Editor save & restore custom themes
Posted: Mon Jul 11, 2022 7:36 pm
Hello,
We use the TChart editor to allow our users to change the theme as follows:
When The user executes the app again, we restore the theme as follows:
This works well, but it does not work for Custom themes saved by the TChart Editor and the tmpClass is set to nil. (I was hoping the TChartThemeClass would include the custom themes.)
How do I record what custom setting was selected in the editor and then restore that custom setting? Is there a better way to record the selected custom and standard theme and then restore it?
Thanks,
Dave
We use the TChart editor to allow our users to change the theme as follows:
Code: Select all
Procedure TForm1.ChangeTheme;
var
tmpClass:TChartThemeClass;
begin
tmpClass:=TChartThemeClass(ChartThemeSelector(Chart));
ChartThemeIndx := ChartThemes.IndexOf(tmpClass);
//Save ChartThemeIndex
…
Code: Select all
ApplyChartTheme(ChartThemes.Theme[ChartThemeIndx],Chart, -1);
How do I record what custom setting was selected in the editor and then restore that custom setting? Is there a better way to record the selected custom and standard theme and then restore it?
Thanks,
Dave