Difference between revisions of "menuData"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
m (page filled)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|=
+
{{Command|Comments=
____________________________________________________________________________________________
+
 
 
|arma3 |= Game
 
|arma3 |= Game
|1.56|= Game Version
+
 
|arg=  |= Multiplayer Arguments
+
|1.56|Game Version=
|eff= |= Multiplayer Effects
+
 
____________________________________________________________________________________________
+
|gr1= GUI Control - Menu |GROUP1=
 +
 
 
| Returns data stored in menu entry on given path. |DESCRIPTION=
 
| Returns data stored in menu entry on given path. |DESCRIPTION=
____________________________________________________________________________________________
+
 
 
| [[menuData]] [idc, path] |SYNTAX=
 
| [[menuData]] [idc, path] |SYNTAX=
 +
 
|p1= idc: [[Number]] |PARAMETER1=
 
|p1= idc: [[Number]] |PARAMETER1=
 +
 
|p2= path: [[Array]] |PARAMETER2=
 
|p2= path: [[Array]] |PARAMETER2=
 +
 
|p3=  |PARAMETER3=
 
|p3=  |PARAMETER3=
  
 
| [[String]] |RETURNVALUE=
 
| [[String]] |RETURNVALUE=
<!--
+
 
|s2= control |= Alternative Syntax
+
|s2= control [[menuData]] path |Alternative Syntax=
|p21= control: [[Control]] |= Alternative Parameter 1
+
 
|p22= |= Alternative Parameter 2
+
|p21= control: [[Control]] |Alternative Parameter 1=
|p23=  |= Alternative Parameter 3
+
 
|r2=  |= Alternative Return Value
+
|p22= path: [[Array]] |Alternative Parameter 2=
-->
+
 
|x1=  |EXAMPLE1=
+
|r2= [[String]] |Alternative Return Value=
| ‎[[menuEnable]], [[menuExpand]], [[menuCollapse]], [[menuSetData]], [[menuSetValue]], [[‎menuSetCheck]], [[menuSetAction]], [[menuDelete]], [[menuAdd]], [[‎menuHover]], [[menuValue]], [[menuURL]], [[‎menuText]], [[menuSort]], [[‎menuSize]], [[menuEnabled]], [[‎menuChecked]], [[menuAction]], [[menuShortcutText]], [[menuShortcut]], [[menuPicture]], [[menuClear]], [[menuSetPicture]] |SEEALSO=
+
 
 +
|x1=  <code>{{cc|Create an entry which will return its data once clicked}}
 +
[[private]] _ctrlMenuStrip = [[findDisplay]] 313 [[displayCtrl]] 120;
 +
[[private]] _indexMain = _ctrlMenuStrip [[menuAdd]] <nowiki>[</nowiki>[], "Custom Tools"];
 +
[[private]] _indexData = _ctrlMenuStrip [[menuAdd]] <nowiki>[</nowiki>[_indexMain],"This entry will print its data to system chat when clicked"];
 +
_ctrlMenuStrip [[menuSetData]] <nowiki>[</nowiki>[_indexMain,_indexData], "<nowiki>[</nowiki>[[objNull]],'Some String',[[true]]]"];
 +
_ctrlMenuStrip [[menuSetAction]] <nowiki>[</nowiki>[_indexMain,_indexData], "[[systemChat]] ([[findDisplay]] 313 [[displayCtrl]] 120 [[menuData]] ([[menuHover]] ([[findDisplay]] 313 [[displayCtrl]] 120)));"];
 +
</code>|EXAMPLE1=
 +
 
 +
 
 +
| [[menuSetData]] |SEEALSO=
 
}}
 
}}
  

Latest revision as of 09:48, 18 October 2020

Introduced with Arma 3 version 1.561.56
Hover & click on the images for descriptions

Description

Description:
Returns data stored in menu entry on given path.

Syntax

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

Alternative Syntax

Syntax:
control menuData path
Parameters:
control: Control
path: Array
Return Value:
String

Examples

Example 1:
// Create an entry which will return its data once clicked private _ctrlMenuStrip = findDisplay 313 displayCtrl 120; private _indexMain = _ctrlMenuStrip menuAdd [[], "Custom Tools"]; private _indexData = _ctrlMenuStrip menuAdd [[_indexMain],"This entry will print its data to system chat when clicked"]; _ctrlMenuStrip menuSetData [[_indexMain,_indexData], "[objNull,'Some String',true]"]; _ctrlMenuStrip menuSetAction [[_indexMain,_indexData], "systemChat (findDisplay 313 displayCtrl 120 menuData (menuHover (findDisplay 313 displayCtrl 120)));"];

Additional Information

See also:
menuSetData
Groups:
GUI Control - Menu

Notes

i
Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.

Bottom Section