menuAdd: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{Command|= ____________________________________________________________________________________________ |arma3 |= Game |1.56|= Game Version |arg= |= Multiplayer Arguments |e...")
 
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *P([a-gi-z ])" to "$1 - p$2")
 
(45 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|=
{{RV|type=command
____________________________________________________________________________________________
|game1= arma3
|arma3 |= Game
|version1= 1.56
|1.56|= Game Version
|arg=
|arg= |= Multiplayer Arguments
|gr1= GUI Control - Menu
|eff=  |= Multiplayer Effects
____________________________________________________________________________________________
| Adds new submenu entry into item on given path. |= Description
____________________________________________________________________________________________
| menuAdd [idc, path, text] |= Syntax
|p1= idc: [[Number]] |= Parameter 1
|p2= path: [[Array]] |= Parameter 2
|p3= text: [[String]] |= Parameter 3


| [[Number]] |= Return Value
|descr= Adds new submenu entry into item on given path.
<!--
|s1= [[menuAdd]] [idc, path, text]
|s2= control |= Alternative Syntax
 
|p21= control: [[Control]] |= Alternative Parameter 1
|p1= idc: [[Number]]
|p22= |= Alternative Parameter 2
 
|p23=  |= Alternative Parameter 3
|p2= path: [[Array]]
|r2= |= Alternative Return Value
 
-->
|p3= text: [[String]]
|x1= |= Example 1
 
| - |= See Also
|r1= [[Number]]
}}
 
|s2= control [[menuAdd]] [path, text]
 
|p21= control: [[Control]]
 
|p22= path: [[Array]] - path where the items should be added
 
|p23= text: [[String]] - displayed name for the entry


<dl class='command_description'>
|r2= [[Number]] - index of the item
<!-- BEGIN Note Section -->
<!-- For example:
<dd class='notedate'>Posted on Month Day, Year - Time (UTC)</dd>
<dt class='note'>'''[[User:User Name|User Name]]'''</dt>
<dd class='note'>This is an example note. It is true and verifiable, and contains a little code snippet.
<code>[[if]] ([[_this]] == anExample) [[then]] { [[hint]] Leave it here for others to read; };</code></dd>
-->
<!-- END Note Section -->
</dl>


<h3 style='display:none'>Bottom Section</h3>
|x1= <sqf>findDisplay 313 displayCtrl 120 menuAdd [[], "Custom Tools"]; // Add new entry at the top level to the menu strip in Eden Editor</sqf>
<!-- Appropriate categories go here -->


[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
|seealso= [[menuDelete]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
}}

Latest revision as of 16:45, 8 November 2023

Hover & click on the images for description

Description

Description:
Adds new submenu entry into item on given path.
Groups:
GUI Control - Menu

Syntax

Syntax:
menuAdd [idc, path, text]
Parameters:
idc: Number
path: Array
text: String
Return Value:
Number

Alternative Syntax

Syntax:
control menuAdd [path, text]
Parameters:
control: Control
path: Array - path where the items should be added
text: String - displayed name for the entry
Return Value:
Number - index of the item

Examples

Example 1:
findDisplay 313 displayCtrl 120 menuAdd [[], "Custom Tools"]; // Add new entry at the top level to the menu strip in Eden Editor

Additional Information

See also:
menuDelete

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