Sign in Join
FPDoc Onlineexperiment

TTreeNodes class

In unit ComCtrls

Implements a container for TTreeNode instances.

Declaration

pascal
TTreeNodes = class(TPersistent)

Inheritance

  1. TTreeNodes
  2. TPersistent
  3. 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

CountpublicContains the number of tree nodes in the container.
ItempublicProvides indexed access to the TTreeNode instances in the container.
KeepCollapsedNodespublicKeepCollapsedNodes - if True, preserves the nodes that have been collapsed.
OwnerpublicThe TCustomTreeView control that is the owner of the container.
SelectionCountpublicNumber of tree nodes included in the internal selection list.
TopLvlCountpublicThe number of tree nodes at the top level of the tree structure.
TopLvlItemspublicProvides indexed access to tree nodes at the top level of the tree structure.

Methods

InternalAddObjectprotectedCreates or updates a tree node with the specified text and a pointer to data.
DefinePropertiesprotectedSpecifies read and write routines used to stream the class instance in LCL.
GetCountprotectedGets the value for the Count property.
GetOwnerprotectedGets the value for the Owner property.
SetItemprotectedAssigns values from the specified tree node to a node in the container.
CreatepublicConstructor for the class instance.
DestroypublicDestructor for the class instance.
AddpublicAdds a new tree node as a sibling of the specified node.
AddChildpublicAdds a tree node with the specified text as a child of the specified parent node.
AddChildFirstpublicAdds a node with specified text as the first child of the parent node and returns the new node.
AddChildObjectpublicAdds a child node with specified text and data to the parent node and returns the new node.
AddChildObjectFirstpublicAdds a node with the specified text and data as the first child node in the parent node.
AddFirstpublicAdds a node with the specified text as the first node at the same level as the sibling node.
AddNodepublicAdds or inserts a tree node as a sibling to a specified relative node.
AddObjectpublicAdds a node with the specified text and data at the same level as the sibling node.
AddObjectFirstpublicAdds a node with the specified text and data as the first node at the same level as the sibling node.
FindNodeWithDatapublicFinds a node containing the specified data.
FindNodeWithTextpublicFinds a tree node containing the specified text.
FindNodeWithTextPathpublicFinds a node with the hierarchical path specified in TextPath.
FindTopLvlNodepublicGets a top-level node containing the specified text.
GetEnumeratorpublicGets the TTreeNodesEnumerator enumerator for the class instance.
GetFirstNodepublicGets the first tree node in the container.
GetFirstVisibleNodepublicGets the first top-level tree node with its Visible property set to True.
GetFirstVisibleEnabledNodepublicGets the first top-level sibling node that is visible and enabled.
GetLastExpandedSubNodepublicGets the last visible, enabled, expanded tree node in the node hierarchy.
GetLastNodepublicGets the last top-level tree node in the container.
GetLastSubNodepublicGets the last child or descendent node in the last top-level node.
GetLastVisibleNodepublicGets the last top-level tree node with its Visible property set to True.
GetLastVisibleEnabledNodepublicGets the last top-level sibling node that is visible and enabled.
GetSelectionspublicGets the tree node at the specified position in the list of selected nodes.
InsertpublicInserts a tree node with the specified text before the specified node.
InsertBehindpublicInserts a new tree node with the specified text just after the specified node.
InsertObjectpublicInserts a new tree node with the specified text and data just before the specified node.
InsertObjectBehindpublicInserts a new tree node with the specified text and data just behind the specified node.
IsMultiSelectionpublicTrue if the node is part of a multi-selection in the internal selection list.
AssignpublicImplements object persistence for the tree node container.
BeginUpdatepublicStarts an update process for the tree nodes in the container.
ClearpublicRemoves tree nodes in the container and its internal cache.
ClearMultiSelectionpublicClears the nodes in a multi-selection and optionally the selected node on the tree view control.
ConsistencyCheckpublicMakes sure all references for nodes in the container are consistent.
DeletepublicRemoves the specified tree node from the container.
EndUpdatepublicFinishes an update process for the tree nodes in the container.
IsUpdatingpublicIndicates whether BeginUpdate has been called at the start of an update to the node container.
FreeAllNodeDatapublicFrees the pointer in the Data property for each of the nodes in the container.
SelectionsChangedpublicAdds or removes the specified tree node to / from the internal selections list when its Selected property is changed.
SelectOnlyThispublicClears any existing multi-selections and selects the specified node.
MultiSelectpublicAdds nodes relative the specified node to the multi-selection list.
SortTopLevelNodespublicSorts the top-level nodes using the specified sorting procedure.
WriteDebugReportpublicWriteDebugReport - 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.