Sign in Join
FPDoc Onlineexperiment

TTreeNodes.FindNodeWithTextPath function

Member of TTreeNodespublicIn unit ComCtrls

Finds a node with the hierarchical path specified in TextPath.

Declaration

pascal
function 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.

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

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.