Changeset 243 for trunk/Forms/UFormSettings.pas
- Timestamp:
- Sep 21, 2018, 2:09:10 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormSettings.pas
r195 r243 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 Spin, ComCtrls ;9 Spin, ComCtrls, ExtCtrls; 10 10 11 11 type … … 16 16 ButtonOk: TButton; 17 17 ButtonCancel: TButton; 18 CheckBox2: TCheckBox; 19 CheckBoxAutoSaveTurn: TCheckBox; 20 CheckBoxDevelMode: TCheckBox; 18 21 CheckBoxReopenLastFile: TCheckBox; 19 CheckBoxAutoSaveTurn: TCheckBox;20 CheckBox2: TCheckBox;21 CheckBoxDevelMode: TCheckBox;22 22 ComboBoxLanguage: TComboBox; 23 ComboBoxTheme: TComboBox; 23 24 Label1: TLabel; 24 25 Label2: TLabel; … … 26 27 Label4: TLabel; 27 28 Label5: TLabel; 29 Label6: TLabel; 28 30 PageControl1: TPageControl; 31 Panel1: TPanel; 32 Panel2: TPanel; 33 SpinEditAnimSpeed: TSpinEdit; 29 34 SpinEditX: TSpinEdit; 30 35 SpinEditY: TSpinEdit; 31 SpinEditAnimSpeed: TSpinEdit;32 36 TabSheetGeneral: TTabSheet; 33 37 TabSheetDebug: TTabSheet; 34 38 procedure CheckBox2Change(Sender: TObject); 39 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 35 40 procedure FormCreate(Sender: TObject); 36 41 procedure FormShow(Sender: TObject); … … 50 55 51 56 uses 52 UCore, ULanguages ;57 UCore, ULanguages, UTheme; 53 58 54 59 { TFormSettings } … … 60 65 end; 61 66 67 procedure TFormSettings.FormClose(Sender: TObject; var CloseAction: TCloseAction 68 ); 69 begin 70 Core.PersistentForm.Save(Self); 71 end; 72 62 73 procedure TFormSettings.FormCreate(Sender: TObject); 63 74 begin 64 75 PageControl1.TabIndex := 0; 65 76 Core.CoolTranslator1.TranslateComponentRecursive(Self); 77 Core.ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items); 78 Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items); 66 79 end; 67 80 68 81 procedure TFormSettings.FormShow(Sender: TObject); 69 82 begin 83 Core.PersistentForm.Load(Self); 84 Core.ThemeManager1.UseTheme(Self); 70 85 {$IFDEF DEBUG} 71 86 TabSheetDebug.TabVisible := True; … … 77 92 procedure TFormSettings.Load; 78 93 begin 79 Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items);80 94 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language); 81 95 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 96 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.ThemeManager1.Theme); 97 if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0; 82 98 CheckBoxDevelMode.Checked := Core.DevelMode; 83 99 SpinEditAnimSpeed.Value := Core.AnimationSpeed; … … 93 109 if ComboBoxLanguage.ItemIndex <> -1 then 94 110 Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 111 if ComboBoxTheme.ItemIndex <> -1 then 112 Core.ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]); 95 113 Core.DevelMode := CheckBoxDevelMode.Checked; 96 114 Core.AnimationSpeed := SpinEditAnimSpeed.Value;
Note:
See TracChangeset
for help on using the changeset viewer.