{"name":"CT LISTNBOX","title":"CT LISTNBOX","type":"topic","url":"https://community.bistudio.com/wiki/CT_LISTNBOX","revid":376157,"updated":"2025-09-08T19:16:56Z","aliases":[],"markdown":"### Introduction\n\nSimilar to CT_LISTBOX. Additionally this control supports multiple columns which all have their own text, data and value. Another feature is the ability to define idcLeft and idcRight to add buttons to the currently selected row.\n\n> [!IMPORTANT]\n> CT_LISTNBOX controls frequently cause unexpected issues with other controls if `idcLeft` and `idcRight` are set to -1. Use other values for `idcLeft` and `idcRight` to avoid these issues.\n\n#### Related commands & functions\n\n- Commands: General\n- Commands: UI Eventhandlers\n- Commands: ListNBox\n- Commands: Listbox\n- BIS_fnc_initListNBoxSorting\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_LISTNBOX 102\n```\n\n#### A\n\n##### arrowEmpty\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\narrowEmpty = \"#(argb,8,8,3)color(1,1,1,1)\";\n```\n\n##### arrowFull\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\narrowFull = \"#(argb,8,8,3)color(1,1,1,1)\";\n```\n\n##### autoScrollDelay\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nautoScrollDelay = 5;\n```\n\n##### autoScrollRewind\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nautoScrollRewind = 0;\n```\n\n##### autoScrollSpeed\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nautoScrollSpeed = -1;\n```\n\n#### C\n\n##### canDrag\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\ncanDrag = 1;\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##### 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##### colorPictureSelected\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPictureSelected[] = {1,1,1,1};\n```\n\n##### colorPlayerItem\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPlayerItem[] = {1,1,1,1};\n```\n\n##### colorScrollbar\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorScrollbar[] = {0.95,0.95,0.95,1};\n```\n\n##### colorSelect\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelect[] = {1,1,1,1};\n```\n\n##### colorSelect2\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelect2[] = {0,0,0,1};\n```\n\n##### colorSelect2Right\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelect2Right[] = {1,1,1,1};\n```\n\n##### colorSelectBackground\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelectBackground[] = {1,1,1,0.25};\n```\n\n##### colorSelectBackground2\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelectBackground2[] = {1,1,1,0.3};\n```\n\n##### colorSelectRight\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelectRight[] = {1,1,1,1};\n```\n\n##### colorShadow\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorShadow[] = {0,0,0,0.5};\n```\n\n##### columns\n\n**Type:** Array\n\n**Description:** Define the left starting position of each column. The values are offsets ratios (not spacing ratios). Tip: Use {-0.01} in first column to fix unwanted offset, if desired.\n\n```cpp\ncolumns[] = {\"7.2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)\",\"15.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)\"};\n```\n\n#### D\n\n##### disableOverflow\n\n**Type:** Number\n\n**Description:** Don't allow text to continue in next column.\n\n```cpp\ndisableOverflow = 1;\n```\n\n##### drawSideArrows\n\n**Type:** Number\n\n**Description:** Each row can be linked to 2 arrow buttons which are shown on the left and right of the row.\n\n> [!IMPORTANT]\n> `drawSideArrows` attribute is irrelevant and does not control the appearance of the left and right arrows/buttons despite the intention, and it could be ignored all together. Instead, idcLeft and idcRight attributes control these arrows/buttons.\n\n```cpp\ndrawSideArrows = 1;\n```\n\n#### I\n\n##### idcLeft\n\n**Type:** Number\n\n**Description:** The IDC of the control to be used for the left control that shows up in the selected row.\n\n> [!IMPORTANT]\n> Buttons will only be drawn if **both** idcLeft and idcRight are defined. Furthermore, the position of the first column needs to be adjusted so that the button does not overlap with the text. The button's height will be adjusted to the rowHeight property of the CT_LISTNBOX and the button's x, y, w and h properties can be set to -1.\n\n> [!IMPORTANT]\n> -1 is a valid idc for this attribute!\n\n```cpp\nidcLeft = 24468;\n```\n\n##### idcRight\n\n**Type:** Number\n\n**Description:** The IDC of the control to be used for the right control that shows up in the selected row.\n\n> [!IMPORTANT]\n> -1 is a valid idc for this attribute!\n\n```cpp\nidcRight = 24469;\n```\n\n##### idcx\n\n**Type:** Number\n\n**Description:** Used in the Arsenal, can be ignored.\n\n```cpp\nidcx = 984;\n```\n\n##### Items\n\n**Type:** Class\n\n**Description:** List of default items. See CT_COMBO#Items for more details.\n\n```cpp\nclass Items\n{\n    class Presence\n    {\n        text = \"\";\n        value = 1;\n        data = \"value\";\n    };\n    class Name\n    {\n        text = \"Name\";\n        value = -1;\n    };\n    class Author\n    {\n        text = \"Author\";\n        value = -1;\n    };\n};\n```\n\n#### L\n\n##### ListScrollBar\n\n**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass ListScrollBar\n{\n    color[] = {1,1,1,0.6};\n    colorActive[] = {1,1,1,1};\n    colorDisabled[] = {1,1,1,0.3};\n    thumb = \"\\A3\\ui_f\\data\\gui\\cfg\\scrollbar\\thumb_ca.paa\";\n    arrowEmpty = \"\\A3\\ui_f\\data\\gui\\cfg\\scrollbar\\arrowEmpty_ca.paa\";\n    arrowFull = \"\\A3\\ui_f\\data\\gui\\cfg\\scrollbar\\arrowFull_ca.paa\";\n    border = \"\\A3\\ui_f\\data\\gui\\cfg\\scrollbar\\border_ca.paa\";\n    shadow = 0;\n    scrollSpeed = 0.06;\n    width = 0;\n    height = 0;\n    autoScrollEnabled = 0;\n    autoScrollSpeed = -1;\n    autoScrollDelay = 5;\n    autoScrollRewind = 0;\n};\n```\n\n#### M\n\n##### maxHistoryDelay\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nmaxHistoryDelay = 1;\n```\n\n##### MuteCheckBoxTemplate\n\n**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass MuteCheckBoxTemplate\n{\n    x = 0;\n    y = 0;\n    w = \"0.8 * (((safezoneW / safezoneH) min 1.2) / 40)\";\n    h = \"0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)\";\n    textureChecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_ca.paa\";\n    textureUnchecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_crossed_ca.paa\";\n    textureFocusedChecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_ca.paa\";\n    textureFocusedUnchecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_crossed_ca.paa\";\n    textureHoverChecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_ca.paa\";\n    textureHoverUnchecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_crossed_ca.paa\";\n    texturePressedChecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_ca.paa\";\n    texturePressedUnchecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_crossed_ca.paa\";\n    textureDisabledChecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_ca.paa\";\n    textureDisabledUnchecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_crossed_ca.paa\";\n    idc = -1;\n    type = 77;\n    deletable = 0;\n    style = 0;\n    checked = 0;\n    color[] = {1,1,1,0.7};\n    colorFocused[] = {1,1,1,1};\n    colorHover[] = {1,1,1,1};\n    colorPressed[] = {1,1,1,1};\n    colorDisabled[] = {1,1,1,0.2};\n    colorBackground[] = {0,0,0,0};\n    colorBackgroundFocused[] = {0,0,0,0};\n    colorBackgroundHover[] = {0,0,0,0};\n    colorBackgroundPressed[] = {0,0,0,0};\n    colorBackgroundDisabled[] = {0,0,0,0};\n    tooltipColorText[] = {1,1,1,1};\n    tooltipColorBox[] = {1,1,1,1};\n    tooltipColorShade[] = {0,0,0,0.65};\n    soundEnter[] = {\"\",0.1,1};\n    soundPush[] = {\"\",0.1,1};\n    soundClick[] = {\"\",0.1,1};\n    soundEscape[] = {\"\",0.1,1};\n};\n```\n\n#### P\n\n##### padding\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\npadding = 0.004;\n```\n\n##### period\n\n**Type:** Number\n\n**Description:** Time it takes to pulsate between the select colors.\n\n```cpp\nperiod = 1.2;\n```\n\n#### R\n\n##### rowHeight\n\n**Type:** Number, String\n\n**Description:** The height of a single row.\n\nNumber example:\n\n```cpp\nrowHeight = 0;\n```\n\nString example:\n\n```cpp\nrowHeight = \"((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)\";\n```\n\n##### rows\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nrows = 25;\n```\n\n#### S\n\n##### selectWithRMB\n\n**Type:** Number\n\n**Description**\n\nEnable row selection with the right mouse button.\n\n> [!NOTE]\n> **Arma 3:** Since Arma 3 v2.00.\n\n```cpp\nselectWithRMB = 0;\n```\n\n##### shadowPictureLeft\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nshadowPictureLeft = 0;\n```\n\n##### shadowPictureRight\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nshadowPictureRight = 0;\n```\n\n##### shadowTextLeft\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nshadowTextLeft = 0;\n```\n\n##### shadowTextRight\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nshadowTextRight = 0;\n```\n\n##### soundSelect\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundSelect[] = {\"\",0.1,1};\n```\n\n##### soundSelect\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundSelect[] = {\"\",0.1,1};\n```\n\n#### T\n\n##### tooltipPerColumn\n\n**Type:** Boolean\n\n**Description**\n\nIf set to true, each cell can have a different tooltip. (Optional - default: false)\n\n> [!NOTE]\n> **Arma 3:** Since Arma 3 v2.01.147037.\n\n```cpp\ntooltipPerColumn = true;\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#### RscListNBox\n\n```cpp\nclass RscListNBox\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_LISTNBOX;\n    rowHeight = 0;\n    colorText[] = {1,1,1,1};\n    colorScrollbar[] = {0.95,0.95,0.95,1};\n    colorSelect[] = {0,0,0,1};\n    colorSelect2[] = {0,0,0,1};\n    colorSelectBackground[] = {0.95,0.95,0.95,1};\n    colorSelectBackground2[] = {1,1,1,0.5};\n    colorBackground[] = {0,0,0,1};\n    maxHistoryDelay = 1;\n    soundSelect[] =\n    {\n        \"\",\n        0.1,\n        1\n    };\n    autoScrollSpeed = -1;\n    autoScrollDelay = 5;\n    autoScrollRewind = 0;\n    arrowEmpty = \"#(argb,8,8,3)color(1,1,1,1)\";\n    arrowFull = \"#(argb,8,8,3)color(1,1,1,1)\";\n    drawSideArrows = 0;\n    columns[] = {0.3,0.6,0.7};\n    idcLeft = -1;\n    idcRight = -1;\n    class ListScrollBar : ScrollBar\n    {\n    };\n    style = ST_MULTI;\n    shadow = 0;\n    font = \"RobotoCondensed\";\n    sizeEx = GUI_TEXT_SIZE_MEDIUM;\n    color[] = {0.95,0.95,0.95,1};\n    colorDisabled[] = {1,1,1,0.25};\n    colorPicture[] = {1,1,1,1};\n    colorPictureSelected[] = {1,1,1,1};\n    colorPictureDisabled[] = {1,1,1,1};\n    period = 1.2;\n    x = 0;\n    y = 0;\n    w = 0.3;\n    h = 0.3;\n    class ScrollBar : ScrollBar\n    {\n    };\n};\n```\n\n### Other Examples\n\n```cpp\nclass RscListNBox\n{\n  access = 0;\n  type = CT_LISTNBOX;// 102;\n  style =ST_MULTI;\n  w = 0.4;   h = 0.4;\n  font = \"TahomaB\";\n  sizeEx = 0.04;\n  colorText[] = {0.8784, 0.8471, 0.651, 1};\n  colorBackground[] = {0, 0, 0, 1};\n  autoScrollSpeed = -1;\n  autoScrollDelay = 5;\n  autoScrollRewind = 0;\n  arrowEmpty = \"#(argb,8,8,3)color(1,1,1,1)\";\n  arrowFull = \"#(argb,8,8,3)color(1,1,1,1)\";\n  columns[] = {0.3, 0.6, 0.7};\n  color[] = {1, 1, 1, 1};\n  colorScrollbar[] = {0.95, 0.95, 0.95, 1};\n  colorSelect[] = {0.95, 0.95, 0.95, 1};\n  colorSelect2[] = {0.95, 0.95, 0.95, 1};\n  colorSelectBackground[] = {0, 0, 0, 1};\n  colorSelectBackground2[] = {0.8784, 0.8471, 0.651, 1};\n  drawSideArrows = 0;\n  idcLeft = -1;\n  idcRight = -1;\n  maxHistoryDelay = 1;\n  rowHeight = 0;\n  soundSelect[] = {\"\", 0.1, 1};\n  period = 1;\n  shadow = 2;\n  class ScrollBar\n  {\n    arrowEmpty = \"#(argb,8,8,3)color(1,1,1,1)\";\n    arrowFull = \"#(argb,8,8,3)color(1,1,1,1)\";\n    border = \"#(argb,8,8,3)color(1,1,1,1)\";\n    color[] = {1,1,1,0.6};\n    colorActive[] = {1,1,1,1};\n    colorDisabled[] = {1,1,1,0.3};\n    thumb = \"#(argb,8,8,3)color(1,1,1,1)\";\n  };\n};\n```\n\n### Scripting Example\n\nAs for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the CT_LISTNBOX with different spaces. Accessing data with coordinate command at nearly the same syntax:\n\n```sqf\n// Set same value to one position of a Control\n_ctrl lnbSetData [[0,0],\"#1\"];\nlnbSetColumnsPos [102,[0,1],1];\n_ctrl lnbSetText [[0,1], \"#1\"];\n_ctrl lnbSetValue [[0,0],1];\n// Accessing the value disregard affecting one another\n_ctrl lnbData [0,0]; // \"#1\"\nlnbGetColumnsPosition _ctrl; // [1];\n_ctrl lnbText [0,0]; // \"#1\"\n_ctrl lnbValue [0,0]; // 1\n```\n\nFor a direct visible control over CT_LISTNBOX:\n\n| Code | Pictures |\n|---|---|\n| ```sqf<br>[_CT_LISTNBOX] spawn {<br>    disableSerialization;<br>    params [\"_CT_LISTNBOX\"];<br>    {<br>        _CT_LISTNBOX lnbAddRow [getText (_x >> \"displayNameShort\"), getText (_x >> \"displayName\")];<br>        _CT_LISTNBOX lnbSetPicture [[_foreachIndex, 0],getText (_x >> \"texture\")];<br>    } forEach (\"true\" configClasses (configFile >> \"CfgRanks\"));<br>    _CT_LISTNBOX lnbSetCurSelRow 0;<br>    private _current = lnbCurSelRow _CT_LISTNBOX;<br>    private _color = _CT_LISTNBOX lnbColor [_current, 0];<br>    _CT_LISTNBOX lnbSetColor [[_current, 1], [(_color select 0) / 2, 0, 0, 1]];<br>    _CT_LISTNBOX lnbDeleteColumn 0;<br>    _CT_LISTNBOX lnbDeleteRow 1;<br>    sleep 1;<br>    lnbClear _CT_LISTNBOX; // Clear all items but control still remains just invisible<br>};<br>``` |  |\n\n### BIS_fnc_initListNBoxSorting Example\n\nBIS_fnc_initListNBoxSorting can be used to create a sortable CT_LISTNBOX. To that end, two separate CT_LISTNBOX controls are required: One filter control and one content control. The filter control becomes the header of the sortable CT_LISTNBOX.\n\nThis example demonstrates the basic steps and components needed to create a sortable CT_LISTNBOX. See BIS_fnc_initListNBoxSorting to learn more about additional features of that function.\n\n```cpp\nimport ctrlListNBox; //This base class comes with vanilla Arma 3 and is of type CT_LISTNBOX.\n\nclass ExampleDialog {\n    idd = 12345;\n    onLoad = \"_this call TAG_fnc_initListNBoxCtrls;\";\n    //...\n\n    class ControlsBackground {\n        //...\n    };\n\n    class Controls {\n        class Filter : ctrlListNBox {\n            idc = 100;\n            x = 0;\n            y = 0.045;\n            w = 1;\n            h = 0.04;\n        };\n\n        class Content : ctrlListNBox {\n            idc = 101;\n            disableOverflow = 1;\n            tooltipPerColumn = 1;\n            x = 0;\n            y = 0.085;\n            w = 1;\n            h = 0.87;\n        };\n\n        //...\n    };\n};\n```\n\nThe `TAG_fnc_initListNBoxCtrls` function (called from the onLoad UI Event Handler):\n\n```sqf\ndisableSerialization;\n\nparams [\"_parentDisplay\"];\n\nprivate _filterCtrl = _parentDisplay displayCtrl 100;\nprivate _contentCtrl = _parentDisplay displayCtrl 101;\n\n// Add columns:\n{\n    _x lnbAddColumn 0.5;\n} forEach [_filterCtrl, _contentCtrl];\n\n// Add column headers:\n_filterCtrl lnbAddRow [\"Name\", \"Group\"];\n\n// Add content rows:\n{\n    _contentCtrl lnbAddRow [name _x, groupId group _x];\n} forEach allUnits;\n\n[_filterCtrl, _contentCtrl] call BIS_fnc_initListNBoxSorting;\n\nctrlSetFocus _contentCtrl; // Without this line, the user has to click _contentCtrl first in order to use the sorting buttons.\n```","sections":[{"heading":"Introduction","level":3,"markdown":"Similar to CT_LISTBOX. Additionally this control supports multiple columns which all have their own text, data and value. Another feature is the ability to define idcLeft and idcRight to add buttons to the currently selected row.\n\n> [!IMPORTANT]\n> CT_LISTNBOX controls frequently cause unexpected issues with other controls if `idcLeft` and `idcRight` are set to -1. Use other values for `idcLeft` and `idcRight` to avoid these issues."},{"heading":"Related commands & functions","level":4,"markdown":"- Commands: General\n- Commands: UI Eventhandlers\n- Commands: ListNBox\n- Commands: Listbox\n- BIS_fnc_initListNBoxSorting"},{"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_LISTNBOX 102\n```"},{"heading":"A","level":4,"markdown":""},{"heading":"arrowEmpty","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\narrowEmpty = \"#(argb,8,8,3)color(1,1,1,1)\";\n```"},{"heading":"arrowFull","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\narrowFull = \"#(argb,8,8,3)color(1,1,1,1)\";\n```"},{"heading":"autoScrollDelay","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nautoScrollDelay = 5;\n```"},{"heading":"autoScrollRewind","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nautoScrollRewind = 0;\n```"},{"heading":"autoScrollSpeed","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nautoScrollSpeed = -1;\n```"},{"heading":"C","level":4,"markdown":""},{"heading":"canDrag","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\ncanDrag = 1;\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":"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":"colorPictureSelected","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPictureSelected[] = {1,1,1,1};\n```"},{"heading":"colorPlayerItem","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorPlayerItem[] = {1,1,1,1};\n```"},{"heading":"colorScrollbar","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorScrollbar[] = {0.95,0.95,0.95,1};\n```"},{"heading":"colorSelect","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelect[] = {1,1,1,1};\n```"},{"heading":"colorSelect2","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelect2[] = {0,0,0,1};\n```"},{"heading":"colorSelect2Right","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelect2Right[] = {1,1,1,1};\n```"},{"heading":"colorSelectBackground","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelectBackground[] = {1,1,1,0.25};\n```"},{"heading":"colorSelectBackground2","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelectBackground2[] = {1,1,1,0.3};\n```"},{"heading":"colorSelectRight","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSelectRight[] = {1,1,1,1};\n```"},{"heading":"colorShadow","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorShadow[] = {0,0,0,0.5};\n```"},{"heading":"columns","level":5,"markdown":"**Type:** Array\n\n**Description:** Define the left starting position of each column. The values are offsets ratios (not spacing ratios). Tip: Use {-0.01} in first column to fix unwanted offset, if desired.\n\n```cpp\ncolumns[] = {\"7.2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)\",\"15.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)\"};\n```"},{"heading":"D","level":4,"markdown":""},{"heading":"disableOverflow","level":5,"markdown":"**Type:** Number\n\n**Description:** Don't allow text to continue in next column.\n\n```cpp\ndisableOverflow = 1;\n```"},{"heading":"drawSideArrows","level":5,"markdown":"**Type:** Number\n\n**Description:** Each row can be linked to 2 arrow buttons which are shown on the left and right of the row.\n\n> [!IMPORTANT]\n> `drawSideArrows` attribute is irrelevant and does not control the appearance of the left and right arrows/buttons despite the intention, and it could be ignored all together. Instead, idcLeft and idcRight attributes control these arrows/buttons.\n\n```cpp\ndrawSideArrows = 1;\n```"},{"heading":"I","level":4,"markdown":""},{"heading":"idcLeft","level":5,"markdown":"**Type:** Number\n\n**Description:** The IDC of the control to be used for the left control that shows up in the selected row.\n\n> [!IMPORTANT]\n> Buttons will only be drawn if **both** idcLeft and idcRight are defined. Furthermore, the position of the first column needs to be adjusted so that the button does not overlap with the text. The button's height will be adjusted to the rowHeight property of the CT_LISTNBOX and the button's x, y, w and h properties can be set to -1.\n\n> [!IMPORTANT]\n> -1 is a valid idc for this attribute!\n\n```cpp\nidcLeft = 24468;\n```"},{"heading":"idcRight","level":5,"markdown":"**Type:** Number\n\n**Description:** The IDC of the control to be used for the right control that shows up in the selected row.\n\n> [!IMPORTANT]\n> -1 is a valid idc for this attribute!\n\n```cpp\nidcRight = 24469;\n```"},{"heading":"idcx","level":5,"markdown":"**Type:** Number\n\n**Description:** Used in the Arsenal, can be ignored.\n\n```cpp\nidcx = 984;\n```"},{"heading":"Items","level":5,"markdown":"**Type:** Class\n\n**Description:** List of default items. See CT_COMBO#Items for more details.\n\n```cpp\nclass Items\n{\n    class Presence\n    {\n        text = \"\";\n        value = 1;\n        data = \"value\";\n    };\n    class Name\n    {\n        text = \"Name\";\n        value = -1;\n    };\n    class Author\n    {\n        text = \"Author\";\n        value = -1;\n    };\n};\n```"},{"heading":"L","level":4,"markdown":""},{"heading":"ListScrollBar","level":5,"markdown":"**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass ListScrollBar\n{\n    color[] = {1,1,1,0.6};\n    colorActive[] = {1,1,1,1};\n    colorDisabled[] = {1,1,1,0.3};\n    thumb = \"\\A3\\ui_f\\data\\gui\\cfg\\scrollbar\\thumb_ca.paa\";\n    arrowEmpty = \"\\A3\\ui_f\\data\\gui\\cfg\\scrollbar\\arrowEmpty_ca.paa\";\n    arrowFull = \"\\A3\\ui_f\\data\\gui\\cfg\\scrollbar\\arrowFull_ca.paa\";\n    border = \"\\A3\\ui_f\\data\\gui\\cfg\\scrollbar\\border_ca.paa\";\n    shadow = 0;\n    scrollSpeed = 0.06;\n    width = 0;\n    height = 0;\n    autoScrollEnabled = 0;\n    autoScrollSpeed = -1;\n    autoScrollDelay = 5;\n    autoScrollRewind = 0;\n};\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":"MuteCheckBoxTemplate","level":5,"markdown":"**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass MuteCheckBoxTemplate\n{\n    x = 0;\n    y = 0;\n    w = \"0.8 * (((safezoneW / safezoneH) min 1.2) / 40)\";\n    h = \"0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)\";\n    textureChecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_ca.paa\";\n    textureUnchecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_crossed_ca.paa\";\n    textureFocusedChecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_ca.paa\";\n    textureFocusedUnchecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_crossed_ca.paa\";\n    textureHoverChecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_ca.paa\";\n    textureHoverUnchecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_crossed_ca.paa\";\n    texturePressedChecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_ca.paa\";\n    texturePressedUnchecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_crossed_ca.paa\";\n    textureDisabledChecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_ca.paa\";\n    textureDisabledUnchecked = \"\\A3\\Ui_f\\data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_crossed_ca.paa\";\n    idc = -1;\n    type = 77;\n    deletable = 0;\n    style = 0;\n    checked = 0;\n    color[] = {1,1,1,0.7};\n    colorFocused[] = {1,1,1,1};\n    colorHover[] = {1,1,1,1};\n    colorPressed[] = {1,1,1,1};\n    colorDisabled[] = {1,1,1,0.2};\n    colorBackground[] = {0,0,0,0};\n    colorBackgroundFocused[] = {0,0,0,0};\n    colorBackgroundHover[] = {0,0,0,0};\n    colorBackgroundPressed[] = {0,0,0,0};\n    colorBackgroundDisabled[] = {0,0,0,0};\n    tooltipColorText[] = {1,1,1,1};\n    tooltipColorBox[] = {1,1,1,1};\n    tooltipColorShade[] = {0,0,0,0.65};\n    soundEnter[] = {\"\",0.1,1};\n    soundPush[] = {\"\",0.1,1};\n    soundClick[] = {\"\",0.1,1};\n    soundEscape[] = {\"\",0.1,1};\n};\n```"},{"heading":"P","level":4,"markdown":""},{"heading":"padding","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\npadding = 0.004;\n```"},{"heading":"period","level":5,"markdown":"**Type:** Number\n\n**Description:** Time it takes to pulsate between the select colors.\n\n```cpp\nperiod = 1.2;\n```"},{"heading":"R","level":4,"markdown":""},{"heading":"rowHeight","level":5,"markdown":"**Type:** Number, String\n\n**Description:** The height of a single row.\n\nNumber example:\n\n```cpp\nrowHeight = 0;\n```\n\nString example:\n\n```cpp\nrowHeight = \"((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)\";\n```"},{"heading":"rows","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nrows = 25;\n```"},{"heading":"S","level":4,"markdown":""},{"heading":"selectWithRMB","level":5,"markdown":"**Type:** Number\n\n**Description**\n\nEnable row selection with the right mouse button.\n\n> [!NOTE]\n> **Arma 3:** Since Arma 3 v2.00.\n\n```cpp\nselectWithRMB = 0;\n```"},{"heading":"shadowPictureLeft","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nshadowPictureLeft = 0;\n```"},{"heading":"shadowPictureRight","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nshadowPictureRight = 0;\n```"},{"heading":"shadowTextLeft","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nshadowTextLeft = 0;\n```"},{"heading":"shadowTextRight","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nshadowTextRight = 0;\n```"},{"heading":"soundSelect","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundSelect[] = {\"\",0.1,1};\n```"},{"heading":"soundSelect","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundSelect[] = {\"\",0.1,1};\n```"},{"heading":"T","level":4,"markdown":""},{"heading":"tooltipPerColumn","level":5,"markdown":"**Type:** Boolean\n\n**Description**\n\nIf set to true, each cell can have a different tooltip. (Optional - default: false)\n\n> [!NOTE]\n> **Arma 3:** Since Arma 3 v2.01.147037.\n\n```cpp\ntooltipPerColumn = true;\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":"RscListNBox","level":4,"markdown":"```cpp\nclass RscListNBox\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_LISTNBOX;\n    rowHeight = 0;\n    colorText[] = {1,1,1,1};\n    colorScrollbar[] = {0.95,0.95,0.95,1};\n    colorSelect[] = {0,0,0,1};\n    colorSelect2[] = {0,0,0,1};\n    colorSelectBackground[] = {0.95,0.95,0.95,1};\n    colorSelectBackground2[] = {1,1,1,0.5};\n    colorBackground[] = {0,0,0,1};\n    maxHistoryDelay = 1;\n    soundSelect[] =\n    {\n        \"\",\n        0.1,\n        1\n    };\n    autoScrollSpeed = -1;\n    autoScrollDelay = 5;\n    autoScrollRewind = 0;\n    arrowEmpty = \"#(argb,8,8,3)color(1,1,1,1)\";\n    arrowFull = \"#(argb,8,8,3)color(1,1,1,1)\";\n    drawSideArrows = 0;\n    columns[] = {0.3,0.6,0.7};\n    idcLeft = -1;\n    idcRight = -1;\n    class ListScrollBar : ScrollBar\n    {\n    };\n    style = ST_MULTI;\n    shadow = 0;\n    font = \"RobotoCondensed\";\n    sizeEx = GUI_TEXT_SIZE_MEDIUM;\n    color[] = {0.95,0.95,0.95,1};\n    colorDisabled[] = {1,1,1,0.25};\n    colorPicture[] = {1,1,1,1};\n    colorPictureSelected[] = {1,1,1,1};\n    colorPictureDisabled[] = {1,1,1,1};\n    period = 1.2;\n    x = 0;\n    y = 0;\n    w = 0.3;\n    h = 0.3;\n    class ScrollBar : ScrollBar\n    {\n    };\n};\n```"},{"heading":"Other Examples","level":3,"markdown":"```cpp\nclass RscListNBox\n{\n  access = 0;\n  type = CT_LISTNBOX;// 102;\n  style =ST_MULTI;\n  w = 0.4;   h = 0.4;\n  font = \"TahomaB\";\n  sizeEx = 0.04;\n  colorText[] = {0.8784, 0.8471, 0.651, 1};\n  colorBackground[] = {0, 0, 0, 1};\n  autoScrollSpeed = -1;\n  autoScrollDelay = 5;\n  autoScrollRewind = 0;\n  arrowEmpty = \"#(argb,8,8,3)color(1,1,1,1)\";\n  arrowFull = \"#(argb,8,8,3)color(1,1,1,1)\";\n  columns[] = {0.3, 0.6, 0.7};\n  color[] = {1, 1, 1, 1};\n  colorScrollbar[] = {0.95, 0.95, 0.95, 1};\n  colorSelect[] = {0.95, 0.95, 0.95, 1};\n  colorSelect2[] = {0.95, 0.95, 0.95, 1};\n  colorSelectBackground[] = {0, 0, 0, 1};\n  colorSelectBackground2[] = {0.8784, 0.8471, 0.651, 1};\n  drawSideArrows = 0;\n  idcLeft = -1;\n  idcRight = -1;\n  maxHistoryDelay = 1;\n  rowHeight = 0;\n  soundSelect[] = {\"\", 0.1, 1};\n  period = 1;\n  shadow = 2;\n  class ScrollBar\n  {\n    arrowEmpty = \"#(argb,8,8,3)color(1,1,1,1)\";\n    arrowFull = \"#(argb,8,8,3)color(1,1,1,1)\";\n    border = \"#(argb,8,8,3)color(1,1,1,1)\";\n    color[] = {1,1,1,0.6};\n    colorActive[] = {1,1,1,1};\n    colorDisabled[] = {1,1,1,0.3};\n    thumb = \"#(argb,8,8,3)color(1,1,1,1)\";\n  };\n};\n```"},{"heading":"Scripting Example","level":3,"markdown":"As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the CT_LISTNBOX with different spaces. Accessing data with coordinate command at nearly the same syntax:\n\n```sqf\n// Set same value to one position of a Control\n_ctrl lnbSetData [[0,0],\"#1\"];\nlnbSetColumnsPos [102,[0,1],1];\n_ctrl lnbSetText [[0,1], \"#1\"];\n_ctrl lnbSetValue [[0,0],1];\n// Accessing the value disregard affecting one another\n_ctrl lnbData [0,0]; // \"#1\"\nlnbGetColumnsPosition _ctrl; // [1];\n_ctrl lnbText [0,0]; // \"#1\"\n_ctrl lnbValue [0,0]; // 1\n```\n\nFor a direct visible control over CT_LISTNBOX:\n\n| Code | Pictures |\n|---|---|\n| ```sqf<br>[_CT_LISTNBOX] spawn {<br>    disableSerialization;<br>    params [\"_CT_LISTNBOX\"];<br>    {<br>        _CT_LISTNBOX lnbAddRow [getText (_x >> \"displayNameShort\"), getText (_x >> \"displayName\")];<br>        _CT_LISTNBOX lnbSetPicture [[_foreachIndex, 0],getText (_x >> \"texture\")];<br>    } forEach (\"true\" configClasses (configFile >> \"CfgRanks\"));<br>    _CT_LISTNBOX lnbSetCurSelRow 0;<br>    private _current = lnbCurSelRow _CT_LISTNBOX;<br>    private _color = _CT_LISTNBOX lnbColor [_current, 0];<br>    _CT_LISTNBOX lnbSetColor [[_current, 1], [(_color select 0) / 2, 0, 0, 1]];<br>    _CT_LISTNBOX lnbDeleteColumn 0;<br>    _CT_LISTNBOX lnbDeleteRow 1;<br>    sleep 1;<br>    lnbClear _CT_LISTNBOX; // Clear all items but control still remains just invisible<br>};<br>``` |  |"},{"heading":"BIS_fnc_initListNBoxSorting Example","level":3,"markdown":"BIS_fnc_initListNBoxSorting can be used to create a sortable CT_LISTNBOX. To that end, two separate CT_LISTNBOX controls are required: One filter control and one content control. The filter control becomes the header of the sortable CT_LISTNBOX.\n\nThis example demonstrates the basic steps and components needed to create a sortable CT_LISTNBOX. See BIS_fnc_initListNBoxSorting to learn more about additional features of that function.\n\n```cpp\nimport ctrlListNBox; //This base class comes with vanilla Arma 3 and is of type CT_LISTNBOX.\n\nclass ExampleDialog {\n    idd = 12345;\n    onLoad = \"_this call TAG_fnc_initListNBoxCtrls;\";\n    //...\n\n    class ControlsBackground {\n        //...\n    };\n\n    class Controls {\n        class Filter : ctrlListNBox {\n            idc = 100;\n            x = 0;\n            y = 0.045;\n            w = 1;\n            h = 0.04;\n        };\n\n        class Content : ctrlListNBox {\n            idc = 101;\n            disableOverflow = 1;\n            tooltipPerColumn = 1;\n            x = 0;\n            y = 0.085;\n            w = 1;\n            h = 0.87;\n        };\n\n        //...\n    };\n};\n```\n\nThe `TAG_fnc_initListNBoxCtrls` function (called from the onLoad UI Event Handler):\n\n```sqf\ndisableSerialization;\n\nparams [\"_parentDisplay\"];\n\nprivate _filterCtrl = _parentDisplay displayCtrl 100;\nprivate _contentCtrl = _parentDisplay displayCtrl 101;\n\n// Add columns:\n{\n    _x lnbAddColumn 0.5;\n} forEach [_filterCtrl, _contentCtrl];\n\n// Add column headers:\n_filterCtrl lnbAddRow [\"Name\", \"Group\"];\n\n// Add content rows:\n{\n    _contentCtrl lnbAddRow [name _x, groupId group _x];\n} forEach allUnits;\n\n[_filterCtrl, _contentCtrl] call BIS_fnc_initListNBoxSorting;\n\nctrlSetFocus _contentCtrl; // Without this line, the user has to click _contentCtrl first in order to use the sorting buttons.\n```"}],"categories":["Control Types"],"groups":["GUI"]}