Last change
on this file was 16, checked in by chronos, 8 years ago |
- Modified: Forms moved to Forms subdirectory.
|
File size:
1.3 KB
|
Line | |
---|
1 | unit UFormSettings;
|
---|
2 |
|
---|
3 | {$mode delphi}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
---|
9 | ULanguages;
|
---|
10 |
|
---|
11 | type
|
---|
12 |
|
---|
13 | { TFormSettings }
|
---|
14 |
|
---|
15 | TFormSettings = class(TForm)
|
---|
16 | ButtonOk: TButton;
|
---|
17 | ButtonCancel: TButton;
|
---|
18 | CheckBoxAlwaysOnTop: TCheckBox;
|
---|
19 | ComboBoxLanguage: TComboBox;
|
---|
20 | Label1: TLabel;
|
---|
21 | procedure ButtonOkClick(Sender: TObject);
|
---|
22 | procedure FormShow(Sender: TObject);
|
---|
23 | private
|
---|
24 | { private declarations }
|
---|
25 | public
|
---|
26 | procedure Load;
|
---|
27 | procedure Save;
|
---|
28 | end;
|
---|
29 |
|
---|
30 | var
|
---|
31 | FormSettings: TFormSettings;
|
---|
32 |
|
---|
33 | implementation
|
---|
34 |
|
---|
35 | {$R *.lfm}
|
---|
36 |
|
---|
37 | uses
|
---|
38 | UFormMain;
|
---|
39 |
|
---|
40 | { TFormSettings }
|
---|
41 |
|
---|
42 | procedure TFormSettings.FormShow(Sender: TObject);
|
---|
43 | begin
|
---|
44 | FormMain.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items);
|
---|
45 | ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(FormMain.CoolTranslator1.Language);
|
---|
46 | if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;
|
---|
47 | end;
|
---|
48 |
|
---|
49 | procedure TFormSettings.ButtonOkClick(Sender: TObject);
|
---|
50 | begin
|
---|
51 | if ComboBoxLanguage.ItemIndex <> -1 then
|
---|
52 | FormMain.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
|
---|
53 | end;
|
---|
54 |
|
---|
55 | procedure TFormSettings.Load;
|
---|
56 | begin
|
---|
57 | CheckBoxAlwaysOnTop.Checked := FormMain.AlwaysOnTop;
|
---|
58 | end;
|
---|
59 |
|
---|
60 | procedure TFormSettings.Save;
|
---|
61 | begin
|
---|
62 | FormMain.AlwaysOnTop := CheckBoxAlwaysOnTop.Checked;
|
---|
63 | end;
|
---|
64 |
|
---|
65 | end.
|
---|
66 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.