TBaseVirtualTree.IterateSubtree Method

Virtual Tree View

Iterator method to go through all nodes of a given sub tree.

Pascal
function IterateSubtree(Node: PVirtualNode; Callback: TVTGetNodeProc; Data: Pointer; Filter: TVirtualNodeStates = []; DoInit: Boolean = False; ChildNodesOnly: Boolean = False): PVirtualNode;
Description

IterateSubtree iterates through all children and grandchildren etc. of Node (or the entire tree if Node = nil) and calls for each node the provided callback method (which must not be empty). Filter determines which nodes are to be considered (an empty set denotes all nodes). If DoInit is true then nodes which aren't initialized yet will be initialized. 

 

During execution of the callback the application can set Abort to true. In this case the iteration is stopped and the last accessed node (the one on which the callback set Abort to true) is returned to the caller. Otherwise (no abort) nil is returned.

Notes

An application should not modify the content of the tree (e.g. delete nodes) during the iteration, otherwise the 

outcome is unpredictable and may result in an access violation.

Class
Links
What do you think about this topic? Send feedback!