tvAdd: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *I([a-z ])" to "$1 - i$2")
 
(63 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|version1= 0.74


|0.74|= Game version
|gr1= GUI Control - Tree View
____________________________________________________________________________________________


| Adds an item with given text to Tree View with given idc under specified path (zero based). |= Description
|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.
____________________________________________________________________________________________


| '''tvAdd''' [idc, [path], text] |= Syntax
|s1= [[tvAdd]] [idc, pathParent, text]


|p1= [idc, [path], text]: [[Array]] |= PARAMETER1
|p1= idc: [[Number]]


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


|p3= [path]: [[Array]] - Array containing numbers. |= PARAMETER3
|p3= text: [[String]]


|p4= text: [[String]] |= PARAMETER4
|r1= [[Number]] - index of the added item relative to the branch it was added to


| [[Number]] |= RETURNVALUE
|s2= control [[tvAdd]] [pathParent, text]


|p21= control: [[Control]]


|x1= <code>tvAdd [101, [0], "First item"]</code>|= EXAMPLE1
|p22= pathParent: [[Array]] - [[Tree View Path]] of parent item or [] if no parent exists


____________________________________________________________________________________________
|p23= text: [[String]]


| [[tvClear]], [[tvCollapse]], [[tvCount]], [[tvCurSel]], [[tvData]], [[tvDelete]], [[tvExpand]], [[tvPicture]], [[tvSetCurSel]], [[tvSetData]], [[tvSetPicture]], [[tvSetValue]], [[tvSort]], [[tvSortByValue]], [[tvText]], [[tvValue]] |= SEEALSO
|r2= [[Number]] - index of the added item relative to the branch it was added to


| |= MPBEHAVIOUR
|x1= <sqf>_index = _ctrl tvAdd [[], "Parent Item"];</sqf>
____________________________________________________________________________________________
}}


<h3 style='display:none'>Notes</h3>
|x2= <sqf>_index = tvAdd [101, [0], "First item"];</sqf>
<dl class='command_description'>
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|seealso= [[tvClear]] [[tvCollapse]] [[tvCount]] [[tvCurSel]] [[tvData]] [[tvDelete]] [[tvExpand]] [[tvPicture]] [[tvSetCurSel]] [[tvSetData]] [[tvSetValue]] [[tvSort]] [[tvSortByValue]] [[tvValue]] [[tvText]] [[tvSetText]] [[tvSetPicture]] [[tvSetPictureColor]] [[tvSetPictureRight]] [[tvSetPictureRightColor]]
</dl>
}}
 
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 15:33, 8 November 2023

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:
tvClear tvCollapse tvCount tvCurSel tvData tvDelete tvExpand tvPicture tvSetCurSel tvSetData tvSetValue tvSort tvSortByValue tvValue tvText tvSetText tvSetPicture tvSetPictureColor tvSetPictureRight tvSetPictureRightColor

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