Last change
on this file was 73, checked in by chronos, 12 years ago |
- Modified: Packages are now stored as uncomporessed and are linked with relative path to project.
|
File size:
1.2 KB
|
Line | |
---|
1 | unit UComponentTree;
|
---|
2 |
|
---|
3 | {$mode delphi}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
---|
9 | ComCtrls;
|
---|
10 |
|
---|
11 | type
|
---|
12 |
|
---|
13 | { TComponentTree }
|
---|
14 |
|
---|
15 | TComponentTree = class(TForm)
|
---|
16 | TreeView1: TTreeView;
|
---|
17 | procedure FormShow(Sender: TObject);
|
---|
18 | private
|
---|
19 | { private declarations }
|
---|
20 | public
|
---|
21 | procedure ReloadNode(Node: TTreeNode; Component: TComponent);
|
---|
22 | procedure Reload;
|
---|
23 | end;
|
---|
24 |
|
---|
25 | var
|
---|
26 | ComponentTree: TComponentTree;
|
---|
27 |
|
---|
28 | implementation
|
---|
29 |
|
---|
30 | uses
|
---|
31 | UMainForm;
|
---|
32 |
|
---|
33 | { TComponentTree }
|
---|
34 |
|
---|
35 | procedure TComponentTree.FormShow(Sender: TObject);
|
---|
36 | begin
|
---|
37 | Reload;
|
---|
38 | end;
|
---|
39 |
|
---|
40 | procedure TComponentTree.ReloadNode(Node: TTreeNode; Component: TComponent);
|
---|
41 | var
|
---|
42 | I: Integer;
|
---|
43 | NewNode: TTreeNode;
|
---|
44 | begin
|
---|
45 | NewNode := Node.TreeNodes.AddChild(Node, Component.Name + ': ' + Component.ClassName);
|
---|
46 | for I := 0 to Component.ComponentCount - 1 do
|
---|
47 | ReloadNode(NewNode, Component.Components[I]);
|
---|
48 | end;
|
---|
49 |
|
---|
50 | procedure TComponentTree.Reload;
|
---|
51 | begin
|
---|
52 | with TreeView1, Items do begin
|
---|
53 | BeginUpdate;
|
---|
54 | Clear;
|
---|
55 | AddChild(nil, 'Root');
|
---|
56 | ReloadNode(TopItem, Application);
|
---|
57 | TopItem.Expand(True);
|
---|
58 | EndUpdate;
|
---|
59 | end;
|
---|
60 | end;
|
---|
61 |
|
---|
62 | initialization
|
---|
63 | {$I UComponentTree.lrs}
|
---|
64 |
|
---|
65 | end.
|
---|
66 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.