[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 3169

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();

  

AddChildFirst - adds a node with specified text as the first child of the parent node and returns the new node.

  function AddChildObject();

  

AddChildObject - adds a child node with specified text and data-pointer to the parent node and returns the new node.

  function AddChildObjectFirst();

  

AddChildObjectFirst - adds a node with specified text and data as the first child of the parent node and returns the new node.

  function AddFirst();

  

AddFirst - adds a node with specified text as the first node in the same level as SiblingNode. and returns the new node.

  function AddNode();

  

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

  function AddObject();

  

AddObject - adds a node with specified text and data-pointer in the same level as SiblingNode. and returns the new node.

  function AddObjectFirst();

  

AddObjectFirst - adds a node with specified text and data-pointer as the first node in the same level as SiblingNode. and returns the new node.

  function FindNodeWithData();

  

FindNodeWithData - returns a node containing the specified data pointer.

  function FindNodeWithText();

  

Finds a node containing the specified text string.

  function FindNodeWithTextPath();

  

Finds a node with the text ancestry 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;

  

GetFirstNode - returns the first node in the collection.

  function GetFirstVisibleNode;

  

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

  function GetLastExpandedSubNode;

  

GetLastExpandedSubNode - absolute last node.

  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 GetSelections();

  

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

  function Insert();

  

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

  function InsertBehind();

  

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

  function InsertObject();

  

InsertObject - inserts a new node with specified text and data just before the specified Next node and returns the new node.

  function InsertObjectBehind();

  

InsertObjectBehind - inserts a new node with specified text and data-pointer just behind specified Previous node and returns the new node.

  function IsMultiSelection;

  

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

  procedure Assign(); override;

  

Assign - if Source is of correct type, copies properties directly, otherwise calls inherited Assign which probably raises an exception.

  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();

  

ClearMultiSelection - clears a series of nodes in a multi-selection (provided the selection has not already been cleared).

  procedure ConsistencyCheck;

  

ConsistencyCheck - makes sure all references to and from the nodes 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 all 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 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

?

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 with 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.

TTreeNodes is the type used for the Items property in TCustomTreeView.

See also

TTreeNode

  

Contains data for an item displayed in a TTreeView control.

TCustomTreeView.Items

  

The container with the TTreeNode instances used in the control.

TTreeNodesEnumerator

  

Implements an enumerator for items in the TTreeNodes container.