CT TOOLBOX: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Redirected page to DialogControls-Toolbox)
 
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
#REDIRECT [[DialogControls-Toolbox]]
[[Category: Control Types]]
 
{{CT|intro
 
|macro = CT_TOOLBOX
|value = 6
|description =A Toolbox is a set of options, ordered by columns and rows. Only one can be active at a time and one is always selected (the first one by default). For Toolbox with multiple selections see [[CT_CHECKBOXES]].<br>
|gallery=File:CToolBox.jpg{{!}}A [[CT_TOOLBOX]] control with the 5th entry selected.
File:CToolBox_picture.jpg{{!}}The toolbox can be set to display images instead too.
|commands =
* [[:Category:Command_Group:_GUI_Control_-_ListBox|Commands: Listbox]]
|events =
* [[User_Interface_Event_Handlers#Listbox_events|Events: Listbox]]
}}
 
{{CT|abc start}}
=== C ===
{{CT|attribute
|name=checked_strings
|type1=Array
|value1={"[Entry 1]","[Entry 2]","[Entry 3]","[Entry 4]","[Entry 5]","[Entry 6]"}
|description=Options texts to display when an option is selected.
}}
 
{{CT|attribute
|name=color
|type1=Array
|value1={0.95,0.95,0.95,1}
|description=
}}
 
{{CT|attribute
|name=colorBackground
|type1=Array
|value1={0.95,0.95,0.95,1}
|description=Color of the background when option is not selected.
}}
 
{{CT|attribute
|name=colorDisable
|type1=Array
|value1={0,0,0,0}
|description=
}}
 
{{CT|attribute
|name=colorSelect
|type1=Array
|value1={0.95,0.95,0.95,1}
|description=
}}
 
{{CT|attribute
|name=colorSelectedBg
|type1=Array
|value1={"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])",0.5}
|description=Color of the background when option is selected.
}}
 
{{CT|attribute
|name=colorTextDisable
|type1=Array
|value1={0.4,0.4,0.4,1}
|description=
}}
 
{{CT|attribute
|name=colorTextSelect
|type1=Array
|value1={1,1,1,1}
|description=Color of the selected option text.
}}
 
{{CT|attribute
|name=columns
|type1=Number
|value1=3
|type2=String
|value2="4 - 1"
|description=Amount of columns to arrange options into.
}}
 
=== N ===
{{CT|attribute
|name=names
|type1=Array
|value1={"MOVE","GETOUT","UNLOAD","TR UNLOAD","%1/cfgWaypoints/A3/Land","%1/cfgWaypoints/A3/Artillery","UNHOOK"}
|description=
}}
 
=== R ===
{{CT|attribute
|name=rows
|type1=Number
|value1=2
|description=Amount of rows to arrange options into.
}}
 
=== S ===
{{CT|attribute
|name=strings
|type1=Array
|value1={"100m","200m","500m"}
|description=Options texts to display.
}}
 
=== T ===
{{CT|attribute
|name=tooltips
|type1=Array
|value1={"Objects","Compositions","Triggers","Systems","Markers"}
|description=Tooltips for each option.
}}
 
=== V ===
{{CT|attribute
|name=values
|type1=Array
|value1={0,1,2,3,4,5,6}
|description=Numerical values associated with items. Can be retrieved or set with [[lbValue]] and [[lbSetValue]].
}}
 
{{CT|abc end}}
 
{{CT|examples}}
=== RscExample ===
<syntaxhighlight lang="cpp">
class RscToolbox
{
deletable = 0;
fade = 0;
access = 0;
type = CT_TOOLBOX;
style = ST_CENTER;
colorText[] = {0.95,0.95,0.95,1};
color[] = {0.95,0.95,0.95,1};
colorTextSelect[] = {0.95,0.95,0.95,1};
colorSelect[] = {0.95,0.95,0.95,1};
colorTextDisable[] = {0.4,0.4,0.4,1};
colorDisable[] = {0.4,0.4,0.4,1};
colorSelectedBg[] =
{
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])",
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])",
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])",
0.5
};
shadow = 0;
strings[] =
{
"",
""
};
x = 0;
y = 0;
w = 0.3;
h = 0.025;
rows = 1;
columns = 2;
font = "RobotoCondensed";
sizeEx = GUI_TEXT_SIZE_SMALL;
};
</syntaxhighlight>

Latest revision as of 12:04, 12 June 2021


Introduction

A Toolbox is a set of options, ordered by columns and rows. Only one can be active at a time and one is always selected (the first one by default). For Toolbox with multiple selections see CT_CHECKBOXES.

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_TOOLBOX 6


C

checked_strings

Type
Array
Description
Options texts to display when an option is selected.
checked_strings[] = {"[Entry 1]","[Entry 2]","[Entry 3]","[Entry 4]","[Entry 5]","[Entry 6]"};


color

Type
Array
Description
n/a
color[] = {0.95,0.95,0.95,1};


colorBackground

Type
Array
Description
Color of the background when option is not selected.
colorBackground[] = {0.95,0.95,0.95,1};


colorDisable

Type
Array
Description
n/a
colorDisable[] = {0,0,0,0};


colorSelect

Type
Array
Description
n/a
colorSelect[] = {0.95,0.95,0.95,1};


colorSelectedBg

Type
Array
Description
Color of the background when option is selected.
colorSelectedBg[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])",0.5};


colorTextDisable

Type
Array
Description
n/a
colorTextDisable[] = {0.4,0.4,0.4,1};


colorTextSelect

Type
Array
Description
Color of the selected option text.
colorTextSelect[] = {1,1,1,1};


columns

Type
Number, String
Description
Amount of columns to arrange options into.

Number example:

columns = 3;

String example:

columns = "4 - 1";


N

names

Type
Array
Description
n/a
names[] = {"MOVE","GETOUT","UNLOAD","TR UNLOAD","%1/cfgWaypoints/A3/Land","%1/cfgWaypoints/A3/Artillery","UNHOOK"};


R

rows

Type
Number
Description
Amount of rows to arrange options into.
rows = 2;


S

strings

Type
Array
Description
Options texts to display.
strings[] = {"100m","200m","500m"};


T

tooltips

Type
Array
Description
Tooltips for each option.
tooltips[] = {"Objects","Compositions","Triggers","Systems","Markers"};


V

values

Type
Array
Description
Numerical values associated with items. Can be retrieved or set with lbValue and lbSetValue.
values[] = {0,1,2,3,4,5,6};



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.

RscExample

class RscToolbox
{
	deletable = 0;
	fade = 0;
	access = 0;
	type = CT_TOOLBOX;
	style = ST_CENTER;
	colorText[] = {0.95,0.95,0.95,1};
	color[] = {0.95,0.95,0.95,1};
	colorTextSelect[] = {0.95,0.95,0.95,1};
	colorSelect[] = {0.95,0.95,0.95,1};
	colorTextDisable[] = {0.4,0.4,0.4,1};
	colorDisable[] = {0.4,0.4,0.4,1};
	colorSelectedBg[] =
	{
		"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])",
		"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])",
		"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])",
		0.5
	};
	shadow = 0;
	strings[] =
	{
		"",
		""
	};
	x = 0;
	y = 0;
	w = 0.3;
	h = 0.025;
	rows = 1;
	columns = 2;
	font = "RobotoCondensed";
	sizeEx = GUI_TEXT_SIZE_SMALL;
};