source: trunk/Forms/FormPreferences.pas

Last change on this file was 32, checked in by chronos, 6 months ago
  • Modified: Removed U prefix from units names.
  • Modified: Use TFormEx for all forms.
File size: 1.2 KB
Line 
1unit FormPreferences;
2
3interface
4
5uses
6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
7 DbEngine, FormEx;
8
9type
10 { TFormPreferences }
11
12 TFormPreferences = class(TFormEx)
13 ButtonSave: TButton;
14 ButtonCancel: TButton;
15 CheckBoxRememberDatabase: TCheckBox;
16 ComboBoxLanguage: TComboBox;
17 Label1: TLabel;
18 public
19 procedure Load(Preferences: TPreferences);
20 procedure Save(Preferences: TPreferences);
21 end;
22
23
24implementation
25
26{$R *.lfm}
27
28uses
29 Languages;
30
31{ TFormPreferences }
32
33procedure TFormPreferences.Load(Preferences: TPreferences);
34begin
35 CheckBoxRememberDatabase.Checked := Preferences.RememberDatabase;
36 TFormEx.Translator.LanguageListToStrings(ComboBoxLanguage.Items);
37 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(
38 TFormEx.Translator.Language);
39 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;
40end;
41
42procedure TFormPreferences.Save(Preferences: TPreferences);
43begin
44 Preferences.RememberDatabase := CheckBoxRememberDatabase.Checked;
45 if ComboBoxLanguage.ItemIndex <> -1 then
46 TFormEx.Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
47end;
48
49end.
50
Note: See TracBrowser for help on using the repository browser.