{"name":"CT TREE","title":"CT TREE","type":"topic","url":"https://community.bistudio.com/wiki/CT_TREE","revid":352088,"updated":"2024-02-01T23:24:41Z","aliases":["DialogControls-Tree","Tree View"],"markdown":"### Introduction\n\nThe 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.\nSince Arma 3 v2.01: Multiple selections are now also supported via commands.\n\n> [!IMPORTANT]\n> The engine driven search is very slow. Searching a tree view with many entries can freeze the game.\n\n#### Related commands & functions\n\n- Commands: General\n- Commands: UI Eventhandlers\n- Commands: Tree View\n\n#### Related User Interface Eventhandlers\n\n- Events: General\n- Events: Tree View\n\n### Alphabetical Order\n\n> [!NOTE]\n> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found **here**.\n\n> [!WARNING]\n> Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [this](https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf) config crawler.\n\n```cpp\n#define CT_TREE 12\n```\n\n#### B\n\n##### borderSize\n\n**Type:** Number\n\n**Description:** Shows a border around the control. Setting the size to 0 will not hide the border. Set the `colorBorder` to transparent instead.\n\n```cpp\nborderSize = 0;\n```\n\n#### C\n\n##### colorArrow\n\n> [!IMPORTANT]\n> This attribute is mandatory for the control to work!\n\n**Type:** Array\n\n**Description:** Has no effect but without it an error is thrown.\n\n```cpp\ncolorArrow[] = {1,1,1,1};\n```\n\n##### colorBorder\n\n**Type:** Array\n\n**Description:** With `borderSize = 1` determines the color of that border.\n\n```cpp\ncolorBorder[] = {0,0,0,0};\n```\n\n##### colorLines\n\n**Type:** Array\n\n**Description:** These lines connect the different entries for better clarity.\n\n```cpp\ncolorLines[] = {0,0,0,0};\n```\n\n##### colorMarked\n\n**Type:** Array\n\n**Description:** Background color of all subsequently selected entries when `multiselectEnabled = 1;`.\n\n```cpp\ncolorMarked[] = {0.2,0.3,0.7,1};\n```\n\n##### colorMarkedSelected\n\n**Type:** Array\n\n**Description:** Background color of the first selected entry with `multiselectEnabled = 1;`.\n\n```cpp\ncolorMarkedSelected[] = {0,0.5,0.5,1};\n```\n\n##### colorMarkedText\n\n**Type:** Array\n\n**Description:** Text color of secondarly selected entries with `multiselectEnabled = 1;`.\n\n```cpp\ncolorMarkedText[] = {0,0,0,1};\n```\n\n##### colorPicture\n\n**Type:** Array\n\n**Description:** Left picture color of an unselected entry.\n\n```cpp\ncolorPicture[] = {1,1,1,1};\n```\n\n##### colorPictureDisabled\n\n**Type:** Array\n\n**Description:** Left picture color when control is disabled.\n\n```cpp\ncolorPictureDisabled[] = {1,1,1,0.25};\n```\n\n##### colorPictureRight\n\n**Type:** Array\n\n**Description:** Right picture color of an unselected entry.\n\n```cpp\ncolorPictureRight[] = {1,1,1,1};\n```\n\n##### colorPictureRightDisabled\n\n**Type:** Array\n\n**Description:** Right picture color when control is disabled.\n\n```cpp\ncolorPictureRightDisabled[] = {1,1,1,0.25};\n```\n\n##### colorPictureRightSelected\n\n**Type:** Array\n\n**Description:** Right picture color of an selected entry.\n\n```cpp\ncolorPictureRightSelected[] = {0,0,0,1};\n```\n\n##### colorPictureSelected\n\n**Type:** Array\n\n**Description:** Left picture color of an selected entry.\n\n```cpp\ncolorPictureSelected[] = {1,1,1,1};\n```\n\n##### colorSearch\n\n**Type:** Array\n\n**Description:** Color of the entries that fit the search of the idcSearch listbox.\n\n```cpp\ncolorSearch[] = {\"(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};\n```\n\n##### colorSelect\n\n**Type:** Array\n\n**Description:** Entry's background when `multiselectEnabled = 0;`.\n\n```cpp\ncolorSelect[] = {\"(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};\n```\n\n##### colorSelectBackground\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelectBackground[] = {0,0,0,0.5};\n```\n\n##### colorSelectText\n\n**Type:** Array\n\n**Description:** Text color of a selected entry with `multiselectEnabled = 0;`.\n\n```cpp\ncolorSelectText[] = {0,0,0,1};\n```\n\n#### D\n\n##### defaultItem\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ndefaultItem[] = {\"BLU_F\",\"Infantry\"};\n```\n\n##### disableKeyboardSearch\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\ndisableKeyboardSearch = 1;\n```\n\n##### disableSearchHighlight\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\ndisableSearchHighlight = 1;\n```\n\n#### E\n\n##### expandedTexture\n\n**Type:** String\n\n**Description:** \"Arrow\" texture on the left side, if non is given (\"\") a minus with box will be displayed.\n\n```cpp\nexpandedTexture = \"A3\\ui_f\\data\\gui\\rsccommon\\rsctree\\expandedTexture_ca.paa\";\n```\n\n##### expandOnDoubleclick\n\n**Type:** Number\n\n**Description:** Enable/disable expanding and collapsing with double-click.\n\n```cpp\nexpandOnDoubleclick = 1;\n```\n\n#### H\n\n##### hiddenTexture\n\n**Type:** String\n\n**Description:** \"Arrow\" texture on the left side, if non is given (\"\") a plus with box will be displayed.\n\n```cpp\nhiddenTexture = \"A3\\ui_f\\data\\gui\\rsccommon\\rsctree\\hiddenTexture_ca.paa\";\n```\n\n#### I\n\n##### iconFolder\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\niconFolder = \"\\a3\\3DEN\\Data\\Cfg3DEN\\Layer\\icon_ca.paa\";\n```\n\n##### iconFolderDefault\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\niconFolderDefault = \"\\a3\\3DEN\\Data\\Cfg3DEN\\Layer\\iconDefault_ca.paa\";\n```\n\n##### idcSearch\n\n**Type:** Number\n\n**Description:** IDC of a CT_EDIT control which functions as the search input.\n\n```cpp\nidcSearch = 283;\n```\n\n#### M\n\n##### maxHistoryDelay\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nmaxHistoryDelay = 1;\n```\n\n##### multiselectEnabled\n\n**Type:** Number\n\n**Description:** Enable/disable multi selection with CTRL or SHIFT to select all entries up to the first selected entry.\n\n> [!NOTE]\n> Commands to retrieve all selected entries in a multi selection tv are only available after Arma 3 v2.01.\n\n```cpp\nmultiselectEnabled = 1;\n```\n\n### Default Classes\n\n> [!NOTE]\n> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`\n>\n> ---\n>\n> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the import keyword).\n>\n> In older versions, use `\"Default\" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the description.ext.\n\n#### RscExample\n\n```cpp\nclass RscTree\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_TREE;\n    colorBackground[] = {0,0,0,0};\n    colorSelect[] = {1,1,1,0.7};\n    colorDisabled[] = {1,1,1,0.25};\n    colorText[] = {1,1,1,1};\n    colorSelectText[] = {0,0,0,1};\n    colorBorder[] = {0,0,0,0};\n    colorSearch[] =\n    {\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])\"\n    };\n    colorMarked[] = {0.2,0.3,0.7,1};\n    colorMarkedText[] = {0,0,0,1};\n    colorMarkedSelected[] = {0,0.5,0.5,1};\n    multiselectEnabled = 0;\n    colorPicture[] = {1,1,1,1};\n    colorPictureSelected[] = {0,0,0,1};\n    colorPictureDisabled[] = {1,1,1,0.25};\n    colorPictureRight[] = {1,1,1,1};\n    colorPictureRightSelected[] = {0,0,0,1};\n    colorPictureRightDisabled[] = {1,1,1,0.25};\n    colorArrow[] = {1,1,1,1};\n    maxHistoryDelay = 1;\n    shadow = 0;\n    style = ST_LEFT;\n    font = \"RobotoCondensed\";\n    sizeEx = GUI_TEXT_SIZE_MEDIUM;\n    expandedTexture = \"A3\\ui_f\\data\\gui\\rsccommon\\rsctree\\expandedTexture_ca.paa\";\n    hiddenTexture = \"A3\\ui_f\\data\\gui\\rsccommon\\rsctree\\hiddenTexture_ca.paa\";\n    x = 0;\n    y = 0;\n    w = 0.1;\n    h = 0.2;\n    rowHeight = 0.0439091;\n    colorSelectBackground[] = {0,0,0,0.5};\n    colorLines[] = {0,0,0,0};\n    borderSize = 0;\n    expandOnDoubleclick = 1;\n    class ScrollBar : ScrollBar\n    {\n    };\n};\n```\n\n### Other examples\n\n#### RscTree with search functionality\n\n```cpp\nclass Dialog\n{\n    idd = -1;\n    class Controls\n    {\n        class _CT_EDIT\n        {\n            idc = 100;\n            type = 2;\n            style = \"512\";\n            x = GUI_GRID_CENTER_X + 10 * GUI_GRID_CENTER_W;\n            y = GUI_GRID_CENTER_Y + 0 * GUI_GRID_CENTER_H;\n            w = 20 * GUI_GRID_CENTER_W;\n            h = 2 * GUI_GRID_CENTER_H;\n            font = \"PuristaMedium\";\n            sizeEx = 0.04;\n            autocomplete = \"\";\n            canModify = true;\n            maxChars = 100;\n            forceDrawCaret = false;\n            colorSelection[] = {0,1,0,1};\n            colorText[] = {1,1,1,1};\n            colorDisabled[] = {1,0,0,1};\n            colorBackground[] = {0,0,0,0.8};\n            text = \"\";\n            tooltip = \"Type to search\";\n        };\n        class _CT_TREE\n        {\n            /* Common properties */\n            idc = 200;\n            /* Add some entries */\n            onLoad = \"params ['_tv'];\\\n                    _classes = 'true' configClasses (configFile >> 'CfgVehicles');\\\n                    for '_i' from 0 to 10 do\\\n                    {\\\n                        _tv tvAdd [[], configName selectRandom _classes];\\\n                        for '_j' from 0 to 10 do\\\n                        {\\\n                            _tv tvAdd [[_i], configName selectRandom _classes];\\\n                            for '_k' from 0 to 10 do\\\n                            {\\\n                                _tv tvAdd [[_i, _j], configName selectRandom _classes];\\\n                            };\\\n                        };\\\n                    };\";\n            moving = 0;\n            type = CT_TREE;\n            style = ST_LEFT;\n            x = GUI_GRID_CENTER_X + 10 * GUI_GRID_CENTER_W;\n            y = GUI_GRID_CENTER_Y + 3 * GUI_GRID_CENTER_H;\n            w = 20 * GUI_GRID_CENTER_W;\n            h = 23 * GUI_GRID_CENTER_H;\n            sizeEx = GUI_TEXT_SIZE_MEDIUM;\n            font = \"RobotoCondensed\";\n            colorText[] = {1,1,1,1};\n            colorBackground[] = {0,0,0,0.8};\n            colorDisabled[] = {1,1,1,0.25};\n            shadow = 0;\n            access = 0;\n\n            /* CT_TREE specific properties */\n            idcSearch = 100;\n            colorSelect[] = {1,1,1,0.7};\n            colorSelectText[] = {0,0,0,1};\n            colorBorder[] = {0,0,0,0};\n            colorSearch[] =\n            {\n                \"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])\",\n                \"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])\",\n                \"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])\",\n                \"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])\"\n            };\n            colorMarked[] = {0.2,0.3,0.7,1};\n            colorMarkedText[] = {0,0,0,1};\n            colorMarkedSelected[] = {0,0.5,0.5,1};\n            multiselectEnabled = 0;\n            colorPicture[] = {1,1,1,1};\n            colorPictureSelected[] = {0,0,0,1};\n            colorPictureDisabled[] = {1,1,1,0.25};\n            colorPictureRight[] = {1,1,1,1};\n            colorPictureRightSelected[] = {0,0,0,1};\n            colorPictureRightDisabled[] = {1,1,1,0.25};\n            colorArrow[] = {1,1,1,1};\n            maxHistoryDelay = 1;\n            colorSelectBackground[] = {0,0,0,0.5};\n            colorLines[] = {0,0,0,0};\n            class ScrollBar : ScrollBar\n            {\n            };\n            expandedTexture = \"A3\\ui_f\\data\\gui\\rsccommon\\rsctree\\expandedTexture_ca.paa\";\n            hiddenTexture = \"A3\\ui_f\\data\\gui\\rsccommon\\rsctree\\hiddenTexture_ca.paa\";\n            rowHeight = 0.0439091;\n            borderSize = 0;\n            expandOnDoubleclick = 1;\n\n            /* CT_TREE user interface eventhandlers */\n            onTreeSelChanged = \"systemChat str ['onTreeSelChanged',_this]; false\";\n            onTreeLButtonDown = \"systemChat str ['onTreeLButtonDown',_this]; false\";\n            onTreeDblClick = \"systemChat str ['onTreeDblClick',_this]; false\";\n            onTreeExpanded = \"systemChat str ['onTreeExpanded',_this]; false\";\n            onTreeCollapsed = \"systemChat str ['onTreeCollapsed',_this]; false\";\n            onTreeMouseMove = \"systemChat str ['onTreeMouseMove',_this]; false\";\n            onTreeMouseHold = \"systemChat str ['onTreeMouseHold',_this]; false\";\n            onTreeMouseExit = \"systemChat str ['onTreeMouseExit',_this]; false\";\n        };\n    };\n};\n```\n\n### Scripting Example\n\n|  |  |\n|---|---|\n| ```sqf<br>private [\"_count\", \"_current\", \"_data\", \"_text\", \"_value\", \"_pic\"];<br>_CT_TREE tvAdd [[], \"Parent_A\"];<br>_CT_TREE tvAdd [[0], \"Child_A\"];<br>_CT_TREE tvAdd [[0,0], \"Grandchild_A\"];<br>_CT_TREE tvAdd [[], \"Parent_B\"];<br>_CT_TREE tvAdd [[1], \"Child_B\"];<br>``` |  |\n| ```sqf<br>_count = _CT_TREE tvCount []; // return 2<br>_CT_TREE tvSetCurSel [0,0,0]; // select grandchild_A<br>``` |  |\n| ```sqf<br>_current = tvCurSel _CT_TREE; // return [0,0,0]<br>_CT_TREE tvSetData [_current, \"I'm grandchild_A\"];<br>_data = _CT_TREE tvData _current; // \"I'm grandchild_A\"<br>_text = _CT_TREE tvText _current; // \"Grandchild_A\"<br>_CT_TREE tvSetValue [_current,14];<br>_value = _CT_TREE tvValue _current; // 14<br>_CT_TREE tvSetPicture [_current, getText (configFile >> \"CfgWeapons\" >> \"optic_NVS\" >> \"picture\")];<br>_pic = _CT_TREE tvPicture _current;<br>``` |  |\n| `_CT_TREE tvExpand [1];` |  |\n| ```sqf<br>_CT_TREE tvSort [[], false];<br>_CT_TREE tvSortByValue [[], false];<br>``` |  |\n| ```sqf<br>_CT_TREE tvDelete [0,0]; // remove child_b<br>tvClear 12;<br>_CT_TREE tvCollapse [];<br>``` |  |","sections":[{"heading":"Introduction","level":3,"markdown":"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.\nSince Arma 3 v2.01: Multiple selections are now also supported via commands.\n\n> [!IMPORTANT]\n> The engine driven search is very slow. Searching a tree view with many entries can freeze the game."},{"heading":"Related commands & functions","level":4,"markdown":"- Commands: General\n- Commands: UI Eventhandlers\n- Commands: Tree View"},{"heading":"Related User Interface Eventhandlers","level":4,"markdown":"- Events: General\n- Events: Tree View"},{"heading":"Alphabetical Order","level":3,"markdown":"> [!NOTE]\n> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found **here**.\n\n> [!WARNING]\n> Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [this](https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf) config crawler.\n\n```cpp\n#define CT_TREE 12\n```"},{"heading":"B","level":4,"markdown":""},{"heading":"borderSize","level":5,"markdown":"**Type:** Number\n\n**Description:** Shows a border around the control. Setting the size to 0 will not hide the border. Set the `colorBorder` to transparent instead.\n\n```cpp\nborderSize = 0;\n```"},{"heading":"C","level":4,"markdown":""},{"heading":"colorArrow","level":5,"markdown":"> [!IMPORTANT]\n> This attribute is mandatory for the control to work!\n\n**Type:** Array\n\n**Description:** Has no effect but without it an error is thrown.\n\n```cpp\ncolorArrow[] = {1,1,1,1};\n```"},{"heading":"colorBorder","level":5,"markdown":"**Type:** Array\n\n**Description:** With `borderSize = 1` determines the color of that border.\n\n```cpp\ncolorBorder[] = {0,0,0,0};\n```"},{"heading":"colorLines","level":5,"markdown":"**Type:** Array\n\n**Description:** These lines connect the different entries for better clarity.\n\n```cpp\ncolorLines[] = {0,0,0,0};\n```"},{"heading":"colorMarked","level":5,"markdown":"**Type:** Array\n\n**Description:** Background color of all subsequently selected entries when `multiselectEnabled = 1;`.\n\n```cpp\ncolorMarked[] = {0.2,0.3,0.7,1};\n```"},{"heading":"colorMarkedSelected","level":5,"markdown":"**Type:** Array\n\n**Description:** Background color of the first selected entry with `multiselectEnabled = 1;`.\n\n```cpp\ncolorMarkedSelected[] = {0,0.5,0.5,1};\n```"},{"heading":"colorMarkedText","level":5,"markdown":"**Type:** Array\n\n**Description:** Text color of secondarly selected entries with `multiselectEnabled = 1;`.\n\n```cpp\ncolorMarkedText[] = {0,0,0,1};\n```"},{"heading":"colorPicture","level":5,"markdown":"**Type:** Array\n\n**Description:** Left picture color of an unselected entry.\n\n```cpp\ncolorPicture[] = {1,1,1,1};\n```"},{"heading":"colorPictureDisabled","level":5,"markdown":"**Type:** Array\n\n**Description:** Left picture color when control is disabled.\n\n```cpp\ncolorPictureDisabled[] = {1,1,1,0.25};\n```"},{"heading":"colorPictureRight","level":5,"markdown":"**Type:** Array\n\n**Description:** Right picture color of an unselected entry.\n\n```cpp\ncolorPictureRight[] = {1,1,1,1};\n```"},{"heading":"colorPictureRightDisabled","level":5,"markdown":"**Type:** Array\n\n**Description:** Right picture color when control is disabled.\n\n```cpp\ncolorPictureRightDisabled[] = {1,1,1,0.25};\n```"},{"heading":"colorPictureRightSelected","level":5,"markdown":"**Type:** Array\n\n**Description:** Right picture color of an selected entry.\n\n```cpp\ncolorPictureRightSelected[] = {0,0,0,1};\n```"},{"heading":"colorPictureSelected","level":5,"markdown":"**Type:** Array\n\n**Description:** Left picture color of an selected entry.\n\n```cpp\ncolorPictureSelected[] = {1,1,1,1};\n```"},{"heading":"colorSearch","level":5,"markdown":"**Type:** Array\n\n**Description:** Color of the entries that fit the search of the idcSearch listbox.\n\n```cpp\ncolorSearch[] = {\"(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};\n```"},{"heading":"colorSelect","level":5,"markdown":"**Type:** Array\n\n**Description:** Entry's background when `multiselectEnabled = 0;`.\n\n```cpp\ncolorSelect[] = {\"(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};\n```"},{"heading":"colorSelectBackground","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelectBackground[] = {0,0,0,0.5};\n```"},{"heading":"colorSelectText","level":5,"markdown":"**Type:** Array\n\n**Description:** Text color of a selected entry with `multiselectEnabled = 0;`.\n\n```cpp\ncolorSelectText[] = {0,0,0,1};\n```"},{"heading":"D","level":4,"markdown":""},{"heading":"defaultItem","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ndefaultItem[] = {\"BLU_F\",\"Infantry\"};\n```"},{"heading":"disableKeyboardSearch","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\ndisableKeyboardSearch = 1;\n```"},{"heading":"disableSearchHighlight","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\ndisableSearchHighlight = 1;\n```"},{"heading":"E","level":4,"markdown":""},{"heading":"expandedTexture","level":5,"markdown":"**Type:** String\n\n**Description:** \"Arrow\" texture on the left side, if non is given (\"\") a minus with box will be displayed.\n\n```cpp\nexpandedTexture = \"A3\\ui_f\\data\\gui\\rsccommon\\rsctree\\expandedTexture_ca.paa\";\n```"},{"heading":"expandOnDoubleclick","level":5,"markdown":"**Type:** Number\n\n**Description:** Enable/disable expanding and collapsing with double-click.\n\n```cpp\nexpandOnDoubleclick = 1;\n```"},{"heading":"H","level":4,"markdown":""},{"heading":"hiddenTexture","level":5,"markdown":"**Type:** String\n\n**Description:** \"Arrow\" texture on the left side, if non is given (\"\") a plus with box will be displayed.\n\n```cpp\nhiddenTexture = \"A3\\ui_f\\data\\gui\\rsccommon\\rsctree\\hiddenTexture_ca.paa\";\n```"},{"heading":"I","level":4,"markdown":""},{"heading":"iconFolder","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\niconFolder = \"\\a3\\3DEN\\Data\\Cfg3DEN\\Layer\\icon_ca.paa\";\n```"},{"heading":"iconFolderDefault","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\niconFolderDefault = \"\\a3\\3DEN\\Data\\Cfg3DEN\\Layer\\iconDefault_ca.paa\";\n```"},{"heading":"idcSearch","level":5,"markdown":"**Type:** Number\n\n**Description:** IDC of a CT_EDIT control which functions as the search input.\n\n```cpp\nidcSearch = 283;\n```"},{"heading":"M","level":4,"markdown":""},{"heading":"maxHistoryDelay","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nmaxHistoryDelay = 1;\n```"},{"heading":"multiselectEnabled","level":5,"markdown":"**Type:** Number\n\n**Description:** Enable/disable multi selection with CTRL or SHIFT to select all entries up to the first selected entry.\n\n> [!NOTE]\n> Commands to retrieve all selected entries in a multi selection tv are only available after Arma 3 v2.01.\n\n```cpp\nmultiselectEnabled = 1;\n```"},{"heading":"Default Classes","level":3,"markdown":"> [!NOTE]\n> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`\n>\n> ---\n>\n> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the import keyword).\n>\n> In older versions, use `\"Default\" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the description.ext."},{"heading":"RscExample","level":4,"markdown":"```cpp\nclass RscTree\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_TREE;\n    colorBackground[] = {0,0,0,0};\n    colorSelect[] = {1,1,1,0.7};\n    colorDisabled[] = {1,1,1,0.25};\n    colorText[] = {1,1,1,1};\n    colorSelectText[] = {0,0,0,1};\n    colorBorder[] = {0,0,0,0};\n    colorSearch[] =\n    {\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])\"\n    };\n    colorMarked[] = {0.2,0.3,0.7,1};\n    colorMarkedText[] = {0,0,0,1};\n    colorMarkedSelected[] = {0,0.5,0.5,1};\n    multiselectEnabled = 0;\n    colorPicture[] = {1,1,1,1};\n    colorPictureSelected[] = {0,0,0,1};\n    colorPictureDisabled[] = {1,1,1,0.25};\n    colorPictureRight[] = {1,1,1,1};\n    colorPictureRightSelected[] = {0,0,0,1};\n    colorPictureRightDisabled[] = {1,1,1,0.25};\n    colorArrow[] = {1,1,1,1};\n    maxHistoryDelay = 1;\n    shadow = 0;\n    style = ST_LEFT;\n    font = \"RobotoCondensed\";\n    sizeEx = GUI_TEXT_SIZE_MEDIUM;\n    expandedTexture = \"A3\\ui_f\\data\\gui\\rsccommon\\rsctree\\expandedTexture_ca.paa\";\n    hiddenTexture = \"A3\\ui_f\\data\\gui\\rsccommon\\rsctree\\hiddenTexture_ca.paa\";\n    x = 0;\n    y = 0;\n    w = 0.1;\n    h = 0.2;\n    rowHeight = 0.0439091;\n    colorSelectBackground[] = {0,0,0,0.5};\n    colorLines[] = {0,0,0,0};\n    borderSize = 0;\n    expandOnDoubleclick = 1;\n    class ScrollBar : ScrollBar\n    {\n    };\n};\n```"},{"heading":"Other examples","level":3,"markdown":""},{"heading":"RscTree with search functionality","level":4,"markdown":"```cpp\nclass Dialog\n{\n    idd = -1;\n    class Controls\n    {\n        class _CT_EDIT\n        {\n            idc = 100;\n            type = 2;\n            style = \"512\";\n            x = GUI_GRID_CENTER_X + 10 * GUI_GRID_CENTER_W;\n            y = GUI_GRID_CENTER_Y + 0 * GUI_GRID_CENTER_H;\n            w = 20 * GUI_GRID_CENTER_W;\n            h = 2 * GUI_GRID_CENTER_H;\n            font = \"PuristaMedium\";\n            sizeEx = 0.04;\n            autocomplete = \"\";\n            canModify = true;\n            maxChars = 100;\n            forceDrawCaret = false;\n            colorSelection[] = {0,1,0,1};\n            colorText[] = {1,1,1,1};\n            colorDisabled[] = {1,0,0,1};\n            colorBackground[] = {0,0,0,0.8};\n            text = \"\";\n            tooltip = \"Type to search\";\n        };\n        class _CT_TREE\n        {\n            /* Common properties */\n            idc = 200;\n            /* Add some entries */\n            onLoad = \"params ['_tv'];\\\n                    _classes = 'true' configClasses (configFile >> 'CfgVehicles');\\\n                    for '_i' from 0 to 10 do\\\n                    {\\\n                        _tv tvAdd [[], configName selectRandom _classes];\\\n                        for '_j' from 0 to 10 do\\\n                        {\\\n                            _tv tvAdd [[_i], configName selectRandom _classes];\\\n                            for '_k' from 0 to 10 do\\\n                            {\\\n                                _tv tvAdd [[_i, _j], configName selectRandom _classes];\\\n                            };\\\n                        };\\\n                    };\";\n            moving = 0;\n            type = CT_TREE;\n            style = ST_LEFT;\n            x = GUI_GRID_CENTER_X + 10 * GUI_GRID_CENTER_W;\n            y = GUI_GRID_CENTER_Y + 3 * GUI_GRID_CENTER_H;\n            w = 20 * GUI_GRID_CENTER_W;\n            h = 23 * GUI_GRID_CENTER_H;\n            sizeEx = GUI_TEXT_SIZE_MEDIUM;\n            font = \"RobotoCondensed\";\n            colorText[] = {1,1,1,1};\n            colorBackground[] = {0,0,0,0.8};\n            colorDisabled[] = {1,1,1,0.25};\n            shadow = 0;\n            access = 0;\n\n            /* CT_TREE specific properties */\n            idcSearch = 100;\n            colorSelect[] = {1,1,1,0.7};\n            colorSelectText[] = {0,0,0,1};\n            colorBorder[] = {0,0,0,0};\n            colorSearch[] =\n            {\n                \"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])\",\n                \"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])\",\n                \"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])\",\n                \"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])\"\n            };\n            colorMarked[] = {0.2,0.3,0.7,1};\n            colorMarkedText[] = {0,0,0,1};\n            colorMarkedSelected[] = {0,0.5,0.5,1};\n            multiselectEnabled = 0;\n            colorPicture[] = {1,1,1,1};\n            colorPictureSelected[] = {0,0,0,1};\n            colorPictureDisabled[] = {1,1,1,0.25};\n            colorPictureRight[] = {1,1,1,1};\n            colorPictureRightSelected[] = {0,0,0,1};\n            colorPictureRightDisabled[] = {1,1,1,0.25};\n            colorArrow[] = {1,1,1,1};\n            maxHistoryDelay = 1;\n            colorSelectBackground[] = {0,0,0,0.5};\n            colorLines[] = {0,0,0,0};\n            class ScrollBar : ScrollBar\n            {\n            };\n            expandedTexture = \"A3\\ui_f\\data\\gui\\rsccommon\\rsctree\\expandedTexture_ca.paa\";\n            hiddenTexture = \"A3\\ui_f\\data\\gui\\rsccommon\\rsctree\\hiddenTexture_ca.paa\";\n            rowHeight = 0.0439091;\n            borderSize = 0;\n            expandOnDoubleclick = 1;\n\n            /* CT_TREE user interface eventhandlers */\n            onTreeSelChanged = \"systemChat str ['onTreeSelChanged',_this]; false\";\n            onTreeLButtonDown = \"systemChat str ['onTreeLButtonDown',_this]; false\";\n            onTreeDblClick = \"systemChat str ['onTreeDblClick',_this]; false\";\n            onTreeExpanded = \"systemChat str ['onTreeExpanded',_this]; false\";\n            onTreeCollapsed = \"systemChat str ['onTreeCollapsed',_this]; false\";\n            onTreeMouseMove = \"systemChat str ['onTreeMouseMove',_this]; false\";\n            onTreeMouseHold = \"systemChat str ['onTreeMouseHold',_this]; false\";\n            onTreeMouseExit = \"systemChat str ['onTreeMouseExit',_this]; false\";\n        };\n    };\n};\n```"},{"heading":"Scripting Example","level":3,"markdown":"|  |  |\n|---|---|\n| ```sqf<br>private [\"_count\", \"_current\", \"_data\", \"_text\", \"_value\", \"_pic\"];<br>_CT_TREE tvAdd [[], \"Parent_A\"];<br>_CT_TREE tvAdd [[0], \"Child_A\"];<br>_CT_TREE tvAdd [[0,0], \"Grandchild_A\"];<br>_CT_TREE tvAdd [[], \"Parent_B\"];<br>_CT_TREE tvAdd [[1], \"Child_B\"];<br>``` |  |\n| ```sqf<br>_count = _CT_TREE tvCount []; // return 2<br>_CT_TREE tvSetCurSel [0,0,0]; // select grandchild_A<br>``` |  |\n| ```sqf<br>_current = tvCurSel _CT_TREE; // return [0,0,0]<br>_CT_TREE tvSetData [_current, \"I'm grandchild_A\"];<br>_data = _CT_TREE tvData _current; // \"I'm grandchild_A\"<br>_text = _CT_TREE tvText _current; // \"Grandchild_A\"<br>_CT_TREE tvSetValue [_current,14];<br>_value = _CT_TREE tvValue _current; // 14<br>_CT_TREE tvSetPicture [_current, getText (configFile >> \"CfgWeapons\" >> \"optic_NVS\" >> \"picture\")];<br>_pic = _CT_TREE tvPicture _current;<br>``` |  |\n| `_CT_TREE tvExpand [1];` |  |\n| ```sqf<br>_CT_TREE tvSort [[], false];<br>_CT_TREE tvSortByValue [[], false];<br>``` |  |\n| ```sqf<br>_CT_TREE tvDelete [0,0]; // remove child_b<br>tvClear 12;<br>_CT_TREE tvCollapse [];<br>``` |  |"}],"categories":["Control Types"],"groups":["GUI"]}