{"name":"CT TOOLBOX","title":"CT TOOLBOX","type":"topic","url":"https://community.bistudio.com/wiki/CT_TOOLBOX","revid":268260,"updated":"2021-06-12T11:04:18Z","aliases":["DialogControls-Toolbox"],"markdown":"### Introduction\n\nA 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.\n\n#### Related commands & functions\n\n- Commands: General\n- Commands: UI Eventhandlers\n- Commands: Listbox\n\n#### Related User Interface Eventhandlers\n\n- Events: General\n- Events: Listbox\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_TOOLBOX 6\n```\n\n#### C\n\n##### checked_strings\n\n**Type:** Array\n\n**Description:** Options texts to display when an option is selected.\n\n```cpp\nchecked_strings[] = {\"[Entry 1]\",\"[Entry 2]\",\"[Entry 3]\",\"[Entry 4]\",\"[Entry 5]\",\"[Entry 6]\"};\n```\n\n##### color\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolor[] = {0.95,0.95,0.95,1};\n```\n\n##### colorBackground\n\n**Type:** Array\n\n**Description:** Color of the background when option is not selected.\n\n```cpp\ncolorBackground[] = {0.95,0.95,0.95,1};\n```\n\n##### colorDisable\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorDisable[] = {0,0,0,0};\n```\n\n##### colorSelect\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelect[] = {0.95,0.95,0.95,1};\n```\n\n##### colorSelectedBg\n\n**Type:** Array\n\n**Description:** Color of the background when option is selected.\n\n```cpp\ncolorSelectedBg[] = {\"(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};\n```\n\n##### colorTextDisable\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorTextDisable[] = {0.4,0.4,0.4,1};\n```\n\n##### colorTextSelect\n\n**Type:** Array\n\n**Description:** Color of the selected option text.\n\n```cpp\ncolorTextSelect[] = {1,1,1,1};\n```\n\n##### columns\n\n**Type:** Number, String\n\n**Description:** Amount of columns to arrange options into.\n\nNumber example:\n\n```cpp\ncolumns = 3;\n```\n\nString example:\n\n```cpp\ncolumns = \"4 - 1\";\n```\n\n#### N\n\n##### names\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nnames[] = {\"MOVE\",\"GETOUT\",\"UNLOAD\",\"TR UNLOAD\",\"%1/cfgWaypoints/A3/Land\",\"%1/cfgWaypoints/A3/Artillery\",\"UNHOOK\"};\n```\n\n#### R\n\n##### rows\n\n**Type:** Number\n\n**Description:** Amount of rows to arrange options into.\n\n```cpp\nrows = 2;\n```\n\n#### S\n\n##### strings\n\n**Type:** Array\n\n**Description:** Options texts to display.\n\n```cpp\nstrings[] = {\"100m\",\"200m\",\"500m\"};\n```\n\n#### T\n\n##### tooltips\n\n**Type:** Array\n\n**Description:** Tooltips for each option.\n\n```cpp\ntooltips[] = {\"Objects\",\"Compositions\",\"Triggers\",\"Systems\",\"Markers\"};\n```\n\n#### V\n\n##### values\n\n**Type:** Array\n\n**Description:** Numerical values associated with items. Can be retrieved or set with lbValue and lbSetValue.\n\n```cpp\nvalues[] = {0,1,2,3,4,5,6};\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 RscToolbox\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_TOOLBOX;\n    style = ST_CENTER;\n    colorText[] = {0.95,0.95,0.95,1};\n    color[] = {0.95,0.95,0.95,1};\n    colorTextSelect[] = {0.95,0.95,0.95,1};\n    colorSelect[] = {0.95,0.95,0.95,1};\n    colorTextDisable[] = {0.4,0.4,0.4,1};\n    colorDisable[] = {0.4,0.4,0.4,1};\n    colorSelectedBg[] =\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        0.5\n    };\n    shadow = 0;\n    strings[] =\n    {\n        \"\",\n        \"\"\n    };\n    x = 0;\n    y = 0;\n    w = 0.3;\n    h = 0.025;\n    rows = 1;\n    columns = 2;\n    font = \"RobotoCondensed\";\n    sizeEx = GUI_TEXT_SIZE_SMALL;\n};\n```","sections":[{"heading":"Introduction","level":3,"markdown":"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."},{"heading":"Related commands & functions","level":4,"markdown":"- Commands: General\n- Commands: UI Eventhandlers\n- Commands: Listbox"},{"heading":"Related User Interface Eventhandlers","level":4,"markdown":"- Events: General\n- Events: Listbox"},{"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_TOOLBOX 6\n```"},{"heading":"C","level":4,"markdown":""},{"heading":"checked_strings","level":5,"markdown":"**Type:** Array\n\n**Description:** Options texts to display when an option is selected.\n\n```cpp\nchecked_strings[] = {\"[Entry 1]\",\"[Entry 2]\",\"[Entry 3]\",\"[Entry 4]\",\"[Entry 5]\",\"[Entry 6]\"};\n```"},{"heading":"color","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolor[] = {0.95,0.95,0.95,1};\n```"},{"heading":"colorBackground","level":5,"markdown":"**Type:** Array\n\n**Description:** Color of the background when option is not selected.\n\n```cpp\ncolorBackground[] = {0.95,0.95,0.95,1};\n```"},{"heading":"colorDisable","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorDisable[] = {0,0,0,0};\n```"},{"heading":"colorSelect","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelect[] = {0.95,0.95,0.95,1};\n```"},{"heading":"colorSelectedBg","level":5,"markdown":"**Type:** Array\n\n**Description:** Color of the background when option is selected.\n\n```cpp\ncolorSelectedBg[] = {\"(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};\n```"},{"heading":"colorTextDisable","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorTextDisable[] = {0.4,0.4,0.4,1};\n```"},{"heading":"colorTextSelect","level":5,"markdown":"**Type:** Array\n\n**Description:** Color of the selected option text.\n\n```cpp\ncolorTextSelect[] = {1,1,1,1};\n```"},{"heading":"columns","level":5,"markdown":"**Type:** Number, String\n\n**Description:** Amount of columns to arrange options into.\n\nNumber example:\n\n```cpp\ncolumns = 3;\n```\n\nString example:\n\n```cpp\ncolumns = \"4 - 1\";\n```"},{"heading":"N","level":4,"markdown":""},{"heading":"names","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nnames[] = {\"MOVE\",\"GETOUT\",\"UNLOAD\",\"TR UNLOAD\",\"%1/cfgWaypoints/A3/Land\",\"%1/cfgWaypoints/A3/Artillery\",\"UNHOOK\"};\n```"},{"heading":"R","level":4,"markdown":""},{"heading":"rows","level":5,"markdown":"**Type:** Number\n\n**Description:** Amount of rows to arrange options into.\n\n```cpp\nrows = 2;\n```"},{"heading":"S","level":4,"markdown":""},{"heading":"strings","level":5,"markdown":"**Type:** Array\n\n**Description:** Options texts to display.\n\n```cpp\nstrings[] = {\"100m\",\"200m\",\"500m\"};\n```"},{"heading":"T","level":4,"markdown":""},{"heading":"tooltips","level":5,"markdown":"**Type:** Array\n\n**Description:** Tooltips for each option.\n\n```cpp\ntooltips[] = {\"Objects\",\"Compositions\",\"Triggers\",\"Systems\",\"Markers\"};\n```"},{"heading":"V","level":4,"markdown":""},{"heading":"values","level":5,"markdown":"**Type:** Array\n\n**Description:** Numerical values associated with items. Can be retrieved or set with lbValue and lbSetValue.\n\n```cpp\nvalues[] = {0,1,2,3,4,5,6};\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 RscToolbox\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_TOOLBOX;\n    style = ST_CENTER;\n    colorText[] = {0.95,0.95,0.95,1};\n    color[] = {0.95,0.95,0.95,1};\n    colorTextSelect[] = {0.95,0.95,0.95,1};\n    colorSelect[] = {0.95,0.95,0.95,1};\n    colorTextDisable[] = {0.4,0.4,0.4,1};\n    colorDisable[] = {0.4,0.4,0.4,1};\n    colorSelectedBg[] =\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        0.5\n    };\n    shadow = 0;\n    strings[] =\n    {\n        \"\",\n        \"\"\n    };\n    x = 0;\n    y = 0;\n    w = 0.3;\n    h = 0.025;\n    rows = 1;\n    columns = 2;\n    font = \"RobotoCondensed\";\n    sizeEx = GUI_TEXT_SIZE_SMALL;\n};\n```"}],"categories":["Control Types"],"groups":["GUI"]}