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

TTreeNode.GetPrevExpanded

Returns the previous expanded tree node in the node hierarchy.

Declaration

Source position: comctrls.pp line 3123

public function TTreeNode.GetPrevExpanded(

  aEnabledOnly: Boolean = False

):TTreeNode;

Arguments

aEnabledOnly

  

True if the previous node must be Enabled. False if the Enabled state is not examined in a candidate node.

Function result

Previous expanded sibling node (or one of its descendants) in the node hierarchy.

Description

GetPrevExpanded is a TTreeNode function used to get the previous expanded node in the tree node hierarchy. The node used in the return value must have both Visible and Expanded in its node states. The AEnabledOnly argument indicates whether the node must also have its Enabled property set to True. If AEnabledOnly is False, the Enabled state is not examined in the method.

GetPrevExpanded calls GetPrevVisibleSibling to find a node with the required states. When found, its GetLastVisibleChild is called to find the last child node (or descendant) with the required states. The return value contains the sibling node or a child node found when found. If a previous sibling node does not exist, the return value is set to the Parent for the current node.

Version info

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

See also

TTreeNode.Expanded

  

True if the node has been expanded, False when collapsed.

TTreeNode.Visible

  

True if the tree node is visible in the associated TreeView control.

TTreeNode.Enabled

  

Controls whether the tree node can be selected, and its visual appearance.

TTreeNode.Parent

  

Parent node for the current tree node.

TTreeNode.GetPrevVisibleSibling

  

Gets the previous visible sibling tree node for the current node.

TTreeNode.GetLastVisibleChild

  

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


Version 4.0 Generated 2025-05-03 Home