TTreeNodes class
Implements a container for TTreeNode instances.
Declaration
TTreeNodes = class(TPersistent)Inheritance
- TTreeNodes
- TPersistent
- TObject
Description
TTreeNodes is a
TPersistent descendant which implements
a container used to store
TTreeNode instances. TTreeNodes provides
properties and methods used to create, store, access, and maintain nodes in a
hierarchical tree structure.
The indexed Item property provides access to the nodes in the
container by their ordinal position. An enumerator can also be used to access
tree nodes in the container. Use TopLvlItems to access the tree nodes that
are the top-level sibling nodes in the container.
TTreeNodes has methods that are used to create, store, locate, and maintain the tree nodes in the container; for example: Add, AddChild, Insert, Delete, Clear, FindNodeWithText, GetFirstNode, et. al.
Internally, it maintains a node cache for its tree node instances. A list of selected (or multi-selected) tree nodes is also maintained.
TTreeNodes is the type used for the Items property in
TCustomTreeView. It is also used to implement the Owner
and TreeNodes properties in TTreeNode.
See also
Properties
Count | public | Contains the number of tree nodes in the container. |
Item | public | Provides indexed access to the TTreeNode instances in the container. |
KeepCollapsedNodes | public | KeepCollapsedNodes - if True, preserves the nodes that have been collapsed. |
Owner | public | The TCustomTreeView control that is the owner of the container. |
SelectionCount | public | Number of tree nodes included in the internal selection list. |
TopLvlCount | public | The number of tree nodes at the top level of the tree structure. |
TopLvlItems | public | Provides indexed access to tree nodes at the top level of the tree structure. |
Methods
InternalAddObject | protected | Creates or updates a tree node with the specified text and a pointer to data. |
DefineProperties | protected | Specifies read and write routines used to stream the class instance in LCL. |
GetCount | protected | Gets the value for the Count property. |
GetOwner | protected | Gets the value for the Owner property. |
SetItem | protected | Assigns values from the specified tree node to a node in the container. |
Create | public | Constructor for the class instance. |
Destroy | public | Destructor for the class instance. |
Add | public | Adds a new tree node as a sibling of the specified node. |
AddChild | public | Adds a tree node with the specified text as a child of the specified parent node. |
AddChildFirst | public | Adds a node with specified text as the first child of the parent node and returns the new node. |
AddChildObject | public | Adds a child node with specified text and data to the parent node and returns the new node. |
AddChildObjectFirst | public | Adds a node with the specified text and data as the first child node in the parent node. |
AddFirst | public | Adds a node with the specified text as the first node at the same level as the sibling node. |
AddNode | public | Adds or inserts a tree node as a sibling to a specified relative node. |
AddObject | public | Adds a node with the specified text and data at the same level as the sibling node. |
AddObjectFirst | public | Adds a node with the specified text and data as the first node at the same level as the sibling node. |
FindNodeWithData | public | Finds a node containing the specified data. |
FindNodeWithText | public | Finds a tree node containing the specified text. |
FindNodeWithTextPath | public | Finds a node with the hierarchical path specified in TextPath. |
FindTopLvlNode | public | Gets a top-level node containing the specified text. |
GetEnumerator | public | Gets the TTreeNodesEnumerator enumerator for the class instance. |
GetFirstNode | public | Gets the first tree node in the container. |
GetFirstVisibleNode | public | Gets the first top-level tree node with its Visible property set to True. |
GetFirstVisibleEnabledNode | public | Gets the first top-level sibling node that is visible and enabled. |
GetLastExpandedSubNode | public | Gets the last visible, enabled, expanded tree node in the node hierarchy. |
GetLastNode | public | Gets the last top-level tree node in the container. |
GetLastSubNode | public | Gets the last child or descendent node in the last top-level node. |
GetLastVisibleNode | public | Gets the last top-level tree node with its Visible property set to True. |
GetLastVisibleEnabledNode | public | Gets the last top-level sibling node that is visible and enabled. |
GetSelections | public | Gets the tree node at the specified position in the list of selected nodes. |
Insert | public | Inserts a tree node with the specified text before the specified node. |
InsertBehind | public | Inserts a new tree node with the specified text just after the specified node. |
InsertObject | public | Inserts a new tree node with the specified text and data just before the specified node. |
InsertObjectBehind | public | Inserts a new tree node with the specified text and data just behind the specified node. |
IsMultiSelection | public | True if the node is part of a multi-selection in the internal selection list. |
Assign | public | Implements object persistence for the tree node container. |
BeginUpdate | public | Starts an update process for the tree nodes in the container. |
Clear | public | Removes tree nodes in the container and its internal cache. |
ClearMultiSelection | public | Clears the nodes in a multi-selection and optionally the selected node on the tree view control. |
ConsistencyCheck | public | Makes sure all references for nodes in the container are consistent. |
Delete | public | Removes the specified tree node from the container. |
EndUpdate | public | Finishes an update process for the tree nodes in the container. |
IsUpdating | public | Indicates whether BeginUpdate has been called at the start of an update to the node container. |
FreeAllNodeData | public | Frees the pointer in the Data property for each of the nodes in the container. |
SelectionsChanged | public | Adds or removes the specified tree node to / from the internal selections list when its Selected property is changed. |
SelectOnlyThis | public | Clears any existing multi-selections and selects the specified node. |
MultiSelect | public | Adds nodes relative the specified node to the multi-selection list. |
SortTopLevelNodes | public | Sorts the top-level nodes using the specified sorting procedure. |
WriteDebugReport | public | WriteDebugReport - for debugging. |
Inherited
From TPersistent (5)
AssignTo 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.
