Sign in Join
FPDoc Onlineexperiment

TTreeNode class

In unit ComCtrls

Implements a tree node displayed in a TTreeView control.

Declaration

pascal
TTreeNode = class(TPersistent)

Inheritance

  1. TTreeNode
  2. TPersistent
  3. TObject

Descends from it: TShellTreeNode

Description

A TTreeNode implements a node which is part a hierarchical tree structure displayed in a TTreeView control.

TTreeNode has properties with the content displayed for the tree node like: Text, Data, ImageIndex, and OverlayIndex. It has properties which indicate the state for the node on the tree view control like: Cut, Deleting, Expanded, Focused, IsVisible, Selected, MultiSelected, States, Visible, and Enabled. It also includes properties that represent its relationship and position in the hierarchical tree structure like: TreeView, Owner / TreeNodes, Parent, Items, Level, Index, and AbsoluteIndex.

Methods are provided to locate and navigate between the parent, sibling, and child nodes in the tree structure.

Tree nodes are normally created and maintained using the TTreeNodes container which is the Owner for the tree node.

An excellent tutorial for using TTreeView, TTreeNodes, and TTreeNode can be found at:

TTreeView Page on the Lazarus Wiki

See also

Properties

AbsoluteIndexpublicThe absolute ordinal position for the node, regardless of its level or ancestry, in the tree node hierarchy.
CountpublicThe number of nodes which have the current node as the Parent node.
CutpublicIndicates if the tree node has been cut from the tree structure.
DatapublicPointer to the custom data for the node.
DeletingpublicTrue if the node has been marked for deletion in the associated tree view control.
DropTargetpublicTrue if the node is a drop target in a drag and drop operation.
ExpandedpublicTrue if the node has been expanded, False when collapsed.
FocusedpublicTrue if the node has focus in the TreeView control.
HandlepublicHandle for the tree view control which owns the TreeNodes container and the tree node.
HasChildrenpublicIndicates whether the tree node has child nodes.
HeightpublicThe height for the node including its text, images, and indicators.
ImageIndexpublicOrdinal position for the image displayed for the node, or -1 when no image is assigned.
IndexpublicOrdinal position for the node in its parent node.
IsFullHeightVisiblepublicTrue if the entire node is visible in the display area for the associated TreeView control.
IsVisiblepublicTrue if the node is visible.
ItemspublicProvides indexed access to the child nodes for the current node.
LevelpublicThe number of ancestor nodes for the current tree node.
MultiSelectedpublicIndicates whether the node is one of several nodes selected simultaneously (e.g. using the Shift or Ctrl key while selecting on a tree view control).
NodeEffectpublicGraphic drawing effect applied to the node in the associated TreeView control.
OverlayIndexpublicOrdinal position for the overlay image used for the node.
OwnerpublicOwner of the tree node instance.
ParentpublicParent node for the current tree node.
SelectedpublicTrue if the current node is selected in the tree view control.
SelectedIndexpublicOrdinal position for the image displayed when the tree node is Selected.
StateIndexpublicOrdinal position for the image displayed to represent the state for the tree node.
StatespublicContains active state flags for the tree node.
SubTreeCountpublicThe number of subtrees in the ancestor nodes for the class instance.
TextpublicText displayed for the tree node.
ToppublicVertical coordinate for the top of the tree node.
TreeNodespublicThe container where the tree node is stored, and the owner of the class instance.
TreeViewpublicThe tree view control where the node is displayed.
VisiblepublicTrue if the tree node is visible in the associated TreeView control.
EnabledpublicControls whether the tree node can be selected, and its visual appearance.

Methods

ChangedprotectedPerforms a change notification for the node with the specified reason.
GetOwnerprotectedGets the owner of the object instance.
CreatepublicConstructor for the class instance.
DestroypublicDestructor for the class instance.
AlphaSortpublicSorts the top-level child nodes in Items.
BottompublicGets the vertical coordinate for the bottom of the tree node.
BottomExpandedpublicGets the bottom coordinate for the last visible, expanded child node in the subtree.
CustomSortpublicCustomSort - Sorts the child nodes using SortProc.
DefaultTreeViewSortpublicDefault routine used to returns a numeric value with the sort order for the specified tree nodes.
DisplayExpandSignLeftpublicReturns the position for the left edge of the expand / collapse indicator.
DisplayExpandSignRectpublicReturns the coordinates for the rectangle within which the expand / collapse indicator is displayed.
DisplayExpandSignRightpublicReturns the position for the right edge of the expand / collapse indicator (accounting for the width of the icon, etc.).
DisplayIconLeftpublicReturns the horizontal position for the left edge of the icon displayed for the tree node.
DisplayRectpublicReturns the rectangle where the tree node is displayed on its TreeView control.
DisplayStateIconLeftpublicReturns the horizontal position for the left edge of the State icon on the tree node.
DisplayTextLeftpublicReturns the position for the left edge of the text on the tree node.
DisplayTextRightpublicReturns the horizontal position for the right edge of the Text on the tree node.
EditTextpublicEdits the text for the node in the associated TreeView control.
FindNodepublicGets the child tree node in Items with the specified text.
GetFirstChildpublicGets the first child node in the Items property.
GetFirstSiblingpublicGets the first tree node at the same level in the tree.
GetFirstVisibleChildpublicGets the tree node that is the first visible child node in the subtree.
GetHandlepublicGets the value for the Handle property.
GetLastChildpublicGets the last tree node that is a top-level child node in Items.
GetLastSiblingpublicGets the last node at the same level as the current node.
GetLastSubChildpublicReturns the last child node or its last descendent node.
GetLastVisibleChildpublicGets the last child node in the subtree with its Visible property set to True.
GetNextpublicGets the next node in the tree hierarchy.
GetNextChildpublicReturns the next child node for the parent node specified in AValue.
GetNextExpandedpublicReturns the next expanded tree node in the node hierarchy.
GetNextMultiSelectedpublicReturns the next tree node which is included in a multi-selected range of nodes.
GetNextSiblingpublicReturns the next node in the tree hierarchy at the same level as the current node.
GetNextSkipChildrenpublicGets the next sibling for the current tree node, or Nil when a sibling node does not exist.
GetNextVisiblepublicGets the next visible node child or sibling for the current node.
GetNextVisibleSiblingpublicGets the next visible node at the same level in the node tree.
GetParentNodeOfAbsoluteLevelpublicGetParentNodeOfAbsoluteLevel - returns the parent of all nodes at this absolute level.
GetPrevpublicGets the previous node in the tree hierarchy.
GetPrevChildpublicGets the previous child node starting at the specified child node.
GetPrevExpandedpublicReturns the previous expanded tree node in the node hierarchy.
GetPrevMultiSelectedpublicGetPrevMultiSelected - returns the previous node in a multi-selection.
GetPrevSiblingpublicGetPrevSibling - returns the previous node in the same level as the current node.
GetPrevVisiblepublicReturns the previous visible (not hidden) tree node in the node hierarchy.
GetPrevVisibleSiblingpublicGets the previous visible sibling tree node for the current node.
GetTextPathpublicGets the hierarchical path to the tree node in the tree view.
HasAsParentpublicReturns True if the specified node is a parent for the current node.
IndexOfpublicGet the index position for the specified child tree node.
IndexOfTextpublicReturns the ordinal position for the last child node containing the specified Text.
AssignpublicImplements object persistence for the TTreeNode type.
CollapsepublicCollapses the current tree node, and optionally collapses any descendent nodes.
ConsistencyCheckpublicEnsures that node references to or from the current tree node are valid and consistent.
DeletepublicFrees the current tree node when the Deleting property is not True.
DeleteChildrenpublicRemoves all child nodes and descendants in the tree structure.
EndEditpublicEnds editing of the tree node in the associated tree view control.
ExpandpublicExpands the current tree node, and optionally all descendent nodes.
ExpandParentspublicExpands all tree nodes which are an ancestor of the current node.
FreeAllNodeDatapublicFrees the Pointer in Data, including any child nodes in Items.
MakeVisiblepublicForces the tree node to become visible.
MoveTopublicRelocates a node to the specified Destination node using the specified mode of attachment.
MultiSelectGrouppublicAdds the group of nodes between a selected node and the current node to a multi-selection range.
UpdatepublicRedraws the associated TreeView control if an update is not already in progress.
WriteDebugReportpublicWriteDebugReport - for debugging. If Recurse is True, report for all descendants as well.

Inherited

From TPersistent (6)

AssignTo DefineProperties FPOAttachObserver FPODetachObserver FPONotifyObservers GetNamePath

From TObject (40)

AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.