Changeset 96 for trunk/Forms/UFormOptions.pas
- Timestamp:
- Aug 2, 2018, 10:41:11 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormOptions.pas
r91 r96 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 Spin, UTarget;9 Spin, ComCtrls, ExtCtrls, UTarget, UTheme; 10 10 11 11 type … … 17 17 ButtonCancel: TButton; 18 18 CheckBox1: TCheckBox; 19 CheckBoxDPIAuto: TCheckBox; 19 20 CheckBoxOptimizeAddSub: TCheckBox; 20 CheckBox DPIAuto: TCheckBox;21 CheckBoxOptimizeCopyMultiply: TCheckBox; 21 22 CheckBoxOptimizeMerge: TCheckBox; 22 23 CheckBoxOptimizeRelativeIndexes: TCheckBox; 23 CheckBoxOptimizeCopyMultiply: TCheckBox;24 24 ComboBoxLanguage: TComboBox; 25 25 ComboBoxOptimization: TComboBox; 26 ComboBoxTheme: TComboBox; 26 27 Label1: TLabel; 27 28 Label2: TLabel; … … 29 30 Label4: TLabel; 30 31 LabelDPI: TLabel; 32 LabelTheme: TLabel; 31 33 LabelX: TLabel; 34 PageControl1: TPageControl; 35 Panel1: TPanel; 36 Panel2: TPanel; 37 SpinEditCellSize: TSpinEdit; 32 38 SpinEditDPIX: TSpinEdit; 33 39 SpinEditDPIY: TSpinEdit; 34 SpinEditCellSize: TSpinEdit;35 40 SpinEditMemorySize: TSpinEdit; 36 procedure ButtonOkClick(Sender: TObject); 41 TabSheetGeneral: TTabSheet; 42 TabSheetBuild: TTabSheet; 37 43 procedure CheckBoxDPIAutoChange(Sender: TObject); 38 44 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); … … 62 68 begin 63 69 Core.PersistentForm1.Load(Self); 64 65 Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items);66 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language);67 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;68 CheckBox1.Checked := Core.OpenProjectOnStart;69 70 end; 70 71 … … 87 88 procedure TFormOptions.Load; 88 89 begin 90 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language); 91 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 92 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.ThemeManager.Theme); 93 if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0; 94 CheckBox1.Checked := Core.OpenProjectOnStart; 89 95 CheckBoxOptimizeAddSub.Checked := Core.Optimizations.AddSub; 90 96 CheckBoxOptimizeMerge.Checked := Core.Optimizations.Merge; … … 102 108 procedure TFormOptions.Save; 103 109 begin 110 if ComboBoxLanguage.ItemIndex <> -1 then 111 Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 112 if ComboBoxTheme.ItemIndex <> -1 then 113 Core.ThemeManager.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]); 114 Core.OpenProjectOnStart := CheckBox1.Checked; 104 115 Core.ScaleDPI1.DPI := Point(SpinEditDPIX.Value, SpinEditDPIY.Value); 105 116 Core.ScaleDPI1.AutoDetect := CheckBoxDPIAuto.Checked; … … 111 122 Core.Optimizations.RelativeIndexes := CheckBoxOptimizeRelativeIndexes.Checked; 112 123 Core.Optimizations.CopyMultiply := CheckBoxOptimizeCopyMultiply.Checked; 113 end;114 115 procedure TFormOptions.ButtonOkClick(Sender: TObject);116 begin117 if ComboBoxLanguage.ItemIndex <> -1 then118 Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);119 Core.OpenProjectOnStart := CheckBox1.Checked;120 124 end; 121 125 … … 134 138 begin 135 139 Core.CoolTranslator1.TranslateComponentRecursive(Self); 140 Core.ThemeManager.UseTheme(Self); 141 Core.ThemeManager.Themes.LoadToStrings(ComboBoxTheme.Items); 142 Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items); 136 143 end; 137 144
Note:
See TracChangeset
for help on using the changeset viewer.