Vcl.Outline.TCustomOutline.AddObject

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function AddObject(Index: LongInt; const Text: string; const Data: TCustomData): LongInt;

C++

int __fastcall AddObject(int Index, const System::UnicodeString Text, const void * Data);

Properties

Type Visibility Source Unit Parent
function public
Vcl.Outline.pas
Vcl.Outline.hpp
Vcl.Outline TCustomOutline

Description

Adds a node containing data to the outline.

Use AddObject to add a TOutlineNode object to 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 sibling of the node identified by Index. To add nodes to the beginning of the outline, 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.

AddChild returns the Index property of the new node.

See Also