RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomOutline.AddChildObject Method

Adds a child node containing data to a node in the outline.

Pascal
function AddChildObject(Index: LongInt; const Text: string; const Data: TCustomData): LongInt;
C++
__fastcall LongInt AddChildObject(LongInt Index, const AnsiString Text, const TCustomData Data);

Use AddChildObject to add a TOutlineNode object as the child of a node in the outline and assign it a data pointer. Text specifies the value of the Text property for the new node. Data specifies the value of the Data property for the new node. 

Index specifies where to add the new node. The new node is positioned in the outline as the last child of the node identified by Index. To add nodes to the top level of the outline (off the root), specify zero (0) as the Index parameter. 

Nodes that appear after the new node are moved down one row and reindexed in the Items property array with valid Index values. If BeginUpdate has been called, the Items array is not reindexed until the EndUpdate method is called. 

AddChildObject returns the Index property of the new node. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!