Overview
TheTChildManager base class and its descendants determine how parent and children nodes are arranged on screen when nodes have their AutoPosition property enabled.
Child managers are assigned to
Tree.GlobalFormat.ChildManager and control the layout for all auto-positioned nodes in the tree.Base Class: TChildManager
TheTChildManager class provides the foundation for all layout algorithms:
All child manager classes must implement
XPosition, YPosition, and CalcXYCross methods to define their layout algorithm.TTreeExplorerAlignChild
The default child manager providing Windows Explorer-style layout (vertical hierarchy, left-aligned):Configuration Properties
Layout Behavior
Layout Behavior
- Children are positioned to the right of their parent
- Siblings are stacked vertically
- CrossBox appears to the left of nodes with children
- Connections use multi-segment paths (csSides style)
Example Usage
Example Usage
TTreeExplorerAlignRight
Mirror of the Explorer layout with nodes expanding to the left:Useful for right-to-left tree layouts or organizational charts with reversed hierarchy.
TTreeTopBottomAlignChild
Arranges children below their parent in a horizontal row:Layout Characteristics
Vertical Hierarchy
Parent at top, children arranged horizontally below
Centered Alignment
Children centered under parent node
Vertical Connections
Multi-segment connections running downward
Bottom CrossBox
CrossBox positioned below parent node
Connection Drawing
TTreeLeftRightAlignChild
Arranges children to the right of their parent in a vertical column:Similar to
TTreeExplorerAlignChild but with different spacing defaults and connection style optimized for wider spacing.TTreeCircularAlignChild
Arranges children in a circular pattern around their parent:Properties
Position Calculation
Example Configurations
Full Circle
Full Circle
Semicircle
Semicircle
Elliptical
Elliptical
TTreeListViewAlignChild
Arranges nodes in a grid pattern, similar to list view controls:Properties
Layout Behavior
- Nodes arranged in columns and rows
- Rows calculated based on tree height
- Columns auto-sized or fixed width
- No connections drawn between nodes
- Optimal for flat lists or grid displays
Connections are not drawn in list view mode. The
DrawConnection method returns True but doesn’t render anything.Creating Custom Child Managers
You can create custom layout algorithms by deriving fromTChildManager:
Applying Child Managers
The child manager is stored in
Tree.GlobalFormat and applies to all nodes with AutoPosition enabled.Common Patterns
Switching Layouts Dynamically
Configuring Connection Styles
Best Practices
Choose Appropriate Layout
Select the child manager that best fits your data structure and visual requirements
Adjust Margins
Fine-tune spacing properties for optimal visual density and clarity
Consider Performance
Complex layouts (like circular) may be slower with large numbers of nodes
Test Interactively
Ensure nodes and connections respond well to expansion, collapse, and selection
Comparison Table
Next Steps
Nodes
Learn about node AutoPosition properties
Connections
Understand connection point calculation
Layout Examples
See practical layout implementations
