Changeset 32 for trunk/Forms/FormPreferences.pas
- Timestamp:
- Jun 29, 2024, 7:58:36 AM (5 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormPreferences.pas
r31 r32 1 unit UFormPreferences;1 unit FormPreferences; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 7 UDatabase;7 DbEngine, FormEx; 8 8 9 9 type 10 10 { TFormPreferences } 11 11 12 TFormPreferences = class(TForm )12 TFormPreferences = class(TFormEx) 13 13 ButtonSave: TButton; 14 14 ButtonCancel: TButton; … … 16 16 ComboBoxLanguage: TComboBox; 17 17 Label1: TLabel; 18 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);19 procedure FormShow(Sender: TObject);20 18 public 21 19 procedure Load(Preferences: TPreferences); … … 29 27 30 28 uses 31 UCore,Languages;29 Languages; 32 30 33 31 { TFormPreferences } 34 35 procedure TFormPreferences.FormShow(Sender: TObject);36 begin37 Core.PersistentForm1.Load(Self);38 end;39 40 procedure TFormPreferences.FormClose(Sender: TObject;41 var CloseAction: TCloseAction);42 begin43 Core.PersistentForm1.Save(Self)44 end;45 32 46 33 procedure TFormPreferences.Load(Preferences: TPreferences); 47 34 begin 48 35 CheckBoxRememberDatabase.Checked := Preferences.RememberDatabase; 49 Core.Translator1.LanguageListToStrings(ComboBoxLanguage.Items); 50 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Translator1.Language); 36 TFormEx.Translator.LanguageListToStrings(ComboBoxLanguage.Items); 37 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject( 38 TFormEx.Translator.Language); 51 39 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 52 40 end; … … 56 44 Preferences.RememberDatabase := CheckBoxRememberDatabase.Checked; 57 45 if ComboBoxLanguage.ItemIndex <> -1 then 58 Core.Translator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);46 TFormEx.Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 59 47 end; 60 48
Note:
See TracChangeset
for help on using the changeset viewer.