TTreeNodeShape class is the fundamental building block of TeeTree. Each node is a full standalone component with comprehensive properties, methods, and events.
Overview
Unlike traditional tree controls where nodes are simple data items, TeeTree nodes are complete visual components with rich formatting capabilities.Every node in TeeTree is a
TTreeNodeShape instance derived from TCustomTreeElement, which provides core functionality shared with connections.Node Properties
Position and Size
Nodes have explicit position and size properties:Left and Top are aliases for X0 and Y0 respectively. Use whichever is more intuitive for your code.Visual Appearance
Colors and Brushes
Colors and Brushes
Gradients
Gradients
Shadows
Shadows
Node Styles
Nodes support various visual styles:Text Properties
Nodes have sophisticated text handling:AutoSize
Nodes can automatically size themselves based on content:When
AutoSize is enabled, the node calculates its size based on text and image dimensions plus margins.Images
Nodes can display images in various positions:Image Alignment Options
Parent-Child Relationships
Nodes form hierarchies through parent-child relationships:When a parent node is destroyed, all its children are automatically freed.
Child Management Methods
Expand and Collapse
Nodes can be expanded or collapsed to show/hide children:CrossBox Styles
AutoPosition
Control automatic positioning of nodes:The
ChildManager class calculates positions for nodes with AutoPosition enabled. See Child Managers for details.Selection and Interaction
Event Handlers
Node Navigation
Visibility Control
Data Association
Advanced Features
Checkboxes
Custom Drawing
Z-Order
Utility Methods
Best Practices
Use AutoSize
Let nodes automatically size themselves based on content for consistent appearance
Leverage Parent-Child
Use parent-child relationships instead of manual positioning when possible
Cache References
Store node references in data structures for quick access instead of searching
Handle Events
Use node events for interactive features rather than polling
Next Steps
Connections
Learn how to link nodes together
Child Managers
Understand automatic layout management
Styling Guide
Master visual customization
