source: trunk/Forms/UFormProjectGroup.pas

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 
1unit UFormProjectGroup;
2
3{$mode delphi}
4
5interface
6
7uses
8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
9 Menus, ActnList, UProject, LazFileUtils;
10
11type
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
33var
34 FormProjectGroup: TFormProjectGroup;
35
36implementation
37
38{$R *.lfm}
39
40uses
41 UCore;
42
43{ TFormProjectGroup }
44
45procedure TFormProjectGroup.FormShow(Sender: TObject);
46begin
47 ReloadTree;
48end;
49
50procedure TFormProjectGroup.ReloadTree;
51var
52 I: Integer;
53begin
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;
63end;
64
65procedure TFormProjectGroup.UpdateInterface;
66begin
67 AModify.Enabled := Assigned(TreeView1.Selected);
68 ARemove.Enabled := Assigned(TreeView1.Selected);
69end;
70
71end.
72
Note: See TracBrowser for help on using the repository browser.