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 | Button1: TButton;
|
---|
15 | Button2: TButton;
|
---|
16 | ButtonProducerSelect: TButton;
|
---|
17 | ButtonExecutorSelect: TButton;
|
---|
18 | EditProducer: TEdit;
|
---|
19 | EditExecutor: TEdit;
|
---|
20 | Label1: TLabel;
|
---|
21 | Label2: TLabel;
|
---|
22 | Label3: TLabel;
|
---|
23 | LabelName: TLabel;
|
---|
24 | OpenDialog1: TOpenDialog;
|
---|
25 | procedure ButtonProducerSelectClick(Sender: TObject);
|
---|
26 | procedure ButtonExecutorSelectClick(Sender: TObject);
|
---|
27 | private
|
---|
28 | { private declarations }
|
---|
29 | public
|
---|
30 | procedure LoadControls(Target: TTarget);
|
---|
31 | procedure SaveControls(Target: TTarget);
|
---|
32 | end;
|
---|
33 |
|
---|
34 |
|
---|
35 | implementation
|
---|
36 |
|
---|
37 |
|
---|
38 | {$R *.lfm}
|
---|
39 |
|
---|
40 | { TFormTargetOptions }
|
---|
41 |
|
---|
42 | procedure TFormTargetOptions.ButtonProducerSelectClick(Sender: TObject);
|
---|
43 | begin
|
---|
44 | OpenDialog1.FileName := EditProducer.Text;
|
---|
45 | if OpenDialog1.Execute then
|
---|
46 | EditProducer.Text := OpenDialog1.FileName;
|
---|
47 | end;
|
---|
48 |
|
---|
49 | procedure TFormTargetOptions.ButtonExecutorSelectClick(Sender: TObject);
|
---|
50 | begin
|
---|
51 | OpenDialog1.FileName := EditExecutor.Text;
|
---|
52 | if OpenDialog1.Execute then
|
---|
53 | EditExecutor.Text := OpenDialog1.FileName;
|
---|
54 | end;
|
---|
55 |
|
---|
56 | procedure TFormTargetOptions.LoadControls(Target: TTarget);
|
---|
57 | begin
|
---|
58 | LabelName.Caption := Target.Name;
|
---|
59 | ButtonExecutorSelect.Enabled := Assigned(Target.Executor);
|
---|
60 | EditExecutor.Enabled := Assigned(Target.Executor);
|
---|
61 | if Assigned(Target.Executor) then
|
---|
62 | EditExecutor.Text := Target.Executor.ExecutorPath
|
---|
63 | else EditExecutor.Text := '';
|
---|
64 | ButtonProducerSelect.Enabled := Assigned(Target.Producer);
|
---|
65 | EditProducer.Enabled := Assigned(Target.Producer);
|
---|
66 | if Assigned(Target.Producer) then
|
---|
67 | EditProducer.Text := Target.Producer.CompilerPath
|
---|
68 | else EditProducer.Text := '';
|
---|
69 | end;
|
---|
70 |
|
---|
71 | procedure TFormTargetOptions.SaveControls(Target: TTarget);
|
---|
72 | begin
|
---|
73 | Target.Executor.ExecutorPath := EditExecutor.Text;
|
---|
74 | Target.Producer.CompilerPath := EditProducer.Text;
|
---|
75 | end;
|
---|
76 |
|
---|
77 | end.
|
---|
78 |
|
---|