Skip to content

Tree guides reference

TTreeGuideKind enumerates the glyph sets used by Tree to draw branches: the vertical "continue" line, the fork at sibling positions, the L-shape at the last child, and the horizontal arm.

Available kinds

KindGlyphs
Ascii|, +, `, - (always ASCII).
Line (default)─ │ ├ └
Heavy━ ┃ ┣ ┗
Double═ ║ ╠ ╚
BoldAlias for Heavy.

Non-unicode terminals automatically fall back to Ascii, regardless of the configured kind.

Glyph parts

TTreeGuidePart:

PartUsed for
SpaceEmpty depth slot (when an ancestor is the last child).
ContinueVertical line at a depth where an ancestor isn't the last child.
ForkBranch at a node that has more siblings below.
LastBranch at the last child of its parent.
HorizontalThe horizontal arm before the node label.

Usage

pascal
tree := Widgets.Tree('root').WithGuide(TTreeGuideKind.Heavy);

Get an ITreeGuide instance directly:

pascal
guide := Widgets.TreeGuide(TTreeGuideKind.Double);

Custom guides

Implement ITreeGuide to ship a custom glyph set. Your impl returns a Char per TTreeGuidePart plus the kind.

See also

Released under the MIT License.