Changeset 219 for trunk/Forms/FormSettings.pas
- Timestamp:
- Jan 17, 2025, 9:05:54 PM (4 days ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormSettings.pas
r218 r219 1 unit UFormSettings; 2 3 {$mode delphi} 1 unit FormSettings; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 Menus, Spin, ExtCtrls, ULanguages;7 Menus, Spin, ExtCtrls, Languages, FormEx; 10 8 11 9 type … … 13 11 { TFormSettings } 14 12 15 TFormSettings = class(TForm )13 TFormSettings = class(TFormEx) 16 14 Bevel1: TBevel; 17 15 ButtonOk: TButton; … … 28 26 Label3: TLabel; 29 27 SpinEditDPI: TSpinEdit; 30 procedure ButtonOkClick(Sender: TObject);31 28 procedure CheckBoxAutomaticDPIChange(Sender: TObject); 32 29 procedure CheckBoxStartOnLogonChange(Sender: TObject); 33 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);34 30 procedure FormCreate(Sender: TObject); 35 procedure FormShow(Sender: TObject);36 private37 { private declarations }38 31 public 39 32 procedure Load; … … 42 35 end; 43 36 44 var45 FormSettings: TFormSettings;46 37 47 38 implementation … … 50 41 51 42 uses 52 UCore, UTheme;43 Core, Theme; 53 44 54 45 { TFormSettings } 55 56 procedure TFormSettings.FormShow(Sender: TObject);57 begin58 Core.PersistentForm1.Load(Self);59 end;60 61 procedure TFormSettings.ButtonOkClick(Sender: TObject);62 begin63 end;64 46 65 47 procedure TFormSettings.CheckBoxAutomaticDPIChange(Sender: TObject); … … 73 55 end; 74 56 75 procedure TFormSettings.FormClose(Sender: TObject; var CloseAction: TCloseAction76 );77 begin78 Core.PersistentForm1.Save(Self);79 end;80 81 57 procedure TFormSettings.FormCreate(Sender: TObject); 82 58 begin 83 Core.Translator.TranslateComponentRecursive(Self); 84 Core.ThemeManager.UseTheme(Self); 85 Core.ThemeManager.Themes.LoadToStrings(ComboBoxTheme.Items); 86 Core.Translator.LanguageListToStrings(ComboBoxLanguage.Items); 59 Core.Core.Translator.TranslateComponentRecursive(Self); 60 Core.Core.ThemeManager.Themes.LoadToStrings(ComboBoxTheme.Items); 61 Core.Core.Translator.LanguageListToStrings(ComboBoxLanguage.Items); 87 62 end; 88 63 89 64 procedure TFormSettings.Load; 90 65 begin 91 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core. Translator.Language);66 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Core.Translator.Language); 92 67 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 93 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core. ThemeManager.Theme);68 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.Core.ThemeManager.Theme); 94 69 if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0; 95 CheckBoxAlwaysOnTop.Checked := Core. AlwaysOnTop;96 CheckBoxStartOnLogon.Checked := Core. StartOnLogon;97 CheckBoxStartMinimizedToTray.Checked := Core. StartMinimizedToTray;98 CheckBoxAutomaticDPI.Checked := Core. ScaleDPI1.AutoDetect;99 SpinEditDPI.Value := Core. ScaleDPI1.DPI.X;100 CheckBoxReopenLastFileOnStart.Checked := Core. ReopenLastFileOnStart;70 CheckBoxAlwaysOnTop.Checked := Core.Core.AlwaysOnTop; 71 CheckBoxStartOnLogon.Checked := Core.Core.StartOnLogon; 72 CheckBoxStartMinimizedToTray.Checked := Core.Core.StartMinimizedToTray; 73 CheckBoxAutomaticDPI.Checked := Core.Core.ScaleDPI1.AutoDetect; 74 SpinEditDPI.Value := Core.Core.ScaleDPI1.DPI.X; 75 CheckBoxReopenLastFileOnStart.Checked := Core.Core.ReopenLastFileOnStart; 101 76 UpdateInterface; 102 77 end; … … 105 80 begin 106 81 if ComboBoxLanguage.ItemIndex <> -1 then 107 Core. Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);82 Core.Core.Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 108 83 if ComboBoxTheme.ItemIndex <> -1 then 109 Core. ThemeManager.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]);110 Core. AlwaysOnTop := CheckBoxAlwaysOnTop.Checked;111 Core. StartOnLogon := CheckBoxStartOnLogon.Checked;112 Core. StartMinimizedToTray := CheckBoxStartMinimizedToTray.Checked;113 Core. ScaleDPI1.AutoDetect := CheckBoxAutomaticDPI.Checked;114 Core. ScaleDPI1.DPI := Point(SpinEditDPI.Value, SpinEditDPI.Value);115 Core. ReopenLastFileOnStart := CheckBoxReopenLastFileOnStart.Checked;84 Core.Core.ThemeManager.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]); 85 Core.Core.AlwaysOnTop := CheckBoxAlwaysOnTop.Checked; 86 Core.Core.StartOnLogon := CheckBoxStartOnLogon.Checked; 87 Core.Core.StartMinimizedToTray := CheckBoxStartMinimizedToTray.Checked; 88 Core.Core.ScaleDPI1.AutoDetect := CheckBoxAutomaticDPI.Checked; 89 Core.Core.ScaleDPI1.DPI := Point(SpinEditDPI.Value, SpinEditDPI.Value); 90 Core.Core.ReopenLastFileOnStart := CheckBoxReopenLastFileOnStart.Checked; 116 91 end; 117 92
Note:
See TracChangeset
for help on using the changeset viewer.