menuAdd: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Alternative Parameter 2 " to "|Alternative Parameter 2= ")
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *P([a-gi-z ])" to "$1 - p$2")
 
(39 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{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]] |PARAMETER1=
|p2= path: [[Array]] |PARAMETER2=
|p3= text: [[String]] |PARAMETER3=


| [[Number]] |RETURNVALUE=
|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= |EXAMPLE1=
 
| ‎[[menuEnable]], [[menuExpand]], [[menuCollapse]], [[menuSetData]], [[menuSetValue]], [[‎menuSetCheck]], [[menuSetAction]], [[menuDelete]], [[‎menuHover]], [[menuValue]], [[menuURL]], [[‎menuText]], [[menuSort]], [[‎menuSize]], [[menuEnabled]], [[‎menuChecked]], [[menuAction]], [[menuShortcutText]], [[menuShortcut]], [[menuPicture]], [[menuData]], [[menuClear]], [[menuSetPicture]] |SEEALSO=
|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 15: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