Last change
on this file was 19, checked in by chronos, 7 years ago |
- Fixed: Build under Lazarus 1.8.0.
- Modified: Updated Common package.
|
File size:
1.4 KB
|
Line | |
---|
1 | unit UFormProjectGroup;
|
---|
2 |
|
---|
3 | {$mode delphi}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
|
---|
9 | Menus, ActnList, UProject, LazFileUtils;
|
---|
10 |
|
---|
11 | type
|
---|
12 |
|
---|
13 | { TFormProjectGroup }
|
---|
14 |
|
---|
15 | TFormProjectGroup = class(TForm)
|
---|
16 | AAdd: TAction;
|
---|
17 | AModify: TAction;
|
---|
18 | ARemove: TAction;
|
---|
19 | ActionList1: TActionList;
|
---|
20 | MenuItem1: TMenuItem;
|
---|
21 | MenuItem2: TMenuItem;
|
---|
22 | MenuItem3: TMenuItem;
|
---|
23 | PopupMenu1: TPopupMenu;
|
---|
24 | TreeView1: TTreeView;
|
---|
25 | procedure FormShow(Sender: TObject);
|
---|
26 | private
|
---|
27 | { private declarations }
|
---|
28 | public
|
---|
29 | procedure ReloadTree;
|
---|
30 | procedure UpdateInterface;
|
---|
31 | end;
|
---|
32 |
|
---|
33 | var
|
---|
34 | FormProjectGroup: TFormProjectGroup;
|
---|
35 |
|
---|
36 | implementation
|
---|
37 |
|
---|
38 | {$R *.lfm}
|
---|
39 |
|
---|
40 | uses
|
---|
41 | UCore;
|
---|
42 |
|
---|
43 | { TFormProjectGroup }
|
---|
44 |
|
---|
45 | procedure TFormProjectGroup.FormShow(Sender: TObject);
|
---|
46 | begin
|
---|
47 | ReloadTree;
|
---|
48 | end;
|
---|
49 |
|
---|
50 | procedure TFormProjectGroup.ReloadTree;
|
---|
51 | var
|
---|
52 | I: Integer;
|
---|
53 | begin
|
---|
54 | TreeView1.Items.Clear;
|
---|
55 | if Assigned(Core.ProjectGroup) then begin
|
---|
56 | TreeView1.Items.AddChild(nil, ExtractFileNameOnly(Core.ProjectGroup.FileName));
|
---|
57 | for I := 0 to Core.ProjectGroup.Projects.Count - 1 do
|
---|
58 | TreeView1.Items.AddChildObject(TreeView1.TopItem,
|
---|
59 | ExtractFileName(TProject(Core.ProjectGroup.Projects[I]).Directory),
|
---|
60 | Core.ProjectGroup.Projects[I]);
|
---|
61 | end;
|
---|
62 | UpdateInterface;
|
---|
63 | end;
|
---|
64 |
|
---|
65 | procedure TFormProjectGroup.UpdateInterface;
|
---|
66 | begin
|
---|
67 | AModify.Enabled := Assigned(TreeView1.Selected);
|
---|
68 | ARemove.Enabled := Assigned(TreeView1.Selected);
|
---|
69 | end;
|
---|
70 |
|
---|
71 | end.
|
---|
72 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.