tuc
06-07-2007, 02:04 AM
Hi
Whilst working with the TreeView interface via SWAPI, I realised that it did not meet my needs as it is currently implemented. In particular the lack of "lParam" support. The "lParam" allows you to stored an integer for each node in the treeview, which is a far better reference item that the text name.
I decided to write a small class as an experiment to resolve this and at the same time also added some extra functionality, in particular the "walk" function. Which will traverse the entire tree from the starting node including all sub-nodes/children. The standard Next/Prev functions in SWAPI and my TreeClass only interate over the nodes at the same level within the tree.
I have tried to comment the code and have provided a small demo program to show its functionality.
I have also implemented "Find" methods as well.
Please feel free to use and abuse and any comments / updates or recommendations are always welcome.
As you will see in the TreeView.pll file, I have borrowed heavily on the existing code from SWAPI. No point in re-inventing the wheel totally.
Until SWAPI includes some of this functionality in a future release, this class fills in some of the gaps.
Note.
When the class is instantiated, the handle of the treeview component of passed to the class and maintained internally. No further reference to the original treeview handle is required.
You can freely interchange between the TreeView class and the standard SWAPI functions at any time.
Tuc
Long live PPL[br]1181178251_117_FT0_tv.zip
Whilst working with the TreeView interface via SWAPI, I realised that it did not meet my needs as it is currently implemented. In particular the lack of "lParam" support. The "lParam" allows you to stored an integer for each node in the treeview, which is a far better reference item that the text name.
I decided to write a small class as an experiment to resolve this and at the same time also added some extra functionality, in particular the "walk" function. Which will traverse the entire tree from the starting node including all sub-nodes/children. The standard Next/Prev functions in SWAPI and my TreeClass only interate over the nodes at the same level within the tree.
I have tried to comment the code and have provided a small demo program to show its functionality.
I have also implemented "Find" methods as well.
Please feel free to use and abuse and any comments / updates or recommendations are always welcome.
As you will see in the TreeView.pll file, I have borrowed heavily on the existing code from SWAPI. No point in re-inventing the wheel totally.
Until SWAPI includes some of this functionality in a future release, this class fills in some of the gaps.
Note.
When the class is instantiated, the handle of the treeview component of passed to the class and maintained internally. No further reference to the original treeview handle is required.
You can freely interchange between the TreeView class and the standard SWAPI functions at any time.
Tuc
Long live PPL[br]1181178251_117_FT0_tv.zip