source: trunk/IDE/Forms/FormTargets.pas

Last change on this file was 75, checked in by chronos, 6 months ago
  • Modified: Removed U prefix from unit names.
  • Modified: Updated Common package.
File size: 1.8 KB
Line 
1unit FormTargets;
2
3interface
4
5uses
6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
7 Menus, ActnList;
8
9type
10
11 { TFormTargets }
12
13 TFormTargets = class(TForm)
14 ATargetOptions: TAction;
15 ActionList1: TActionList;
16 ListView1: TListView;
17 PopupMenu1: TPopupMenu;
18 procedure ATargetOptionsExecute(Sender: TObject);
19 procedure FormShow(Sender: TObject);
20 procedure ListView1Data(Sender: TObject; Item: TListItem);
21 private
22 { private declarations }
23 public
24 procedure ReloadList;
25 end;
26
27
28implementation
29
30{$R *.lfm}
31
32uses
33 Core, FormMain, Compiler, Producer, Target, FormTargetOptions;
34
35resourcestring
36 SCompilerOptions = 'Compiler options';
37 SCompilerPath = 'Compiler path';
38
39{ TFormTargets }
40
41procedure TFormTargets.FormShow(Sender: TObject);
42begin
43 ReloadList;
44end;
45
46procedure TFormTargets.ATargetOptionsExecute(Sender: TObject);
47var
48 FormTargetOptions: TFormTargetOptions;
49begin
50 if Assigned(ListView1.Selected) then begin
51 FormTargetOptions := TFormTargetOptions.Create(nil);
52 FormTargetOptions.LoadControls(TTarget(ListView1.Selected.Data));
53 if FormTargetOptions.ShowModal = mrOk then begin
54 FormTargetOptions.SaveControls(TTarget(ListView1.Selected.Data));
55 ReloadList;
56 end;
57 FormTargetOptions.Free;
58 end;
59end;
60
61procedure TFormTargets.ListView1Data(Sender: TObject; Item: TListItem);
62begin
63 if (Item.Index >= 0) and (Item.Index < Core.Core.Compiler.Targets.Count) then
64 with TTarget(Core.Core.Compiler.Targets[Item.Index]) do begin
65 Item.Caption := Name;
66 Item.Data := Core.Core.Compiler.Targets[Item.Index];
67 //Item.SubItems.Add(Producer.CompilerPath);
68 end;
69end;
70
71procedure TFormTargets.ReloadList;
72begin
73 ListView1.Items.Count := Core.Core.Compiler.Targets.Count;
74 ListView1.Refresh;
75end;
76
77end.
78
Note: See TracBrowser for help on using the repository browser.