Skip to main content
Child managers are classes that control the automatic positioning of nodes and the drawing of connections in TeeTree. They implement different layout algorithms for organizing hierarchical structures.

Overview

The TChildManager 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

The TChildManager 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

  • 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)

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

Circular layouts work best with a small number of children (typically under 12) to avoid overlap.

Example Configurations

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 from TChildManager:
Always call Tree.Invalidate after changing child manager properties to refresh the layout.

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