TBaseVirtualTree.MoveTo Method (PVirtualNode, PVirtualNode, TVTNodeAttachMode, Boolean)

Virtual Tree View

Snow earth.bmp
TBaseVirtualTree.MoveTo Method (PVirtualNode, PVirtualNode, TVTNodeAttachMode, Boolean)

Moves Source and all its child nodes to Target.

Pascal
procedure MoveTo(Source: PVirtualNode; Target: PVirtualNode; Mode: TVTNodeAttachMode; ChildrenOnly: Boolean); overload;
procedure MoveTo(Node: PVirtualNode; Tree: TBaseVirtualTree; Mode: TVTNodeAttachMode; ChildrenOnly: Boolean); overload;
Description

Moves the given node (and all its children) to Target. Source must belong to the tree instance which calls this MoveTo method. Mode determines how to connect Source to Target. This method might involve a change of the tree if Target belongs to a different tree than Source

 

The variant taking a tree reference as target can be used to transfer nodes to a different tree, without determining its root node first. However one can also pass in any virtual tree node as target, as long as it belongs to a tree. The owning tree is automatically determined and an optimized path is taken if the operation happens within one tree. In this case simply the source node is disconnected from the old place and reconnected at the new location.

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