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

TTreeNodes.FindNodeWithTextPath

Finds a node with the hierarchical path specified in TextPath.

Declaration

Source position: comctrls.pp line 3244

public function TTreeNodes.FindNodeWithTextPath(

  TextPath: string

):TTreeNode;

Arguments

TextPath

  

Delimited text used to locate a tree node with the path and text values.

Function result

The tree node with a path matching the specified text, or Nil when not found.

Description

Returns the TTreeNode instance found which matches the hierarchy of tree nodes specified in TextPath, or Nil if a tree node is not found matching the specified value.

TextPath contains the delimited text values used to locate a tree node. The PathDelimiter in the TCustomTreeView instance in Owner is used as the delimiter between node identifiers in TextPath.

FindNodeWithTextPath always searches starting at the top-level or root for the tree. A leading path delimiter in TextPath is assumed, and the following values in TextPath are considered to be equivalent:

/parentnode/childnode/grandchildnode
parentnode/childnode/grandchildnode

FindNodeWithTextPath calls the FindNode method in the current TTreeNode instance to locate the next tree node with the required identifier Text. The process is repeated until all of the identifiers have been located, or a node is not found for one of the identifiers in TextPath. The Expanded property in a tree node is set to True prior to calling GetNode.

The return value is the TTreeNode instance found at the specified path, or Nil if any one of the component value in the path is not found.

Version info

Modified in LCL version 3.0 to expand a tree node (when enabled) if it is part of the text path found in a node search.

See also

TTreeNodes.Owner

  

The TCustomTreeView control that is the owner of the container.

TTreeNodes.FindTopLvlNode

  

Gets a top-level node containing the specified text.

TTreeNode.Text

  

Text displayed for the tree node.

TTreeNode.Parent

  

Parent node for the current tree node.

TTreeNode.FindNode

  

Gets the child tree node in Items with the specified text.

TCustomTreeView.PathDelimiter

  

Delimiter used to separate node identifiers in the path to a given tree node.


Version 3.2 Generated 2024-02-25 Home