Changeset 317 for trunk/Forms/FormSettings.pas
- Timestamp:
- Jun 21, 2024, 12:44:53 PM (5 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormSettings.pas
r316 r317 1 unit UFormSettings;1 unit FormSettings; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 7 Spin, ComCtrls, ExtCtrls ;7 Spin, ComCtrls, ExtCtrls, FormEx; 8 8 9 9 type … … 11 11 { TFormSettings } 12 12 13 TFormSettings = class(TForm )13 TFormSettings = class(TFormEx) 14 14 ButtonOk: TButton; 15 15 ButtonCancel: TButton; … … 35 35 TabSheetDebug: TTabSheet; 36 36 procedure CheckBox2Change(Sender: TObject); 37 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);38 37 procedure FormCreate(Sender: TObject); 39 38 procedure FormShow(Sender: TObject); … … 43 42 end; 44 43 45 var46 FormSettings: TFormSettings;47 44 48 45 … … 52 49 53 50 uses 54 UCore, Languages, Theme;51 Core, Languages, Theme; 55 52 56 53 { TFormSettings } … … 62 59 end; 63 60 64 procedure TFormSettings.FormClose(Sender: TObject; var CloseAction: TCloseAction65 );66 begin67 Core.PersistentForm.Save(Self);68 end;69 70 61 procedure TFormSettings.FormCreate(Sender: TObject); 71 62 begin 72 63 PageControl1.TabIndex := 0; 73 Core.CoolTranslator1.TranslateComponentRecursive(Self); 74 Core.ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items); 75 Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items); 64 Core.Core.ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items); 65 Core.Core.Translator1.LanguageListToStrings(ComboBoxLanguage.Items); 76 66 end; 77 67 78 68 procedure TFormSettings.FormShow(Sender: TObject); 79 69 begin 80 Core.PersistentForm.Load(Self);81 Core.ThemeManager1.UseTheme(Self);82 70 {$IFDEF DEBUG} 83 71 TabSheetDebug.TabVisible := True; … … 89 77 procedure TFormSettings.Load; 90 78 begin 91 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Co olTranslator1.Language);79 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Core.Translator1.Language); 92 80 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 93 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core. ThemeManager1.Theme);81 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.Core.ThemeManager1.Theme); 94 82 if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0; 95 CheckBoxDevelMode.Checked := Core. DevelMode;96 SpinEditAnimSpeed.Value := Core. AnimationSpeed;97 CheckBox2.Checked := Core. ScaleDPI1.AutoDetect;98 SpinEditX.Value := Core. ScaleDPI1.DPI.X;99 SpinEditY.Value := Core. ScaleDPI1.DPI.Y;100 CheckBoxAutoSaveTurn.Checked := Core. AutoSaveEnabled;101 CheckBoxReopenLastFile.Checked := Core. ReopenLastFile;83 CheckBoxDevelMode.Checked := Core.Core.DevelMode; 84 SpinEditAnimSpeed.Value := Core.Core.AnimationSpeed; 85 CheckBox2.Checked := Core.Core.ScaleDPI1.AutoDetect; 86 SpinEditX.Value := Core.Core.ScaleDPI1.DPI.X; 87 SpinEditY.Value := Core.Core.ScaleDPI1.DPI.Y; 88 CheckBoxAutoSaveTurn.Checked := Core.Core.AutoSaveEnabled; 89 CheckBoxReopenLastFile.Checked := Core.Core.ReopenLastFile; 102 90 end; 103 91 … … 105 93 begin 106 94 if ComboBoxLanguage.ItemIndex <> -1 then 107 Core.Co olTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);95 Core.Core.Translator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 108 96 if ComboBoxTheme.ItemIndex <> -1 then 109 Core. ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]);110 Core. DevelMode := CheckBoxDevelMode.Checked;111 Core. AnimationSpeed := SpinEditAnimSpeed.Value;112 Core. ScaleDPI1.AutoDetect := CheckBox2.Checked;113 Core. ScaleDPI1.DPI := Point(SpinEditX.Value, SpinEditY.Value);114 Core. AutoSaveEnabled := CheckBoxAutoSaveTurn.Checked;115 Core. ReopenLastFile := CheckBoxReopenLastFile.Checked;97 Core.Core.ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]); 98 Core.Core.DevelMode := CheckBoxDevelMode.Checked; 99 Core.Core.AnimationSpeed := SpinEditAnimSpeed.Value; 100 Core.Core.ScaleDPI1.AutoDetect := CheckBox2.Checked; 101 Core.Core.ScaleDPI1.DPI := Point(SpinEditX.Value, SpinEditY.Value); 102 Core.Core.AutoSaveEnabled := CheckBoxAutoSaveTurn.Checked; 103 Core.Core.ReopenLastFile := CheckBoxReopenLastFile.Checked; 116 104 end; 117 105
Note:
See TracChangeset
for help on using the changeset viewer.