CT MENU STRIP: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "};</syntaxhighlight>" to "}; </syntaxhighlight>")
(added more information, removed unused properties)
Line 16: Line 16:
|type1=String
|type1=String
|value1="\a3\3DEN\Data\Controls\ctrlMenu\arrow_ca.paa"
|value1="\a3\3DEN\Data\Controls\ctrlMenu\arrow_ca.paa"
|description=
|description= Icon used to navigate from second to third level.
}}
}}


Line 24: Line 24:
|type1=Array
|type1=Array
|value1={0,0,0,0}
|value1={0,0,0,0}
|description=
|description= Color of the border drawn around the menu strip and the flyout.
}}
}}


Line 31: Line 31:
|type1=Array
|type1=Array
|value1={1,1,1,1}
|value1={1,1,1,1}
|description=
|description= Default picture color.
}}
}}


Line 38: Line 38:
|type1=Array
|type1=Array
|value1={1,1,1,0.5}
|value1={1,1,1,0.5}
|description=
|description= Picture color when menu strip is disabled.
}}
}}


Line 45: Line 45:
|type1=Array
|type1=Array
|value1={0,0,0,1}
|value1={0,0,0,1}
|description=
|description= Picture color when entry is selected. All levels!
}}
}}


Line 52: Line 52:
|type1=Array
|type1=Array
|value1={0,0,0,1}
|value1={0,0,0,1}
|description=
|description= Text color when entry is selected. All levels!
}}
}}


Line 59: Line 59:
|type1=Array
|type1=Array
|value1={"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])",1}
|value1={"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])",1}
|description=
|description= Background color when entry is selected. Only sub first level.
}}
}}


Line 66: Line 66:
|type1=Array
|type1=Array
|value1={0,0,0,0}
|value1={0,0,0,0}
|description=
|description= Background color.
}}
}}


Line 73: Line 73:
|type1=Array
|type1=Array
|value1={1,1,1,0.25}
|value1={1,1,1,0.25}
|description=
|description= Does not seem to do anything.
}}
}}


Line 80: Line 80:
|type1=Array
|type1=Array
|value1={0,0,0,1}
|value1={0,0,0,1}
|description=
|description= Does not seem to do anything.
}}
}}


Line 87: Line 87:
|type1=Array
|type1=Array
|value1={"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])",1}
|value1={"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])",1}
|description=
|description= Background color when entry is selected. First level only!
}}
}}


Line 102: Line 102:
|type1=Array
|type1=Array
|value1={1,1,1,1}
|value1={1,1,1,1}
|description=
|description= Text color
}}
}}


Line 139: Line 139:
|type1=Number
|type1=Number
|value1=0.01
|value1=0.01
|description=Vertical distance between two entries.
|description=Vertical distance between two entries. Will cause icons and text to not be aligned anymore if anything else than default value is used.
}}
}}


Line 146: Line 146:
|type1=Number
|type1=Number
|value1=0.01
|value1=0.01
|description=Horizontal distance between two entries.
|description=Horizontal distance between two entries. (Seems to have no effect)
}}
}}


Line 154: Line 154:
|type1=String
|type1=String
|value1="#(argb,8,8,3)color(0,0,0,0)"
|value1="#(argb,8,8,3)color(0,0,0,0)"
|description=
|description= Icon shown if entry was disabled. Seems to have no effect since there is no way to disable an entry.
}}
}}


Line 161: Line 161:
|type1=String
|type1=String
|value1="\a3\3DEN\Data\Controls\CtrlMenu\pictureCheckboxEnabled_ca.paa"
|value1="\a3\3DEN\Data\Controls\CtrlMenu\pictureCheckboxEnabled_ca.paa"
|description=
|description= Icon shown if entry was selected. Needs to be scripted.
}}
 
{{CT|attribute
|name=pictureRadioDisabled
|type1=String
|value1="#(argb,8,8,3)color(0,0,0,0)"
|description=
}}
 
{{CT|attribute
|name=pictureRadioEnabled
|type1=String
|value1="\a3\3DEN\Data\Controls\CtrlMenu\pictureRadioEnabled_ca.paa"
|description=
}}
 
=== R ===
{{CT|attribute
|name=rowHeight
|type1=Number
|value1=0
|description=
}}
}}


Line 191: Line 169:
|type1=String
|type1=String
|value1="Checkbox"
|value1="Checkbox"
|description= Can be "checkbox". (Other control types no tested) When selected, the status is indicated by a tick mark.
|description= Can be "Checkbox". (Other control types were not tested) When selected, the status is indicated by a tick mark.
}}
}}



Revision as of 09:32, 17 June 2021

Introduction

Control with expandable sublists. The top bar in 3den uses this CT.

Related commands & functions

Related User Interface Eventhandlers

Alphabetical Order

TokenNames common to most controls, such as x, y, w, h, text, idc... can be found here.
Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with this config crawler.
#define CT_MENU_STRIP 47


A

arrow

Type
String
Description
Icon used to navigate from second to third level.
arrow = "\a3\3DEN\Data\Controls\ctrlMenu\arrow_ca.paa";


C

colorBorder

Type
Array
Description
Color of the border drawn around the menu strip and the flyout.
colorBorder[] = {0,0,0,0};


colorPicture

Type
Array
Description
Default picture color.
colorPicture[] = {1,1,1,1};


colorPictureDisabled

Type
Array
Description
Picture color when menu strip is disabled.
colorPictureDisabled[] = {1,1,1,0.5};


colorPictureSelect

Type
Array
Description
Picture color when entry is selected. All levels!
colorPictureSelect[] = {0,0,0,1};


colorSelect

Type
Array
Description
Text color when entry is selected. All levels!
colorSelect[] = {0,0,0,1};


colorSelectBackground

Type
Array
Description
Background color when entry is selected. Only sub first level.
colorSelectBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])",1};


colorStripBackground

Type
Array
Description
Background color.
colorStripBackground[] = {0,0,0,0};


colorStripDisabled

Type
Array
Description
Does not seem to do anything.
colorStripDisabled[] = {1,1,1,0.25};


colorStripSelect

Type
Array
Description
Does not seem to do anything.
colorStripSelect[] = {0,0,0,1};


colorStripSelectBackground

Type
Array
Description
Background color when entry is selected. First level only!
colorStripSelectBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])",1};


D

default

Type
"false"
Description
Sets the default state of the checkbox, see type property.
default = "false";


colorStripText

Type
Array
Description
Text color
colorStripText[] = {1,1,1,1};


I

Items

Type
Class
Description
List of entries ordered in subclasses. The Default class needs to be defined.
class Items
{
	items[] = {"File","Edit","View","Attributes","Tools","Options","Preview","Help"};
	class File
	{
		text = "Scenario";
		items[] = {"MissionNew","MissionOpen","MissionSave","MissionSaveAs","Separator","MissionPublishSteam","MissionExport","MissionMerge","Separator","MissionStats","MissionAddons","MissionFolder","LogFolder","Separator","Exit"};
		data = "test1";
		value = 1;
	};
	class MissionNew
	{
		text = "New";
		data = "MissionNew";
		shortcuts[] = {"512 + 0x31"};
		picture = "\a3\3DEN\Data\Displays\Display3DEN\ToolBar\new_ca.paa";
		opensNewWindow = 1;
	};
	class Default //Default entries, otherwise error is shown upon creation of the display (Needs further investigation)
	{
		text = "Default";
	};
};


itemSpacingH

Type
Number
Description
Vertical distance between two entries. Will cause icons and text to not be aligned anymore if anything else than default value is used.
itemSpacingH = 0.01;


itemSpacingW

Type
Number
Description
Horizontal distance between two entries. (Seems to have no effect)
itemSpacingW = 0.01;


P

pictureCheckboxDisabled

Type
String
Description
Icon shown if entry was disabled. Seems to have no effect since there is no way to disable an entry.
pictureCheckboxDisabled = "#(argb,8,8,3)color(0,0,0,0)";


pictureCheckboxEnabled

Type
String
Description
Icon shown if entry was selected. Needs to be scripted.
pictureCheckboxEnabled = "\a3\3DEN\Data\Controls\CtrlMenu\pictureCheckboxEnabled_ca.paa";


T

type

Type
String
Description
Can be "Checkbox". (Other control types were not tested) When selected, the status is indicated by a tick mark.
type = "Checkbox";



Default Classes

Arma 3
AddOns: Classes need to be initialised first with class SomeClass;

Missions: Since Arma 3 v2.02 one can use import SomeClass; to initialise a class (see the import keyword).

In older versions, use "Default" call BIS_fnc_exportGUIBaseClasses; and paste the result into the description.ext.


None

Other Examples

class MenuStrip
{
	idc=120;
	type=CT_MENU_STRIP;
	colorStripBackground[]={0,0,0,1};
	colorStripText[]={1,1,1,1};
	colorStripSelect[]={0,0,0,1};
	colorStripSelectBackground[]=
	{
		"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])",
		"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])",
		"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])",
		1
	};
	colorStripDisabled[]={1,1,1,0.25};
	x="safezoneX";
	y="safezoneY";
	w="safezoneW - 	5 * (pixelW * pixelGrid * 	0.50)";
	h="5 * (pixelH * pixelGrid * 	0.50)";
	colorStripBackground[]={0,0,0,0};
	colorBackground[]={0.1,0.1,0.1,1};
	font="RobotoCondensedLight";
	colorBorder[]={0,0,0,0};
	colorText[]={1,1,1,1};
	colorSelect[]={0,0,0,1};
	colorSelectBackground[]=
	{
		"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])",
		"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])",
		"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])",
		1
	};
	colorDisabled[]={1,1,1,0.25};
	colorPicture[]={1,1,1,1};
	colorPictureSelect[]={0,0,0,1};
	colorPictureDisabled[]={1,1,1,0.5};
	arrow="\a3\3DEN\Data\Controls\ctrlMenu\arrow_ca.paa";
	rowHeight=0;
	itemSpacingW=0.0099999998;
	itemSpacingH=0.0099999998;
	pictureCheckboxEnabled="\a3\3DEN\Data\Controls\CtrlMenu\pictureCheckboxEnabled_ca.paa";
	pictureCheckboxDisabled="#(argb,8,8,3)color(0,0,0,0)";
	pictureRadioEnabled="\a3\3DEN\Data\Controls\CtrlMenu\pictureRadioEnabled_ca.paa";
	pictureRadioDisabled="#(argb,8,8,3)color(0,0,0,0)";
	class Items
	{
		items[]=
		{
			"entry1",
			"entry2",
			"entry3",
		};
		class entry1
		{
			text="First Entry";
			items[]=
			{
				"sub1_1",
				"sub1_2"
			};
		};
		class sub1_1
		{
			text="First Sub Entry";
			action= systemchat ""Sub entry one."";";
		};
		class sub1_2
		{
			text="Second Sub Entry";
		};
		class entry2
		{
			text="Entry 2, no sub menu";
			action="systemchat ""Entry 2."";";
		};
		class entry3
		{
			text="Fancy entry 3";
			action ="systemchat ""Entry 3."";";
			data="CustomData";
			shortcuts[]= 
			{
				"512 + 0x31" // STRG+N
			};
			picture="\a3\3DEN\Data\Displays\Display3DEN\ToolBar\new_ca.paa";
		};
	};
};
class RscMenuStrip
{
	idd = -1;
	movingEnable = true;
	enableSimulation = true;
	onLoad = "";
	onUnload = "";
	class Controls
	{
		class MenuStrip: ctrlMenuStrip
		{
			idc = 1000;
			x = safeZoneX;
			y = (safeZoneY + (safezoneH * 0.132));
			w =  safezoneW;
			h = (safezoneH  * 0.03);
			class Items
			{
				items[] = //First Level Entries, when editing an existing menu strip, one can use the += operator to add new entries without overwriting the old ones
				{
					"Menu1",
					"Menu2"
				};
	 			class Menu1
				{
					text = "Menu 1";
					items[] = //Second Level Entries
					{
						"WebLink"
					};
				};
				class Menu2
				{
					text = "Menu 2";
					items[] = //Second Level Entries
					{
						"SayHello",
						"PlayMusic"
					};
				};
				class WebLink
				{
					text = "Go to Arma 3 Webpage"; //Display name of menu entry
					picture = "\A3\Ui_f\data\Logos\arma3_white_ca.paa"; //Picture shown in front of text
					weblink = "https://arma3.com/"; //Opens a web page in default webbrowser
					opensNewWindow = 1; //Adds ... after text, indicating that this menu entry will open a new display
				};
				class SayHello
				{
					text = "Say Hello";
					action = "systemChat 'Hello World!'"; //Code executed when entry is clicked
				};
				class PlayMusic
				{
					text = "Play Music";
					picture = "\a3\Modules_F_Curator\Data\portraitMusic_ca.paa";
					action = "playMusic 'Track15_MainTheme'";
				};
				class Default //Default entries, otherwise error is shown upon creation of the display (Needs further investigation)
				{
					text = "Default";
				};
			};
		};
	};
};