Sign in Join
FPDoc Onlineexperiment

TTreeNode.GetLastVisibleChild function

Member of TTreeNodepublicIn unit ComCtrls

Gets the last child node in the subtree with its Visible property set to True.

Declaration

pascal
function GetLastVisibleChild(aEnabledOnly: Boolean=False): TTreeNode

Arguments

aEnabledOnlyTrue if the visible child node must also be Enabled. False if Enabled is not examined.

Function result

Last visible node in Items, or Nil when child nodes are not found or visible.

Description

GetLastVisibleChild is a TTreeNode method used to get the last child or descendent node for the current node with its Visible property set to True. The AEnabledOnly indicates whether the last child must also have its Enabled property set to True. When AEnabledOnly is False, the Enabled state for the node is not examined in the method.

GetLastVisibleChild performs a recursive search which starts at the last child node in Items, and continues to each of the last child nodes in the subtree. GetLastChild is called to retrieve the first tree node examined in the method. The search is continued by calling GetLastSubChild until a tree node with the required states (Visible and optionally Enabled) is located.

The return value is Nil if the recursive search for a last child node does not find a tree node with the required states, or the current node does not have child nodes.

Modified in LCL version 3.0. Refactored to include the AEnabledOnly argument.

See also

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