Class THETreeView (unit HETreeView) |
Inherits from
TTreeView
TTREEVIEW:
128 sec. to load 1000 items (no sorting)*
270 sec. to save 1000 items (4.5 minutes!!!)
THETREEVIEW:
1.5 sec. to load 1000 items - about 850% faster!!! (2.3 seconds with sorting = stText)*
0.7 sec. to save 1000 items - about 3850% faster!!!
NOTES:
- All timings performed on a slow 486SX 33 MhZ, 20 Mb RAM.
- * If the treeview is empty, loading takes 1.5 seconds,
else add 1.5 seconds to clear 1000 items (a total loading time of 3 seconds).
This is also the case for the TTreeView component (a total of 129.5 seconds).
The process of clearing the items, is a call to
SendMessage(hwnd, TVM_DELETEITEM, 0, Longint(TVI_ROOT)).
constructor Create(AOwner: TComponent);
- with Node1 do
if Assigned(TreeView.
function AlphaSort: Boolean;
function CustomSort(SortProc: TTVCompare; Data: Longint): Boolean;
procedure GetItemList(AList: TStrings);
Switch sorting back to whatever it was.
function IsItemBold(ANode: TTreeNode): Boolean;
'Bold' should have been a property of TTreeNode, but.
procedure LoadFromFile(const AFileName: string);
procedure Print;
DOWN
procedure SaveToFile(const AFileName: string);
procedure SetItemBold(ANode: TTreeNode; Value: Boolean);
procedure SetItemList(AList: TStrings);
procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState;
var Accept: Boolean);
function GetItemText(ANode: TTreeNode): string;
procedure SetSortType(Value: TSortType);
property PrintOutTitle : string
property SortType : TSortType
FPrintOutTitle : string;
FSortType : TSortType;
constructor Create(AOwner: TComponent);
with Node1 do
if Assigned(TreeView.OnCompare) then
TreeView.OnCompare(Node1.TreeView, Node1, Node2, lParam, Result)
else
function AlphaSort: Boolean;
function CustomSort(SortProc: TTVCompare; Data: Longint): Boolean;
procedure GetItemList(AList: TStrings);
Switch sorting back to whatever it was...
function IsItemBold(ANode: TTreeNode): Boolean;
'Bold' should have been a property of TTreeNode, but...
procedure LoadFromFile(const AFileName: string);
procedure Print;
DOWN
procedure SaveToFile(const AFileName: string);
procedure SetItemBold(ANode: TTreeNode; Value: Boolean);
procedure SetItemList(AList: TStrings);
procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState;
var Accept: Boolean);
function GetItemText(ANode: TTreeNode): string;
procedure SetSortType(Value: TSortType);
property PrintOutTitle : string
property SortType : TSortType
FPrintOutTitle : string;
FSortType : TSortType;