{"name":"CT XLISTBOX","title":"CT XLISTBOX","type":"topic","url":"https://community.bistudio.com/wiki/CT_XLISTBOX","revid":258316,"updated":"2021-05-25T08:59:30Z","aliases":[],"markdown":"### Introduction\n\nSideways listbox with only one entry visible at a time. More similar to CT_COMBO. This control should probably not be used at all because of its poor usability. The user has to click through all entries to find the correct one. Use CT_TOOLBOX, CT_COMBO or CT_LISTBOX instead.\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_XLISTBOX 42\n```\n\n#### A\n\n##### arrowEmpty\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\narrowEmpty = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\arrowEmpty_ca.paa\";\n```\n\n##### arrowFull\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\narrowFull = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\arrowFull_ca.paa\";\n```\n\n#### B\n\n##### border\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nborder = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\border_ca.paa\";\n```\n\n#### C\n\n##### color\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolor[] = {1,1,1,0.6};\n```\n\n##### colorActive\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorActive[] = {1,1,1,1};\n```\n\n##### colorPicture\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPicture[] = {1,1,1,1};\n```\n\n##### colorPictureDisabled\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPictureDisabled[] = {1,1,1,0.25};\n```\n\n##### colorPictureRight\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPictureRight[] = {1,1,1,1};\n```\n\n##### colorPictureRightDisabled\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPictureRightDisabled[] = {1,1,1,0.25};\n```\n\n##### colorPictureRightSelected\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPictureRightSelected[] = {1,1,1,1};\n```\n\n##### colorPictureSelected\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPictureSelected[] = {1,1,1,1};\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##### cycle\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\ncycle = 1;\n```\n\n#### I\n\n##### Items\n\n**Type:** Class\n\n**Description:** List of default items. Supports most Listbox commands as a config entry.\n\n```cpp\nclass Items\n{\n    class Item0\n    {\n        text = \"LOL\";\n        picture = \"\\a3\\Ui_f\\data\\Map\\Markers\\Military\\warning_CA.paa\";\n        color[] = {1,0,1,1};\n        colorPicture[] = {0,1,1,1};\n        data = \"WTF\";\n        value = 42;\n        default = 0;\n    };\n    class AnotherItem\n    {\n        text = \"O RLY\";\n        default = 1;\n    };\n};\n```\n\n#### S\n\n##### soundSelect\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundSelect[] = {\"\\A3\\ui_f\\data\\sound\\RscListbox\\soundSelect\",0.09,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#### RscXListBox\n\n```cpp\nclass RscXListBox\n{\n    deletable = 0;\n    fade = 0;\n    idc = -1;\n    type = CT_XLISTBOX;\n    x = 0.1;\n    y = 0.1;\n    color[] = {1,1,1,0.6};\n    colorActive[] = {1,1,1,1};\n    colorDisabled[] = {1,1,1,0.25};\n    colorSelect[] = {0.95,0.95,0.95,1};\n    colorText[] = {1,1,1,1};\n    soundSelect[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscListbox\\soundSelect\",\n        0.09,\n        1\n    };\n    colorPicture[] = {1,1,1,1};\n    colorPictureSelected[] = {1,1,1,1};\n    colorPictureDisabled[] = {1,1,1,0.25};\n    colorPictureRight[] = {1,1,1,1};\n    colorPictureRightSelected[] = {1,1,1,1};\n    colorPictureRightDisabled[] = {1,1,1,0.25};\n    tooltipColorText[] = {1,1,1,1};\n    tooltipColorBox[] = {1,1,1,1};\n    tooltipColorShade[] = {0,0,0,0.65};\n    style = ST_CENTER + LB_TEXTURES + SL_HORZ;\n    shadow = 2;\n    arrowEmpty = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\arrowEmpty_ca.paa\";\n    arrowFull = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\arrowFull_ca.paa\";\n    border = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\border_ca.paa\";\n    w = 0.14706;\n    h = 0.039216;\n    font = \"RobotoCondensed\";\n    sizeEx = GUI_TEXT_SIZE_MEDIUM;\n};\n```\n\n### Other examples\n\n```cpp\nclass _CT_XLISTBOX\n{\n  access = 0; // Control access (0 - ReadAndWrite, 1 - ReadAndCreate, 2 - ReadOnly, 3 - ReadOnlyVerified)\n  idc = CT_XLISTBOX; // Control identification (without it, the control won't be displayed)\n  type = CT_XLISTBOX; // Type is 42\n  style = SL_HORZ + ST_CENTER + LB_TEXTURES; // Style\n  default = 0; // Control selected by default (only one within a display can be used)\n  blinkingPeriod = 0; // Time in which control will fade out and back in. Use 0 to disable the effect.\n\n  x = 12 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X; // Horizontal coordinates\n  y = 17 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y; // Vertical coordinates\n  w = 10 * GUI_GRID_CENTER_W; // Width\n  h = 1 * GUI_GRID_CENTER_H; // Height\n\n  color[] = {1,1,1,1}; // Arrow color\n  colorActive[] = {1,0.5,0,1}; // Selected arrow color\n\n  sizeEx = GUI_GRID_CENTER_H; // Text size\n  font = GUI_FONT_NORMAL; // Font from CfgFontFamilies\n  shadow = 0; // Shadow (0 - none, 1 - N/A, 2 - black outline)\n  colorText[] = {1,1,1,1}; // Text color\n  colorSelect[] = {1,0.5,0,1}; // Selected text color\n  colorDisabled[] = {1,1,1,0.5}; // Disabled text color\n\n  tooltip = \"CT_XLISTBOX\"; // Tooltip text\n  tooltipColorShade[] = {0,0,0,1}; // Tooltip background color\n  tooltipColorText[] = {1,1,1,1}; // Tooltip text color\n  tooltipColorBox[] = {1,1,1,1}; // Tooltip frame color\n\n  arrowEmpty = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\arrowEmpty_ca.paa\"; // Arrow\n  arrowFull = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\arrowFull_ca.paa\"; // Arrow when clicked on\n  border = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\border_ca.paa\"; // Fill texture\n\n  soundSelect[] = {\"\\A3\\ui_f\\data\\sound\\RscListbox\\soundSelect\",0.09,1}; // Sound played when an item is selected\n\n  onCanDestroy = \"systemChat str ['onCanDestroy',_this]; true\";\n  onDestroy = \"systemChat str ['onDestroy',_this]; false\";\n  onSetFocus = \"systemChat str ['onSetFocus',_this]; false\";\n  onKillFocus = \"systemChat str ['onKillFocus',_this]; false\";\n  onKeyDown = \"systemChat str ['onKeyDown',_this]; false\";\n  onKeyUp = \"systemChat str ['onKeyUp',_this]; false\";\n  onMouseButtonDown = \"systemChat str ['onMouseButtonDown',_this]; false\";\n  onMouseButtonUp = \"systemChat str ['onMouseButtonUp',_this]; false\";\n  onMouseButtonClick = \"systemChat str ['onMouseButtonClick',_this]; false\";\n  onMouseButtonDblClick = \"systemChat str ['onMouseButtonDblClick',_this]; false\";\n  onMouseZChanged = \"systemChat str ['onMouseZChanged',_this]; false\";\n  onMouseMoving = \"\";\n  onMouseHolding = \"\";\n\n  onLBSelChanged = \"systemChat str ['onLBSelChanged',_this]; false\";\n  onLBDblClick = \"systemChat str ['onLBDblClick',_this]; false\";\n};\n```","sections":[{"heading":"Introduction","level":3,"markdown":"Sideways listbox with only one entry visible at a time. More similar to CT_COMBO. This control should probably not be used at all because of its poor usability. The user has to click through all entries to find the correct one. Use CT_TOOLBOX, CT_COMBO or CT_LISTBOX instead."},{"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_XLISTBOX 42\n```"},{"heading":"A","level":4,"markdown":""},{"heading":"arrowEmpty","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\narrowEmpty = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\arrowEmpty_ca.paa\";\n```"},{"heading":"arrowFull","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\narrowFull = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\arrowFull_ca.paa\";\n```"},{"heading":"B","level":4,"markdown":""},{"heading":"border","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nborder = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\border_ca.paa\";\n```"},{"heading":"C","level":4,"markdown":""},{"heading":"color","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolor[] = {1,1,1,0.6};\n```"},{"heading":"colorActive","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorActive[] = {1,1,1,1};\n```"},{"heading":"colorPicture","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPicture[] = {1,1,1,1};\n```"},{"heading":"colorPictureDisabled","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPictureDisabled[] = {1,1,1,0.25};\n```"},{"heading":"colorPictureRight","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPictureRight[] = {1,1,1,1};\n```"},{"heading":"colorPictureRightDisabled","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPictureRightDisabled[] = {1,1,1,0.25};\n```"},{"heading":"colorPictureRightSelected","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPictureRightSelected[] = {1,1,1,1};\n```"},{"heading":"colorPictureSelected","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPictureSelected[] = {1,1,1,1};\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":"cycle","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\ncycle = 1;\n```"},{"heading":"I","level":4,"markdown":""},{"heading":"Items","level":5,"markdown":"**Type:** Class\n\n**Description:** List of default items. Supports most Listbox commands as a config entry.\n\n```cpp\nclass Items\n{\n    class Item0\n    {\n        text = \"LOL\";\n        picture = \"\\a3\\Ui_f\\data\\Map\\Markers\\Military\\warning_CA.paa\";\n        color[] = {1,0,1,1};\n        colorPicture[] = {0,1,1,1};\n        data = \"WTF\";\n        value = 42;\n        default = 0;\n    };\n    class AnotherItem\n    {\n        text = \"O RLY\";\n        default = 1;\n    };\n};\n```"},{"heading":"S","level":4,"markdown":""},{"heading":"soundSelect","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundSelect[] = {\"\\A3\\ui_f\\data\\sound\\RscListbox\\soundSelect\",0.09,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":"RscXListBox","level":4,"markdown":"```cpp\nclass RscXListBox\n{\n    deletable = 0;\n    fade = 0;\n    idc = -1;\n    type = CT_XLISTBOX;\n    x = 0.1;\n    y = 0.1;\n    color[] = {1,1,1,0.6};\n    colorActive[] = {1,1,1,1};\n    colorDisabled[] = {1,1,1,0.25};\n    colorSelect[] = {0.95,0.95,0.95,1};\n    colorText[] = {1,1,1,1};\n    soundSelect[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscListbox\\soundSelect\",\n        0.09,\n        1\n    };\n    colorPicture[] = {1,1,1,1};\n    colorPictureSelected[] = {1,1,1,1};\n    colorPictureDisabled[] = {1,1,1,0.25};\n    colorPictureRight[] = {1,1,1,1};\n    colorPictureRightSelected[] = {1,1,1,1};\n    colorPictureRightDisabled[] = {1,1,1,0.25};\n    tooltipColorText[] = {1,1,1,1};\n    tooltipColorBox[] = {1,1,1,1};\n    tooltipColorShade[] = {0,0,0,0.65};\n    style = ST_CENTER + LB_TEXTURES + SL_HORZ;\n    shadow = 2;\n    arrowEmpty = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\arrowEmpty_ca.paa\";\n    arrowFull = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\arrowFull_ca.paa\";\n    border = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\border_ca.paa\";\n    w = 0.14706;\n    h = 0.039216;\n    font = \"RobotoCondensed\";\n    sizeEx = GUI_TEXT_SIZE_MEDIUM;\n};\n```"},{"heading":"Other examples","level":3,"markdown":"```cpp\nclass _CT_XLISTBOX\n{\n  access = 0; // Control access (0 - ReadAndWrite, 1 - ReadAndCreate, 2 - ReadOnly, 3 - ReadOnlyVerified)\n  idc = CT_XLISTBOX; // Control identification (without it, the control won't be displayed)\n  type = CT_XLISTBOX; // Type is 42\n  style = SL_HORZ + ST_CENTER + LB_TEXTURES; // Style\n  default = 0; // Control selected by default (only one within a display can be used)\n  blinkingPeriod = 0; // Time in which control will fade out and back in. Use 0 to disable the effect.\n\n  x = 12 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X; // Horizontal coordinates\n  y = 17 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y; // Vertical coordinates\n  w = 10 * GUI_GRID_CENTER_W; // Width\n  h = 1 * GUI_GRID_CENTER_H; // Height\n\n  color[] = {1,1,1,1}; // Arrow color\n  colorActive[] = {1,0.5,0,1}; // Selected arrow color\n\n  sizeEx = GUI_GRID_CENTER_H; // Text size\n  font = GUI_FONT_NORMAL; // Font from CfgFontFamilies\n  shadow = 0; // Shadow (0 - none, 1 - N/A, 2 - black outline)\n  colorText[] = {1,1,1,1}; // Text color\n  colorSelect[] = {1,0.5,0,1}; // Selected text color\n  colorDisabled[] = {1,1,1,0.5}; // Disabled text color\n\n  tooltip = \"CT_XLISTBOX\"; // Tooltip text\n  tooltipColorShade[] = {0,0,0,1}; // Tooltip background color\n  tooltipColorText[] = {1,1,1,1}; // Tooltip text color\n  tooltipColorBox[] = {1,1,1,1}; // Tooltip frame color\n\n  arrowEmpty = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\arrowEmpty_ca.paa\"; // Arrow\n  arrowFull = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\arrowFull_ca.paa\"; // Arrow when clicked on\n  border = \"\\A3\\ui_f\\data\\gui\\cfg\\slider\\border_ca.paa\"; // Fill texture\n\n  soundSelect[] = {\"\\A3\\ui_f\\data\\sound\\RscListbox\\soundSelect\",0.09,1}; // Sound played when an item is selected\n\n  onCanDestroy = \"systemChat str ['onCanDestroy',_this]; true\";\n  onDestroy = \"systemChat str ['onDestroy',_this]; false\";\n  onSetFocus = \"systemChat str ['onSetFocus',_this]; false\";\n  onKillFocus = \"systemChat str ['onKillFocus',_this]; false\";\n  onKeyDown = \"systemChat str ['onKeyDown',_this]; false\";\n  onKeyUp = \"systemChat str ['onKeyUp',_this]; false\";\n  onMouseButtonDown = \"systemChat str ['onMouseButtonDown',_this]; false\";\n  onMouseButtonUp = \"systemChat str ['onMouseButtonUp',_this]; false\";\n  onMouseButtonClick = \"systemChat str ['onMouseButtonClick',_this]; false\";\n  onMouseButtonDblClick = \"systemChat str ['onMouseButtonDblClick',_this]; false\";\n  onMouseZChanged = \"systemChat str ['onMouseZChanged',_this]; false\";\n  onMouseMoving = \"\";\n  onMouseHolding = \"\";\n\n  onLBSelChanged = \"systemChat str ['onLBSelChanged',_this]; false\";\n  onLBDblClick = \"systemChat str ['onLBDblClick',_this]; false\";\n};\n```"}],"categories":["Control Types"],"groups":["GUI"]}