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

TTreeNodes.AddNode

Adds or inserts a tree node as a sibling to a specified relative node.

Declaration

Source position: comctrls.pp line 3236

public function TTreeNodes.AddNode(

  Node: TTreeNode;

  Relative: TTreeNode;

  const S: string;

  Ptr: Pointer;

  Method: TNodeAttachMode

):TTreeNode;

Arguments

Node

  

Node added or inserted to the node tree for the relative node.

Relative

  

Tree node where the node will become a sibling.

S

  

Accessibility value for the tree node.

Ptr

  

Pointer to the accessibility data for the tree node.

Method

  

Method used to store the node: add or insert.

Function result

Tree node with an updated Parent node after the operation.

Description

Method determines where the tree node is stored in relation to the Relative node, and may be overridden (changed to naAdd or naInsert) if a parent or sibling node cannot be determined for the operation.

AddNode calls the InternalAddObject method to create the new node used as the return value.

Errors

Raises an ETreeNodeError exception if the Relative node has not been assigned and Method is not naAdd or naAddFirst.

See also

TTreeNodes.InternalAddObject

  

Creates or updates a tree node with the specified text and a pointer to data.

ETreeNodeError

  

Exception type raised for an error retrieving a tree node.


Version 3.2 Generated 2024-02-25 Home