tvAdd: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\| *arma3 * * *\| *([0-2]\.[0-9]{2}) * " to "|game1= arma3 |version1= $1 ")
m (Text replacement - " \| *(game[0-9]|version[0-9]|gr[0-9]|serverExec|mp|pr|descr|s[0-9]|p[0-9]{1,3}|r[0-9]|x1?[0-9]|seealso) *= +" to " |$1= ")
Line 8: Line 8:
|descr= Adds an item with given text to Tree View control. The position on Tree View where to add the item and the actual path to this item once added are different. If item is added to existing item, then parent item path is used. If no parent exists, empty array [] is used. See [[Tree View Path]] for more information.
|descr= Adds an item with given text to Tree View control. The position on Tree View where to add the item and the actual path to this item once added are different. If item is added to existing item, then parent item path is used. If no parent exists, empty array [] is used. See [[Tree View Path]] for more information.


|s1= [[tvAdd]] [idc, pathParent, text]
|s1= [[tvAdd]] [idc, pathParent, text]


|p1= idc: [[Number]]
|p1= idc: [[Number]]

Revision as of 22:54, 19 June 2021

Hover & click on the images for description

Description

Description:
Adds an item with given text to Tree View control. The position on Tree View where to add the item and the actual path to this item once added are different. If item is added to existing item, then parent item path is used. If no parent exists, empty array [] is used. See Tree View Path for more information.
Groups:
GUI Control - Tree View

Syntax

Syntax:
tvAdd [idc, pathParent, text]
Parameters:
idc: Number
pathParent: Array - Tree View Path of parent item or [] if no parent exists
text: String
Return Value:
Number - Index of the added item relative to the branch it was added to

Alternative Syntax

Syntax:
control tvAdd [pathParent, text]
Parameters:
control: Control
pathParent: Array - Tree View Path of parent item or [] if no parent exists
text: String
Return Value:
Number - Index of the added item relative to the branch it was added to

Examples

Example 1:
_index = _ctrl tvAdd [[], "Parent Item"];
Example 2:
_index = tvAdd [101, [0], "First item"];

Additional Information

See also:
tvCleartvCollapsetvCounttvCurSeltvDatatvDeletetvExpandtvPicturetvSetCurSeltvSetDatatvSetValuetvSorttvSortByValuetvValuetvTexttvSetTexttvSetPicturetvSetPictureColortvSetPictureRighttvSetPictureRightColor

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note