1 | unit FormTargetOptions;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
---|
7 | Target;
|
---|
8 |
|
---|
9 | type
|
---|
10 |
|
---|
11 | { TFormTargetOptions }
|
---|
12 |
|
---|
13 | TFormTargetOptions = class(TForm)
|
---|
14 | ButtonOk: TButton;
|
---|
15 | ButtonCancel: TButton;
|
---|
16 | ButtonCompiler: TButton;
|
---|
17 | ButtonExecute: TButton;
|
---|
18 | Edit1: TEdit;
|
---|
19 | Edit2: TEdit;
|
---|
20 | Label1: TLabel;
|
---|
21 | Label2: TLabel;
|
---|
22 | OpenDialog1: TOpenDialog;
|
---|
23 | procedure ButtonCompilerClick(Sender: TObject);
|
---|
24 | procedure ButtonExecuteClick(Sender: TObject);
|
---|
25 | procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
---|
26 | procedure FormCreate(Sender: TObject);
|
---|
27 | procedure FormShow(Sender: TObject);
|
---|
28 | public
|
---|
29 | procedure LoadControls(Target: TTarget);
|
---|
30 | procedure SaveControls(Target: TTarget);
|
---|
31 | end;
|
---|
32 |
|
---|
33 |
|
---|
34 | implementation
|
---|
35 |
|
---|
36 | {$R *.lfm}
|
---|
37 |
|
---|
38 | uses
|
---|
39 | Core;
|
---|
40 |
|
---|
41 | { TFormTargetOptions }
|
---|
42 |
|
---|
43 | procedure TFormTargetOptions.ButtonCompilerClick(Sender: TObject);
|
---|
44 | begin
|
---|
45 | OpenDialog1.FileName := Edit1.Text;
|
---|
46 | if OpenDialog1.Execute then Edit1.Text := OpenDialog1.FileName;
|
---|
47 | end;
|
---|
48 |
|
---|
49 | procedure TFormTargetOptions.ButtonExecuteClick(Sender: TObject);
|
---|
50 | begin
|
---|
51 | OpenDialog1.FileName := Edit2.Text;
|
---|
52 | if OpenDialog1.Execute then Edit2.Text := OpenDialog1.FileName;
|
---|
53 | end;
|
---|
54 |
|
---|
55 | procedure TFormTargetOptions.FormClose(Sender: TObject;
|
---|
56 | var CloseAction: TCloseAction);
|
---|
57 | begin
|
---|
58 | Core.Core.PersistentForm1.Save(Self);
|
---|
59 | end;
|
---|
60 |
|
---|
61 | procedure TFormTargetOptions.FormCreate(Sender: TObject);
|
---|
62 | begin
|
---|
63 | Core.Core.Translator.TranslateComponentRecursive(Self);
|
---|
64 | Core.Core.ThemeManager.UseTheme(Self);
|
---|
65 | end;
|
---|
66 |
|
---|
67 | procedure TFormTargetOptions.FormShow(Sender: TObject);
|
---|
68 | begin
|
---|
69 | Core.Core.PersistentForm1.Load(Self);
|
---|
70 | end;
|
---|
71 |
|
---|
72 | procedure TFormTargetOptions.LoadControls(Target: TTarget);
|
---|
73 | begin
|
---|
74 | Edit1.Text := Target.CompilerPath;
|
---|
75 | Edit2.Text := Target.ExecutorPath;
|
---|
76 | end;
|
---|
77 |
|
---|
78 | procedure TFormTargetOptions.SaveControls(Target: TTarget);
|
---|
79 | begin
|
---|
80 | Target.CompilerPath := Edit1.Text;
|
---|
81 | Target.ExecutorPath := Edit2.Text;
|
---|
82 | end;
|
---|
83 |
|
---|
84 | end.
|
---|
85 |
|
---|