AczTreeView component, version 1.0
Shareware
(C) Copyright 2001, John Zhou
Email: aczgrp@263.net
ALLOWED:
AczTreeView is a shareware, You can use it for commercial freely after you've bought it. Buy Now
NOT ALLOWED:
1. Forbidden to sell AczTreeView component or sell in other name.
2. Forbidden to Licensed to any other person.
The AczTreeView 1.0 provides you with a powerful and easy-to-use tree component for the display of recursive data in an application. The AczTreeView 's distinct improvement from the common TreeView component in Delphi is those features described below:
(1) Data Aware
The AczTreeView will automatically attach a unique ID of integer type to every treenode.
When a treenode is created in AczTreeView, an internal ID is automatically attached to it, and this ID is unique wherever the treenode is moved in the tree. And all treenodes' ID will keep the same whenever the tree is saved and loaded.
You can get any treenode's ID in the AczTreeView at anytime.The method is quite simple, just to call a function of AczTreeView.GetNodeID with the parameter of a treenode which ID you want to know.
A treenode's ID is useful for accessing detailed information about the treenode in a user's database.
(2) Smart Saving
It is very easy to save the entire tree with all treenodes' unique ID, expanded status ,imageindex and selectedindex to a specified file.
(3) Smart Loading
It is very easy to load an entire tree with its status as it was saved before from a specified file. All treenodes in this tree has just the same unique ID, expanded status, imageindex and selectedindex as they were saved.
In short, if you have a need to represent self-referenced data structures within your application, there is no substitute for the AczTreeView.
The core design principle behind the AczTreeView component is that of simplicity.
Here are the steps to bind data to the AczTreeView:
(1) In your own database, create a table in witch there is a key field "ID" refered to treenodes' ID in the AczTreeView, and there are several other fields refered to detailed information about the treenodes.
(2) Call function AczTreeView.GetNodeID to get the ID of a specified treenode in the AczTreeView, for example:
NodeID := AczTreeView1.GetNodeID( AczTreeView1.Selected );
(3) With the ID of the selected treenode, now you are on your way to access some data about this treenode in your own table of your own database.
Ultimately, the AczTreeView works very much like a common TreeView. It supports all of the Properties, Events, and Methods of a standard TreeView control. You can easily add, edit, move, delete and drag tree nodes. The AczTreeView handles all other chores and responsibilities behind the scenes to eliminate any and all difficulties you would normally face when binding data to a Non-Data aware tree.
The component can be used after installing it the normal way in Delphi 4. Someone told me it also works for Delphi 5 and I guess it will also work for Delphi 3 and would appreciate when somebody can mail me if it indeed works. Please ignore the compile hints.
To install (Delphi 4):
Just unpack the zip-file into a directory where you want to keep your components. Then choose [File],[Open] and select the file 'AczTreeView.dpk'. In the new window you should choose [install]. The component will be placed under [samples].
Properties
Properties | Type | Description |
Registered | Boolean | If you have called the procedure
AczTreeView.RegisterAcz( SerialNumber, ActiveKey ), and
the SerialNumber and ActiveKey is correct, the value of
this property will be true, otherwise it will be false. Besides, you must excute the register program called "RegisterAcz.exe" downloaded along with the AczTreeView component to get the correct SerialNumber. And you you will get the correct ActiveKey after you have paid for AczTreeView component. Refer to the chapter "Register the component" to get detailed information. |
Functions and Procedures
Function and Procedure | Function Description |
function GetNodeID( Node: TTreeNode ): integer; | Return the unique ID of
the treenode specified by the parameter. |
function GetPath( Node: TTreeNode ): string; | Return the path from
root of the tree downto the treenode specified by the parameter, including all ancestors of this treenode. |
function AddNewNode( Node: TTreeNode; Text: string ): TTreeNode; | Add a new treenode as a
child of the treenode specified by the parameter "Node". And the "Text" property of the new treenode is the same as the parameter "Text". This function return the new treenode created. |
procedure SaveTree ( FileName: string ); | Save the entire
AczTreeView with all treenodes' unique ID, expanded status ,imageindex and selectedindex to a specified file. |
procedure LoadTree ( FileName: string ); | Load an entire
AczTreeView from a specified file with all treenodes'
unique ID, imageindex and selectedindex. When the AczTreeView is loaded this way, it is not expanded. |
procedure LoadExpandedTree ( FileName: string ); | Load an entire
AczTreeView from a specified file with all treenodes'
unique ID, expanded status, imageindex and selectedindex. When the AczTreeView is loaded this way, it is expanded just the same way as it was saved. |
procedure RegisterAcz( SerialNumber: string, ActiveKey:string ); | Register the AczTreeView component. |
Events
Events | Description |
OnIOError | Occurs if there's some
error in openning,closing,reading or writing the file
when you call one of the procedures:SaveTree, LoadTree and LoadExpandedTree. |
OnMemError | Occurs if there's some error in operating the treeview. |
In the AczTreeView, every treenode's ID is attach to the property "Data". Don't try to access "Data" property of every treenode.
Thank you for your interest in AczTreeView. If you find it useful in your own projects, please support the shareware concept. Much time and effort was put into providing a quality component along with adequate documentation and demos.
Registered users will take all advantage of AczTreeView. Meanwhile registered users' application software can depend upon the AczTreeView component properly and can be distributed anywhere.
Before registered, the AczTreeView only supports saving limited number of treenodes which ID is less than 20 to a file.
Register steps
(1) Excute a program file named "RegisterAcz.exe" which is provided along with the AczTreeView component.
(2) Click the button "Get Serial" to get the SERIAL NUMBER for the AczTreeView component downloaded. Write down this SERIAL NUMBER.
(3)Goto Order URL to pay for the AczTreeView component and meanwhile give the SERIAL NUMBER on the web page. Then you will receive an ACTIVE KEY from the web.
(4)In your Application, before you call any other procedures or functions of AczTreeView component, call the register procedure at first:
procedure AczTreeView.RegisterAcz( SerialNumber: string, ActiveKey: string);
If the serial number and active key are correct, a flag which decide the status of registered will be assigned a value of true. for example:
AczTreeView1.RegisterAcz( 'UKL8EEJ1836', '1339883' );
I suggest that you can call this register procedure within the "FormCreate" procedure that is attached to the event "OnCreate" of the form on which the AczTreeView component is placed.
Now you are the legal owner of the AczTreeView component, and you will take all advantage of it, and your application software can depend upon it. And you will be ready to distribute your appliction anywhere.
End.