| 1 | unit FormSettings;
|
|---|
| 2 |
|
|---|
| 3 | interface
|
|---|
| 4 |
|
|---|
| 5 | uses
|
|---|
| 6 | Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
|---|
| 7 | FormEx;
|
|---|
| 8 |
|
|---|
| 9 | type
|
|---|
| 10 |
|
|---|
| 11 | { TFormSettings }
|
|---|
| 12 |
|
|---|
| 13 | TFormSettings = class(TFormEx)
|
|---|
| 14 | ButtonOk: TButton;
|
|---|
| 15 | ButtonCancel: TButton;
|
|---|
| 16 | CheckBoxAutoStartMachine: TCheckBox;
|
|---|
| 17 | ComboBoxStartUpForm: TComboBox;
|
|---|
| 18 | ComboBoxTheme: TComboBox;
|
|---|
| 19 | ComboBoxLanguage: TComboBox;
|
|---|
| 20 | Label1: TLabel;
|
|---|
| 21 | Label2: TLabel;
|
|---|
| 22 | Label3: TLabel;
|
|---|
| 23 | ScrollBox1: TScrollBox;
|
|---|
| 24 | procedure ButtonOkClick(Sender: TObject);
|
|---|
| 25 | procedure FormShow(Sender: TObject);
|
|---|
| 26 | private
|
|---|
| 27 |
|
|---|
| 28 | public
|
|---|
| 29 |
|
|---|
| 30 | end;
|
|---|
| 31 |
|
|---|
| 32 | var
|
|---|
| 33 | FormSettings: TFormSettings;
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 | implementation
|
|---|
| 37 |
|
|---|
| 38 | {$R *.lfm}
|
|---|
| 39 |
|
|---|
| 40 | uses
|
|---|
| 41 | Core, Theme, Languages;
|
|---|
| 42 |
|
|---|
| 43 | { TFormSettings }
|
|---|
| 44 |
|
|---|
| 45 | procedure TFormSettings.FormShow(Sender: TObject);
|
|---|
| 46 | begin
|
|---|
| 47 | Core.Core.Translator1.LanguageListToStrings(ComboBoxLanguage.Items);
|
|---|
| 48 | ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Core.Translator1.Language);
|
|---|
| 49 | if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;
|
|---|
| 50 |
|
|---|
| 51 | Core.Core.ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items);
|
|---|
| 52 | ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.Core.ThemeManager1.Theme);
|
|---|
| 53 | if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0;
|
|---|
| 54 |
|
|---|
| 55 | ComboBoxStartUpForm.Text := Core.Core.StartUpForm;
|
|---|
| 56 | CheckBoxAutoStartMachine.Checked := Core.Core.AutoStartMachine;
|
|---|
| 57 | end;
|
|---|
| 58 |
|
|---|
| 59 | procedure TFormSettings.ButtonOkClick(Sender: TObject);
|
|---|
| 60 | begin
|
|---|
| 61 | if ComboBoxLanguage.ItemIndex <> -1 then
|
|---|
| 62 | Core.Core.Translator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
|
|---|
| 63 | if ComboBoxTheme.ItemIndex <> -1 then
|
|---|
| 64 | Core.Core.ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]);
|
|---|
| 65 |
|
|---|
| 66 | Core.Core.StartUpForm := ComboBoxStartUpForm.Text;
|
|---|
| 67 | Core.Core.AutoStartMachine := CheckBoxAutoStartMachine.Checked;
|
|---|
| 68 | end;
|
|---|
| 69 |
|
|---|
| 70 | end.
|
|---|
| 71 |
|
|---|