DialogControls-Tree: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "Color" to "Color (RGBA)")
Line 18: Line 18:
|-
|-
| '''colorBorder'''
| '''colorBorder'''
| [[Color]]
| [[Color|Color (RGBA)]]
| With borderSize = 1 determines the color of that border
| With borderSize = 1 determines the color of that border
|-
|-
| '''colorArrow'''
| '''colorArrow'''
| [[Color]]
| [[Color|Color (RGBA)]]
| Has no effect but without it an error is thrown
| Has no effect but without it an error is thrown
|-
|-
| '''colorLines'''
| '''colorLines'''
| [[Color]]
| [[Color|Color (RGBA)]]
| These lines connect the different entries for better clarity
| These lines connect the different entries for better clarity
|-
|-
| '''colorMarked'''
| '''colorMarked'''
| [[Color]]
| [[Color|Color (RGBA)]]
| Background color of all subsequently selected entries when multiselectEnabled = 1;
| Background color of all subsequently selected entries when multiselectEnabled = 1;
|-
|-
| '''colorMarkedSelected'''
| '''colorMarkedSelected'''
| [[Color]]
| [[Color|Color (RGBA)]]
| Background color of the first selected entry with multiselectEnabled = 1;
| Background color of the first selected entry with multiselectEnabled = 1;
|-
|-
| '''colorMarkedText'''
| '''colorMarkedText'''
| [[Color]]
| [[Color|Color (RGBA)]]
| Text color of secondarly selected entries with multiselectEnabled = 1;
| Text color of secondarly selected entries with multiselectEnabled = 1;
|-
|-
| '''colorPicture'''
| '''colorPicture'''
| [[Color]]
| [[Color|Color (RGBA)]]
| Left picture color of an unselected entry
| Left picture color of an unselected entry
|-
|-
| '''colorPictureDisabled'''
| '''colorPictureDisabled'''
| [[Color]]
| [[Color|Color (RGBA)]]
| Left picture color when control is disabled
| Left picture color when control is disabled
|-
|-
| '''colorPictureRight'''
| '''colorPictureRight'''
| [[Color]]
| [[Color|Color (RGBA)]]
| Right picture color of an unselected entry
| Right picture color of an unselected entry
|-
|-
| '''colorPictureRightDisabled'''
| '''colorPictureRightDisabled'''
| [[Color]]
| [[Color|Color (RGBA)]]
| Right picture color when control is disabled
| Right picture color when control is disabled
|-
|-
| '''colorPictureRightSelected'''
| '''colorPictureRightSelected'''
| [[Color]]
| [[Color|Color (RGBA)]]
| Right picture color of an selected entry
| Right picture color of an selected entry
|-
|-
| '''colorPictureSelected'''
| '''colorPictureSelected'''
| [[Color]]
| [[Color|Color (RGBA)]]
| Left picture color of an selected entry
| Left picture color of an selected entry
|-
|-
| '''colorSearch'''
| '''colorSearch'''
| [[Color]]
| [[Color|Color (RGBA)]]
| Color of then entries that fit the search of the idcSearch listbox
| Color of then entries that fit the search of the idcSearch listbox
|-
|-
| '''colorSelect'''
| '''colorSelect'''
| [[Color]]
| [[Color|Color (RGBA)]]
| Entry's background when multiselectEnabled = 0;
| Entry's background when multiselectEnabled = 0;
|-
|-
| '''colorSelectBackground'''
| '''colorSelectBackground'''
| [[Color]]
| [[Color|Color (RGBA)]]
| Not used?
| Not used?
|-
|-
| '''colorSelectText'''
| '''colorSelectText'''
| [[Color]]
| [[Color|Color (RGBA)]]
| Text color of a selected entry with multiselectEnabled = 0;
| Text color of a selected entry with multiselectEnabled = 0;
|-
|-
| '''expandedTexture'''
| '''expandedTexture'''
| [[Color]]
| [[Color|Color (RGBA)]]
| "Arrow" texture on the left side, if non is given ("") a minus with box will be displayed
| "Arrow" texture on the left side, if non is given ("") a minus with box will be displayed
|-
|-

Revision as of 15:53, 16 October 2020

CT_TREE Type=12

The CT_TREE, also referred to as tree view (tv), is a control with similar functionality as the CT_LISTBOX. In addition to that it supports multiple levels of entries as well as a search functionality.

The engine driven search is very slow. Searching a tree view with many entries can freeze the game.

Properties

TokenNames common to most controls, such as x, y, w, h, text, idc... can be found here.
Properties
Name Type Remark
borderSize Boolean Shows a border around the control
colorBorder Color (RGBA) With borderSize = 1 determines the color of that border
colorArrow Color (RGBA) Has no effect but without it an error is thrown
colorLines Color (RGBA) These lines connect the different entries for better clarity
colorMarked Color (RGBA) Background color of all subsequently selected entries when multiselectEnabled = 1;
colorMarkedSelected Color (RGBA) Background color of the first selected entry with multiselectEnabled = 1;
colorMarkedText Color (RGBA) Text color of secondarly selected entries with multiselectEnabled = 1;
colorPicture Color (RGBA) Left picture color of an unselected entry
colorPictureDisabled Color (RGBA) Left picture color when control is disabled
colorPictureRight Color (RGBA) Right picture color of an unselected entry
colorPictureRightDisabled Color (RGBA) Right picture color when control is disabled
colorPictureRightSelected Color (RGBA) Right picture color of an selected entry
colorPictureSelected Color (RGBA) Left picture color of an selected entry
colorSearch Color (RGBA) Color of then entries that fit the search of the idcSearch listbox
colorSelect Color (RGBA) Entry's background when multiselectEnabled = 0;
colorSelectBackground Color (RGBA) Not used?
colorSelectText Color (RGBA) Text color of a selected entry with multiselectEnabled = 0;
expandedTexture Color (RGBA) "Arrow" texture on the left side, if non is given ("") a minus with box will be displayed
hiddenTexture String "Arrow" texture on the left side, if non is given ("") a plus with box will be displayed
expandOnDoubleclick Boolean Enable/disable expanding and collapsing with double-click
idcSearch Integer idc of a CT_EDIT control which functions as the search input
maxHistoryDelay Number Time since last keyboard type search to reset it
multiselectEnabled Boolean Enable/disable multi selection with CTRL or SHIFT to select all entries up to the first selected entry
rowHeight Boolean? Not used?


Example config

A CT_TREE in A3 1.96.
A CT_TREE with search in A3 1.96.
class Dialog
{
	idd = -1;
	class Controls
	{
		class _CT_EDIT
		{
			idc = 100;
			type = 2;
			style = "512";
			x = GUI_GRID_CENTER_X + 10 * GUI_GRID_CENTER_W;
			y = GUI_GRID_CENTER_Y + 0 * GUI_GRID_CENTER_H;
			w = 20 * GUI_GRID_CENTER_W;
			h = 2 * GUI_GRID_CENTER_H;
			font = "PuristaMedium";
			sizeEx = 0.04;
			autocomplete = "";
			canModify = true; 
			maxChars = 100; 
			forceDrawCaret = false;
			colorSelection[] = {0,1,0,1};
			colorText[] = {1,1,1,1};
			colorDisabled[] = {1,0,0,1}; 
			colorBackground[] = {0,0,0,0.8};
			text = "";
			tooltip = "Type to search";
		};
		class _CT_TREE
		{
			/* Common properties */
			idc = 200;
            /* Add some entries */
			onLoad = "params ['_tv'];\
					_classes = 'true' configClasses (configFile >> 'CfgVehicles');\
					for '_i' from 0 to 10 do\
					{\
						_tv tvAdd [[], configName selectRandom _classes];\
						for '_j' from 0 to 10 do\
						{\
							_tv tvAdd [[_i], configName selectRandom _classes];\
							for '_k' from 0 to 10 do\
							{\
								_tv tvAdd [[_i, _j], configName selectRandom _classes];\
							};\
						};\
					};";
			moving = 0;
			type = CT_TREE;
			style = ST_LEFT;
			x = GUI_GRID_CENTER_X + 10 * GUI_GRID_CENTER_W;
			y = GUI_GRID_CENTER_Y + 3 * GUI_GRID_CENTER_H;
			w = 20 * GUI_GRID_CENTER_W;
			h = 23 * GUI_GRID_CENTER_H;
			sizeEx = GUI_TEXT_SIZE_MEDIUM;
			font = "RobotoCondensed";
			colorText[] = {1,1,1,1};
			colorBackground[] = {0,0,0,0.8};
			colorDisabled[] = {1,1,1,0.25};
			shadow = 0;
			access = 0;

			/* CT_TREE specific properties */
			idcSearch = 100;
			colorSelect[] = {1,1,1,0.7};
			colorSelectText[] = {0,0,0,1};
			colorBorder[] = {0,0,0,0};
			colorSearch[] =
			{
				"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])",
				"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])",
				"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])",
				"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"
			};
			colorMarked[] = {0.2,0.3,0.7,1};
			colorMarkedText[] = {0,0,0,1};
			colorMarkedSelected[] = {0,0.5,0.5,1};
			multiselectEnabled = 0;
			colorPicture[] = {1,1,1,1};
			colorPictureSelected[] = {0,0,0,1};
			colorPictureDisabled[] = {1,1,1,0.25};
			colorPictureRight[] = {1,1,1,1};
			colorPictureRightSelected[] = {0,0,0,1};
			colorPictureRightDisabled[] = {1,1,1,0.25};
			colorArrow[] = {1,1,1,1};
			maxHistoryDelay = 1;
			colorSelectBackground[] = {0,0,0,0.5};
			colorLines[] = {0,0,0,0};
			class ScrollBar: ScrollBar
			{
			};
			expandedTexture = "A3\ui_f\data\gui\rsccommon\rsctree\expandedTexture_ca.paa";
			hiddenTexture = "A3\ui_f\data\gui\rsccommon\rsctree\hiddenTexture_ca.paa";
			rowHeight = 0.0439091;
			borderSize = 0;
			expandOnDoubleclick = 1;

			/* CT_TREE user interface eventhandlers */
			onTreeSelChanged = "systemChat str ['onTreeSelChanged',_this]; false";
			onTreeLButtonDown = "systemChat str ['onTreeLButtonDown',_this]; false";
			onTreeDblClick = "systemChat str ['onTreeDblClick',_this]; false";
			onTreeExpanded = "systemChat str ['onTreeExpanded',_this]; false";
			onTreeCollapsed = "systemChat str ['onTreeCollapsed',_this]; false";
			onTreeMouseMove = "systemChat str ['onTreeMouseMove',_this]; false";
			onTreeMouseHold = "systemChat str ['onTreeMouseHold',_this]; false";
			onTreeMouseExit = "systemChat str ['onTreeMouseExit',_this]; false";
		};
	};
};

Commands