tvAdd: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...)
Line 1: Line 1:
{{Command|Comments=
{{Command


| arma3 |Game name=
| arma3


|0.74|Game version=
|0.74


|gr1= GUI Control - Tree View |GROUP1=
|gr1= GUI Control - Tree View


| 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. |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.


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


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


|p2= pathParent: [[Array]] - [[Tree View Path]] of parent item or [] if no parent exists|PARAMETER2=
|p2= pathParent: [[Array]] - [[Tree View Path]] of parent item or [] if no parent exists


|p3= text: [[String]] |PARAMETER3=
|p3= text: [[String]]


| [[Number]] - Index of the added item relative to the branch it was added to |RETURNVALUE=
| [[Number]] - Index of the added item relative to the branch it was added to


|s2= control [[tvAdd]] [pathParent, text] |SYNTAX2=
|s2= control [[tvAdd]] [pathParent, text]


|p21= control: [[Control]] |PARAMETER21=  
|p21= control: [[Control]] |PARAMETER21=  
Line 27: Line 27:
|p23= text: [[String]] |PARAMETER23=
|p23= text: [[String]] |PARAMETER23=


|r2= [[Number]] - Index of the added item relative to the branch it was added to |RETURNVALUE2=
|r2= [[Number]] - Index of the added item relative to the branch it was added to


|x1= <code>_index = _ctrl [[tvAdd]] [<nowiki/>[], "Parent Item"];</code> |EXAMPLE1=
|x1= <code>_index = _ctrl [[tvAdd]] [<nowiki/>[], "Parent Item"];</code>


|x2= <code>_index = [[tvAdd]] [101, [0], "First item"];</code> |EXAMPLE2=
|x2= <code>_index = [[tvAdd]] [101, [0], "First item"];</code>


| [[tvClear]], [[tvCollapse]], [[tvCount]], [[tvCurSel]], [[tvData]], [[tvDelete]], [[tvExpand]], [[tvPicture]], [[tvSetCurSel]], [[tvSetData]], [[tvSetValue]], [[tvSort]], [[tvSortByValue]], [[tvValue]], [[tvText]], [[tvSetText]], [[tvSetPicture]], [[tvSetPictureColor]], [[tvSetPictureRight]], [[tvSetPictureRightColor]] |SEEALSO=
| [[tvClear]], [[tvCollapse]], [[tvCount]], [[tvCurSel]], [[tvData]], [[tvDelete]], [[tvExpand]], [[tvPicture]], [[tvSetCurSel]], [[tvSetData]], [[tvSetValue]], [[tvSort]], [[tvSortByValue]], [[tvValue]], [[tvText]], [[tvSetText]], [[tvSetPicture]], [[tvSetPictureColor]], [[tvSetPictureRight]], [[tvSetPictureRightColor]]


| |MPBEHAVIOUR=
|
}}
}}

Revision as of 12:27, 18 January 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