TTreeNode class
Implements a tree node displayed in a TTreeView control.
Declaration
TTreeNode = class(TPersistent)Inheritance
- TTreeNode
- TPersistent
- 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
AbsoluteIndex | public | The absolute ordinal position for the node, regardless of its level or ancestry, in the tree node hierarchy. |
Count | public | The number of nodes which have the current node as the Parent node. |
Cut | public | Indicates if the tree node has been cut from the tree structure. |
Data | public | Pointer to the custom data for the node. |
Deleting | public | True if the node has been marked for deletion in the associated tree view control. |
DropTarget | public | True if the node is a drop target in a drag and drop operation. |
Expanded | public | True if the node has been expanded, False when collapsed. |
Focused | public | True if the node has focus in the TreeView control. |
Handle | public | Handle for the tree view control which owns the TreeNodes container and the tree node. |
HasChildren | public | Indicates whether the tree node has child nodes. |
Height | public | The height for the node including its text, images, and indicators. |
ImageIndex | public | Ordinal position for the image displayed for the node, or -1 when no image is assigned. |
Index | public | Ordinal position for the node in its parent node. |
IsFullHeightVisible | public | True if the entire node is visible in the display area for the associated TreeView control. |
IsVisible | public | True if the node is visible. |
Items | public | Provides indexed access to the child nodes for the current node. |
Level | public | The number of ancestor nodes for the current tree node. |
MultiSelected | public | Indicates 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). |
NodeEffect | public | Graphic drawing effect applied to the node in the associated TreeView control. |
OverlayIndex | public | Ordinal position for the overlay image used for the node. |
Owner | public | Owner of the tree node instance. |
Parent | public | Parent node for the current tree node. |
Selected | public | True if the current node is selected in the tree view control. |
SelectedIndex | public | Ordinal position for the image displayed when the tree node is Selected. |
StateIndex | public | Ordinal position for the image displayed to represent the state for the tree node. |
States | public | Contains active state flags for the tree node. |
SubTreeCount | public | The number of subtrees in the ancestor nodes for the class instance. |
Text | public | Text displayed for the tree node. |
Top | public | Vertical coordinate for the top of the tree node. |
TreeNodes | public | The container where the tree node is stored, and the owner of the class instance. |
TreeView | public | The tree view control where the node is displayed. |
Visible | public | True if the tree node is visible in the associated TreeView control. |
Enabled | public | Controls whether the tree node can be selected, and its visual appearance. |
Methods
Changed | protected | Performs a change notification for the node with the specified reason. |
GetOwner | protected | Gets the owner of the object instance. |
Create | public | Constructor for the class instance. |
Destroy | public | Destructor for the class instance. |
AlphaSort | public | Sorts the top-level child nodes in Items. |
Bottom | public | Gets the vertical coordinate for the bottom of the tree node. |
BottomExpanded | public | Gets the bottom coordinate for the last visible, expanded child node in the subtree. |
CustomSort | public | CustomSort - Sorts the child nodes using SortProc. |
DefaultTreeViewSort | public | Default routine used to returns a numeric value with the sort order for the specified tree nodes. |
DisplayExpandSignLeft | public | Returns the position for the left edge of the expand / collapse indicator. |
DisplayExpandSignRect | public | Returns the coordinates for the rectangle within which the expand / collapse indicator is displayed. |
DisplayExpandSignRight | public | Returns the position for the right edge of the expand / collapse indicator (accounting for the width of the icon, etc.). |
DisplayIconLeft | public | Returns the horizontal position for the left edge of the icon displayed for the tree node. |
DisplayRect | public | Returns the rectangle where the tree node is displayed on its TreeView control. |
DisplayStateIconLeft | public | Returns the horizontal position for the left edge of the State icon on the tree node. |
DisplayTextLeft | public | Returns the position for the left edge of the text on the tree node. |
DisplayTextRight | public | Returns the horizontal position for the right edge of the Text on the tree node. |
EditText | public | Edits the text for the node in the associated TreeView control. |
FindNode | public | Gets the child tree node in Items with the specified text. |
GetFirstChild | public | Gets the first child node in the Items property. |
GetFirstSibling | public | Gets the first tree node at the same level in the tree. |
GetFirstVisibleChild | public | Gets the tree node that is the first visible child node in the subtree. |
GetHandle | public | Gets the value for the Handle property. |
GetLastChild | public | Gets the last tree node that is a top-level child node in Items. |
GetLastSibling | public | Gets the last node at the same level as the current node. |
GetLastSubChild | public | Returns the last child node or its last descendent node. |
GetLastVisibleChild | public | Gets the last child node in the subtree with its Visible property set to True. |
GetNext | public | Gets the next node in the tree hierarchy. |
GetNextChild | public | Returns the next child node for the parent node specified in AValue. |
GetNextExpanded | public | Returns the next expanded tree node in the node hierarchy. |
GetNextMultiSelected | public | Returns the next tree node which is included in a multi-selected range of nodes. |
GetNextSibling | public | Returns the next node in the tree hierarchy at the same level as the current node. |
GetNextSkipChildren | public | Gets the next sibling for the current tree node, or Nil when a sibling node does not exist. |
GetNextVisible | public | Gets the next visible node child or sibling for the current node. |
GetNextVisibleSibling | public | Gets the next visible node at the same level in the node tree. |
GetParentNodeOfAbsoluteLevel | public | GetParentNodeOfAbsoluteLevel - returns the parent of all nodes at this absolute level. |
GetPrev | public | Gets the previous node in the tree hierarchy. |
GetPrevChild | public | Gets the previous child node starting at the specified child node. |
GetPrevExpanded | public | Returns the previous expanded tree node in the node hierarchy. |
GetPrevMultiSelected | public | GetPrevMultiSelected - returns the previous node in a multi-selection. |
GetPrevSibling | public | GetPrevSibling - returns the previous node in the same level as the current node. |
GetPrevVisible | public | Returns the previous visible (not hidden) tree node in the node hierarchy. |
GetPrevVisibleSibling | public | Gets the previous visible sibling tree node for the current node. |
GetTextPath | public | Gets the hierarchical path to the tree node in the tree view. |
HasAsParent | public | Returns True if the specified node is a parent for the current node. |
IndexOf | public | Get the index position for the specified child tree node. |
IndexOfText | public | Returns the ordinal position for the last child node containing the specified Text. |
Assign | public | Implements object persistence for the TTreeNode type. |
Collapse | public | Collapses the current tree node, and optionally collapses any descendent nodes. |
ConsistencyCheck | public | Ensures that node references to or from the current tree node are valid and consistent. |
Delete | public | Frees the current tree node when the Deleting property is not True. |
DeleteChildren | public | Removes all child nodes and descendants in the tree structure. |
EndEdit | public | Ends editing of the tree node in the associated tree view control. |
Expand | public | Expands the current tree node, and optionally all descendent nodes. |
ExpandParents | public | Expands all tree nodes which are an ancestor of the current node. |
FreeAllNodeData | public | Frees the Pointer in Data, including any child nodes in Items. |
MakeVisible | public | Forces the tree node to become visible. |
MoveTo | public | Relocates a node to the specified Destination node using the specified mode of attachment. |
MultiSelectGroup | public | Adds the group of nodes between a selected node and the current node to a multi-selection range. |
Update | public | Redraws the associated TreeView control if an update is not already in progress. |
WriteDebugReport | public | WriteDebugReport - 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.
