Sign in Join
FPDoc Onlineexperiment

TTreeNode.HasAsParent function

Member of TTreeNodepublicIn unit ComCtrls

Returns True if the specified node is a parent for the current node.

Declaration

pascal
function HasAsParent(AValue: TTreeNode): Boolean

Arguments

AValue

Parent node to locate in the ancestor nodes for the class instance.

Function result

True if the specified node is ancestor of the current tree node (also when the ancestor node is not specified).

Description

HasAsParent is Boolean function which indicates whether the tree node specified in AValue is an ancestor of the current tree node.

The return value is True if AValue is the Parent node for the current class instance. Preceding Parent nodes in the hierarchy are also searched if needed by calling their HasAsParent method, and the return value is set to True if any one of them is the node in AValue.

The return value is set to False when a node is encountered and its Parent node has not been assigned.

Strangely enough, the method also returns True if AValue is unassigned (Nil).

HasAsParent is called from the MoveTo method and used to enable or disable change event handlers in the TreeView control when a node is relocated in the node hierarchy.

See also

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