1 | unit FormCompileMultiple;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls,
|
---|
7 | Target;
|
---|
8 |
|
---|
9 | type
|
---|
10 |
|
---|
11 | { TFormCompileMultiple }
|
---|
12 |
|
---|
13 | TFormCompileMultiple = class(TForm)
|
---|
14 | ButtonCompile: TButton;
|
---|
15 | ButtonCancel: TButton;
|
---|
16 | ListViewTargets: TListView;
|
---|
17 | procedure ButtonCompileClick(Sender: TObject);
|
---|
18 | procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
---|
19 | procedure FormCreate(Sender: TObject);
|
---|
20 | procedure FormDestroy(Sender: TObject);
|
---|
21 | procedure FormShow(Sender: TObject);
|
---|
22 | private
|
---|
23 | FTargets: TTargets;
|
---|
24 | public
|
---|
25 | procedure ReloadList;
|
---|
26 | property Targets: TTargets read FTargets write FTargets;
|
---|
27 | end;
|
---|
28 |
|
---|
29 |
|
---|
30 | implementation
|
---|
31 |
|
---|
32 | {$R *.lfm}
|
---|
33 |
|
---|
34 | uses
|
---|
35 | Core;
|
---|
36 |
|
---|
37 | procedure TFormCompileMultiple.FormCreate(Sender: TObject);
|
---|
38 | begin
|
---|
39 | Core.Core.Translator.TranslateComponentRecursive(Self);
|
---|
40 | Core.Core.ThemeManager.UseTheme(Self);
|
---|
41 | end;
|
---|
42 |
|
---|
43 | procedure TFormCompileMultiple.FormClose(Sender: TObject;
|
---|
44 | var CloseAction: TCloseAction);
|
---|
45 | begin
|
---|
46 | Core.Core.PersistentForm1.Save(Self);
|
---|
47 | end;
|
---|
48 |
|
---|
49 | procedure TFormCompileMultiple.ButtonCompileClick(Sender: TObject);
|
---|
50 | var
|
---|
51 | I: Integer;
|
---|
52 | begin
|
---|
53 | for I := 0 to ListViewTargets.Items.Count - 1 do
|
---|
54 | TTarget(ListViewTargets.Items[I].Data).Selected :=
|
---|
55 | ListViewTargets.Items[I].Checked;
|
---|
56 | end;
|
---|
57 |
|
---|
58 | procedure TFormCompileMultiple.FormDestroy(Sender: TObject);
|
---|
59 | begin
|
---|
60 | end;
|
---|
61 |
|
---|
62 | procedure TFormCompileMultiple.FormShow(Sender: TObject);
|
---|
63 | begin
|
---|
64 | Core.Core.PersistentForm1.Load(Self);
|
---|
65 | ReloadList;
|
---|
66 | end;
|
---|
67 |
|
---|
68 | procedure TFormCompileMultiple.ReloadList;
|
---|
69 | var
|
---|
70 | I: Integer;
|
---|
71 | ListItem: TListItem;
|
---|
72 | begin
|
---|
73 | if Assigned(Targets) then
|
---|
74 | for I := 0 to Targets.Count - 1 do
|
---|
75 | with Targets[I] do begin
|
---|
76 | ListItem := ListViewTargets.Items.Add;
|
---|
77 | ListItem.Caption := Name;
|
---|
78 | ListItem.Checked := Selected;
|
---|
79 | ListItem.Data := Targets[I];
|
---|
80 | end;
|
---|
81 | end;
|
---|
82 |
|
---|
83 | end.
|
---|
84 |
|
---|