[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'ComCtrls' (#lcl)

TTreeNodes

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements a container for TTreeNode instances.

Declaration

Source position: comctrls.pp line 3186

type TTreeNodes = class(TPersistent)

protected

  function InternalAddObject();

  

Creates or updates a tree node with the specified text and a pointer to data.

  procedure DefineProperties(); override;

  

  function GetCount;

  

Gets the value for the Count property.

  function GetOwner; override;

  

Gets the value for the Owner property.

  procedure SetItem();

  

Assigns values from the specified tree node to a node in the container.

public

  constructor Create();

  

Constructor for the class instance.

  destructor Destroy; override;

  

Destructor for the class instance.

  function Add();

  

Adds a new tree node as a sibling of the specified node.

  function AddChild();

  

Adds a tree node with the specified text as a child of the specified parent node.

  function AddChildFirst();

  

Adds a node with specified text as the first child of the parent node and returns the new node.

  function AddChildObject();

  

Adds a child node with specified text and data to the parent node and returns the new node.

  function AddChildObjectFirst();

  

Adds a node with the specified text and data as the first child node in the parent node.

  function AddFirst();

  

Adds a node with the specified text as the first node at the same level as the sibling node.

  function AddNode();

  

Adds or inserts a tree node as a sibling to a specified relative node.

  function AddObject();

  

Adds a node with the specified text and data at the same level as the sibling node.

  function AddObjectFirst();

  

Adds a node with the specified text and data as the first node at the same level as the sibling node.

  function FindNodeWithData();

  

Finds a node containing the specified data.

  function FindNodeWithText();

  

Finds a tree node containing the specified text.

  function FindNodeWithTextPath();

  

Finds a node with the hierarchical path specified in TextPath.

  function FindTopLvlNode();

  

Gets a top-level node containing the specified text.

  function GetEnumerator;

  

Gets the TTreeNodesEnumerator enumerator for the class instance.

  function GetFirstNode;

  

Gets the first tree node in the container.

  function GetFirstVisibleNode;

  

Gets the first top-level tree node with its Visible property set to True.

  function GetFirstVisibleEnabledNode;

  

Gets the first top-level sibling node that is visible and enabled.

  function GetLastExpandedSubNode;

  

Gets the last visible, enabled, expanded tree node in the node hierarchy.

  function GetLastNode;

  

Gets the last top-level tree node in the container.

  function GetLastSubNode;

  

Gets the last child or descendent node in the last top-level node.

  function GetLastVisibleNode;

  

Gets the last top-level tree node with its Visible property set to True.

  function GetLastVisibleEnabledNode;

  

Gets the last top-level sibling node that is visible and enabled.

  function GetSelections();

  

Gets the tree node at the specified position in the list of selected nodes.

  function Insert();

  

Inserts a tree node with the specified text before the specified node.

  function InsertBehind();

  

Inserts a new tree node with the specified text just after the specified node.

  function InsertObject();

  

Inserts a new tree node with the specified text and data just before the specified node.

  function InsertObjectBehind();

  

Inserts a new tree node with the specified text and data just behind the specified node.

  function IsMultiSelection;

  

True if the node is part of a multi-selection in the internal selection list.

  procedure Assign(); override;

  

Implements object persistence for the tree node container.

  procedure BeginUpdate;

  

Starts an update process for the tree nodes in the container.

  procedure Clear;

  

Removes tree nodes in the container and its internal cache.

  procedure ClearMultiSelection();

  

Clears the nodes in a multi-selection and optionally the selected node on the tree view control.

  procedure ConsistencyCheck;

  

Makes sure all references for nodes in the container are consistent.

  procedure Delete();

  

Removes the specified tree node from the container.

  procedure EndUpdate;

  

Finishes an update process for the tree nodes in the container.

  procedure FreeAllNodeData;

  

Frees the pointer in the Data property for each of the nodes in the container.

  procedure SelectionsChanged();

  

Adds or removes the specified tree node to / from the internal selections list when its Selected property is changed.

  procedure SelectOnlyThis();

  

Clears any existing multi-selections and selects the specified node.

  procedure MultiSelect();

  

Adds nodes relative the specified node to the multi-selection list.

  procedure SortTopLevelNodes();

  

Sorts the top-level nodes using the specified sorting procedure.

  procedure WriteDebugReport();

  

WriteDebugReport - for debugging.

  property Count: Integer; [r]

  

Contains the number of tree nodes in the container.

  property Item []: TTreeNode; default; [r]

  

Provides indexed access to the TTreeNode instances in the container.

  property KeepCollapsedNodes: Boolean; [rw]

  

KeepCollapsedNodes - if True, preserves the nodes that have been collapsed.

  property Owner: TCustomTreeView; [r]

  

The TCustomTreeView control that is the owner of the container.

  property SelectionCount: Cardinal; [r]

  

Number of tree nodes included in the internal selection list.

  property TopLvlCount: Integer; [r]

  

The number of tree nodes at the top level of the tree structure.

  property TopLvlItems []: TTreeNode; [rw]

  

Provides indexed access to tree nodes at the top level of the tree structure.

end;

Inheritance

TTreeNodes

  

Implements a container for TTreeNode instances.

|

TPersistent,IFPObserved

|

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

TCustomTreeView.Items

  

The container with the TTreeNode instances for the control.

TTreeNode

  

Implements a tree node displayed in a TTreeView control.

TTreeNodesEnumerator

  

Implements an enumerator for items in the TTreeNodes container.


Version 3.2 Generated 2024-02-25 Home