Command Group: GUI Control - Menu – Category

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
Commands to manipulate [[DialogControls-Menu| Menu / CT_MENU_STRIP, CT_MENU, CT_CONTEXT_MENU]] controls.
Commands to manipulate [[DialogControls-Menu| Menu / CT_MENU_STRIP, CT_MENU, CT_CONTEXT_MENU]] controls.
'''Example for [[Eden Editor]]'''
{{cc|Create main folder}}
[[disableSerialization]];
[[private]] _ctrlMenuStrip = [[findDisplay]] 313 [[displayCtrl]] 120;
[[private]] _indexMain = _ctrlMenuStrip [[menuAdd]] [[], "Custom Tools"];
 
{{cc|Create first subentry which is not checkable but has an action}}
[[private]] _indexUncheckable = _ctrlMenuStrip [[menuAdd]] [[_indexMain],"This entry can not be checked"];
_ctrlMenuStrip [[menuSetAction]] [[_indexMain,_indexUncheckable], "[[systemChat]] 'Hello World!'"];
{{cc|Create second subentry which is checkable and has an action}}
[[private]] _indexCheckable = _ctrlMenuStrip [[menuAdd]] [[_indexMain],"This entry is checkable"];
_ctrlMenuStrip [[menuSetAction]] [[_indexMain,_indexCheckable], "[[systemChat]] 'Hello World!'"];
_ctrlMenuStrip [[menuSetCheck]] [[_indexMain,_indexCheckable], true];
{{cc|Create third subentry which shows an image and has an action}}
[[private]] _indexPicture = _ctrlMenuStrip [[menuAdd]] [[_indexMain],"This entry has a picture"];
_ctrlMenuStrip [[menuSetAction]] [[_indexMain,_indexPicture], "[[systemChat]] 'Hello World!'"];
_ctrlMenuStrip [[menuSetPicture]] [[_indexMain,_indexPicture],"\a3\modules_f\data\iconunlock_ca.paa"];


[[Category:Command Group: GUI Control]]
[[Category:Command Group: GUI Control]]

Revision as of 00:07, 15 October 2020

Commands to manipulate Menu / CT_MENU_STRIP, CT_MENU, CT_CONTEXT_MENU controls.

Example for Eden Editor

// Create main folder
disableSerialization;
private _ctrlMenuStrip = findDisplay 313 displayCtrl 120;
private _indexMain = _ctrlMenuStrip menuAdd [[], "Custom Tools"];
 
// Create first subentry which is not checkable but has an action
private _indexUncheckable = _ctrlMenuStrip menuAdd [[_indexMain],"This entry can not be checked"];
_ctrlMenuStrip menuSetAction [[_indexMain,_indexUncheckable], "systemChat 'Hello World!'"];
// Create second subentry which is checkable and has an action
private _indexCheckable = _ctrlMenuStrip menuAdd [[_indexMain],"This entry is checkable"];
_ctrlMenuStrip menuSetAction [[_indexMain,_indexCheckable], "systemChat 'Hello World!'"];
_ctrlMenuStrip menuSetCheck [[_indexMain,_indexCheckable], true];
// Create third subentry which shows an image and has an action
private _indexPicture = _ctrlMenuStrip menuAdd [[_indexMain],"This entry has a picture"];
_ctrlMenuStrip menuSetAction [[_indexMain,_indexPicture], "systemChat 'Hello World!'"];
_ctrlMenuStrip menuSetPicture [[_indexMain,_indexPicture],"\a3\modules_f\data\iconunlock_ca.paa"];