Changeset 174 for trunk/Forms/UFormSettings.pas
- Timestamp:
- Feb 14, 2018, 10:39:55 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormSettings.pas
r154 r174 23 23 CheckBoxAlwaysOnTop: TCheckBox; 24 24 ComboBoxLanguage: TComboBox; 25 ComboBoxTheme: TComboBox; 25 26 Label1: TLabel; 26 27 Label2: TLabel; 28 Label3: TLabel; 27 29 SpinEditDPI: TSpinEdit; 28 30 procedure ButtonOkClick(Sender: TObject); … … 47 49 48 50 uses 49 UCore ;51 UCore, UTheme; 50 52 51 53 { TFormSettings } … … 53 55 procedure TFormSettings.FormShow(Sender: TObject); 54 56 begin 55 Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items);56 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language);57 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;58 57 end; 59 58 60 59 procedure TFormSettings.ButtonOkClick(Sender: TObject); 61 60 begin 62 if ComboBoxLanguage.ItemIndex <> -1 then63 Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);64 61 end; 65 62 … … 77 74 begin 78 75 Core.CoolTranslator1.TranslateComponentRecursive(Self); 76 Core.ThemeManager.UseTheme(Self); 77 Core.ThemeManager.Themes.LoadToStrings(ComboBoxTheme.Items); 78 Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items); 79 79 end; 80 80 81 81 procedure TFormSettings.Load; 82 82 begin 83 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language); 84 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 85 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.ThemeManager.Theme); 86 if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0; 83 87 CheckBoxAlwaysOnTop.Checked := Core.AlwaysOnTop; 84 88 CheckBoxStartOnLogon.Checked := Core.StartOnLogon; … … 92 96 procedure TFormSettings.Save; 93 97 begin 98 if ComboBoxLanguage.ItemIndex <> -1 then 99 Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 100 if ComboBoxTheme.ItemIndex <> -1 then 101 Core.ThemeManager.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]); 94 102 Core.AlwaysOnTop := CheckBoxAlwaysOnTop.Checked; 95 103 Core.StartOnLogon := CheckBoxStartOnLogon.Checked;
Note:
See TracChangeset
for help on using the changeset viewer.