| 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 | ComboBoxLanguage: TComboBox;
|
|---|
| 19 | Label1: TLabel;
|
|---|
| 20 | procedure FormCreate(Sender: TObject);
|
|---|
| 21 | private
|
|---|
| 22 |
|
|---|
| 23 | public
|
|---|
| 24 | procedure Load;
|
|---|
| 25 | procedure Save;
|
|---|
| 26 | end;
|
|---|
| 27 |
|
|---|
| 28 | var
|
|---|
| 29 | FormSettings: TFormSettings;
|
|---|
| 30 |
|
|---|
| 31 | implementation
|
|---|
| 32 |
|
|---|
| 33 | {$R *.lfm}
|
|---|
| 34 |
|
|---|
| 35 | uses
|
|---|
| 36 | UCore;
|
|---|
| 37 |
|
|---|
| 38 | { TFormSettings }
|
|---|
| 39 |
|
|---|
| 40 | procedure TFormSettings.FormCreate(Sender: TObject);
|
|---|
| 41 | begin
|
|---|
| 42 | Core.CoolTranslator1.TranslateComponentRecursive(Self);
|
|---|
| 43 | Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items);
|
|---|
| 44 | end;
|
|---|
| 45 |
|
|---|
| 46 | procedure TFormSettings.Load;
|
|---|
| 47 | begin
|
|---|
| 48 | ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language);
|
|---|
| 49 | if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;
|
|---|
| 50 | end;
|
|---|
| 51 |
|
|---|
| 52 | procedure TFormSettings.Save;
|
|---|
| 53 | begin
|
|---|
| 54 | if ComboBoxLanguage.ItemIndex <> -1 then
|
|---|
| 55 | Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
|
|---|
| 56 | end;
|
|---|
| 57 |
|
|---|
| 58 | end.
|
|---|
| 59 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.