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