source: trunk/Packages/TemplateGenerics/Generic/GenericTree.inc

Last change on this file was 29, checked in by chronos, 12 years ago
  • Modified: Packages stored as uncompressed files.
File size: 1.5 KB
Line 
1{$IFDEF INTERFACE}
2
3 TGTreeNode = class;
4
5{$DEFINE TGListIndex := TGTreeIndex}
6{$DEFINE TGListItem := TGTreeNode}
7{$DEFINE TGList := TGTreeNodeList}
8{$DEFINE TGListSortCompare := TGTreeSortCompare}
9{$DEFINE TGListToStringConverter := TGTreeToStringConverter}
10{$DEFINE TGListFromStringConverter := TGTreeFromStringConverter}
11{$DEFINE TGListItemArray := TGTreeItemArray}
12{$DEFINE INTERFACE}
13{$I 'GenericList.inc'}
14
15 // TGTreeNode<TGTreeIndex, TGTreeItem> = class
16 TGTreeNode = class
17 Childs: TGTreeNodeList;
18 Value: TGTreeItem;
19 procedure Clear;
20 end;
21
22 // TGTree<TGTreeIndex, TGTreeItem> = class
23 TGTree = class
24 TopItem: TGTreeNode;
25 procedure Clear;
26 end;
27
28{$UNDEF INTERFACE}
29{$ENDIF}
30
31{$IFDEF IMPLEMENTATION_USES}
32
33 {$DEFINE IMPLEMENTATION_USES}
34 {$I 'GenericList.inc'}
35
36{$UNDEF INTERFACE_USES}
37{$ENDIF}
38
39
40{$IFDEF IMPLEMENTATION}
41{$UNDEF IMPLEMENTATION}
42
43{$DEFINE TGListIndex := TGTreeIndex}
44{$DEFINE TGListItem := TGTreeNode}
45{$DEFINE TGList := TGTreeNodeList}
46{$DEFINE TGListSortCompare := TGTreeSortCompare}
47{$DEFINE TGListToStringConverter := TGTreeToStringConverter}
48{$DEFINE TGListFromStringConverter := TGTreeFromStringConverter}
49{$DEFINE TGListItemArray := TGTreeItemArray}
50{$DEFINE IMPLEMENTATION}
51{$I 'GenericList.inc'}
52
53{ TGTreeNode }
54
55procedure TGTreeNode.Clear;
56begin
57 Childs.Clear;
58end;
59
60{ TGTree }
61
62procedure TGTree.Clear;
63begin
64 if Assigned(TopItem) then TopItem.Clear;
65end;
66
67{$UNDEF IMPLEMENTATION}
68{$ENDIF}
Note: See TracBrowser for help on using the repository browser.