CT LISTBOX: Difference between revisions
Killzone Kid (talk | contribs) (Redirected page to DialogControls-ListBoxes) |
(actual title of config example) |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
# | [[Category: Control Types]] | ||
{{CT|intro | |||
|macro = CT_LISTBOX | |||
|value = 5 | |||
|description = The listbox displays a list of items. With ST_MULTI it is possible to select multiple entries. For listBoxes, the usage of 'ST_' style constants (ST_MULTI & ST_TITLE_BAR) behave differently than expected for other controls, so use the corresponding 'LB_' (LB_TEXTURES & LB_MULTI) list box style variants instead.<br> | |||
[[File:WuChaoRen ctListBox.png]] | |||
<syntaxhighlight lang="cpp"> | |||
style = LB_TEXTURES; // solid scrollbar | |||
style = LB_MULTI; // multiple item selection | |||
</syntaxhighlight> | |||
|commands = | |||
* [[:Category:Command_Group:_GUI_Control_-_ListBox|Commands: Listbox]] | |||
|events = | |||
* [[User_Interface_Event_Handlers#Listbox_events|Events: Listbox]] | |||
}} | |||
{{CT|abc start}} | |||
=== A === | |||
{{CT|attribute | |||
|name=active | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaysinglemission\done_ca.paa" | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=addons | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_addons_ca.paa" | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=allowedFilePatching | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_version_ca.paa" | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=arrowEmpty | |||
|type1=String | |||
|value1="#(argb,8,8,3)color(1,1,1,1)" | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=arrowFull | |||
|type1=String | |||
|value1="#(argb,8,8,3)color(1,1,1,1)" | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=autoScrollDelay | |||
|type1=Number | |||
|value1=5 | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=autoScrollRewind | |||
|type1=Number | |||
|value1=0 | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=autoScrollSpeed | |||
|type1=Number | |||
|value1=-1 | |||
|description= | |||
}} | |||
=== C === | |||
{{CT|attribute | |||
|name=canDrag | |||
|type1=Number | |||
|value1=0 | |||
|description=Allow dragging and dropping listbox items similar to how the inventory works. | |||
}} | |||
{{CT|attribute | |||
|name=collisionColor | |||
|type1=Array | |||
|value1={"(profilenamespace getvariable ['IGUI_ERROR_RGB_R',0.8])","(profilenamespace getvariable ['IGUI_ERROR_RGB_G',0.0])","(profilenamespace getvariable ['IGUI_ERROR_RGB_B',0.0])",1} | |||
|description=Color of the collision key binding; default {1,0,0,1} - <u>Only relevant to config keys dialog (type = 5; idc = 102)</u> | |||
}} | |||
{{CT|attribute | |||
|name=collisionColorFirstKey | |||
|type1=Array | |||
|value1={"(profilenamespace getvariable ['IGUI_WARNING_RGB_R',0.8])","(profilenamespace getvariable ['IGUI_WARNING_RGB_G',0.5])","(profilenamespace getvariable ['IGUI_WARNING_RGB_B',0.0])",1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=color | |||
|type1=Array | |||
|value1={0.95,0.95,0.95,1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorAI | |||
|type1=Array | |||
|value1={1,0,0,1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorNobody | |||
|type1=Array | |||
|value1={1,1,1,0.25} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorPicture | |||
|type1=Array | |||
|value1={1,1,1,1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorPictureDisabled | |||
|type1=Array | |||
|value1={1,1,1,0.25} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorPictureRight | |||
|type1=Array | |||
|value1={1,1,1,1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorPictureRightDisabled | |||
|type1=Array | |||
|value1={1,1,1,0.25} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorPictureRightSelected | |||
|type1=Array | |||
|value1={1,1,1,1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorPictureSelected | |||
|type1=Array | |||
|value1={1,1,1,1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorPingBad | |||
|type1=Array | |||
|value1={1,0,0,1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorPingGood | |||
|type1=Array | |||
|value1={0,1,0,1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorPingPoor | |||
|type1=Array | |||
|value1={1,0.6,0,1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorPingUnknown | |||
|type1=Array | |||
|value1={0.4,0.4,0.4,1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorPlayer | |||
|type1=Array | |||
|value1={1,1,0,1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorScrollbar | |||
|type1=Array | |||
|value1={1,0,0,0} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorSelect | |||
|type1=Array | |||
|value1={1,1,1,1} | |||
|description=Text color of a selected item. | |||
}} | |||
{{CT|attribute | |||
|name=colorSelect2 | |||
|type1=Array | |||
|value1={0,0,0,1} | |||
|description=Text color to pulsate to from {{hl|colorSelect}}. | |||
}} | |||
{{CT|attribute | |||
|name=colorSelect2Right | |||
|type1=Array | |||
|value1={0,0,0,1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorSelectBackground | |||
|type1=Array | |||
|value1={0.95,0.95,0.95,1} | |||
|description=Background color of a selected entry. | |||
}} | |||
{{CT|attribute | |||
|name=colorSelectBackground2 | |||
|type1=Array | |||
|value1={1,1,1,0.5} | |||
|description=Background color to pulsate to from {{hl|colorSelectBackground}} of a selected entry. | |||
}} | |||
{{CT|attribute | |||
|name=colorSelectRight | |||
|type1=Array | |||
|value1={0,0,0,1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorShadow | |||
|type1=Array | |||
|value1={0,0,0,0.5} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=colorTextRight | |||
|type1=Array | |||
|value1={1,1,1,1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=columns | |||
|type1=Number | |||
|value1=1 | |||
|type2=Class | |||
|value2=class Columns | |||
{ | |||
class ColumnFavorite | |||
{ | |||
x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40) + (SafezoneX)"; | |||
w = "(2 * (((safezoneW / safezoneH) min 1.2) / 40))"; | |||
}; | |||
class ColumnServer | |||
{ | |||
x = "2.7 * (((safezoneW / safezoneH) min 1.2) / 40) + (SafezoneX)"; | |||
w = "(11 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))"; | |||
}; | |||
class ColumnType | |||
{ | |||
x = "safezoneX + (15 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))"; | |||
w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)"; | |||
}; | |||
class ColumnMission | |||
{ | |||
x = "safezoneX + (18.3 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))"; | |||
w = "(10.5 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))"; | |||
}; | |||
class ColumnState | |||
{ | |||
x = "safezoneX + (29.1 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.9*(safezoneW - ((safezoneW / safezoneH) min 1.2))"; | |||
w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)"; | |||
}; | |||
class ColumnPlayers | |||
{ | |||
x = "safezoneX + (32.4 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.9*(safezoneW - ((safezoneW / safezoneH) min 1.2))"; | |||
w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)"; | |||
}; | |||
class ColumnPing | |||
{ | |||
x = "safezoneX + (35.7 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.9*(safezoneW - ((safezoneW / safezoneH) min 1.2))"; | |||
w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)"; | |||
}; | |||
}; | |||
|description= | |||
}} | |||
=== D === | |||
{{CT|attribute | |||
|name=disabled | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaysinglemission\none_ca.paa" | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=disabledAI | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaymultiplayersetup\disabledai_ca.paa" | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=disabledCtrlColor | |||
|type1=Array | |||
|value1={1,1,1,0.5} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=disabledKeyColor | |||
|type1=Array | |||
|value1={0.4,0.4,0.4,1} | |||
|description=Color of the disabled key binding; default {0.3,0.3,0.3,1} - <u>Only relevant to config keys dialog (type = 5; idc = 102)</u> | |||
}} | |||
{{CT|attribute | |||
|name=DLCTemplate | |||
|type1=Class | |||
|value1=class DLCTemplate | |||
{ | |||
class controls | |||
{ | |||
class DlcBg | |||
{ | |||
idc = 101; | |||
text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayInventory\InventoryStripe_ca.paa"; | |||
color[] = {1,1,1,1}; | |||
x = 0; | |||
y = 0; | |||
w = "1.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; | |||
h = "1.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; | |||
}; | |||
class DlcIcon | |||
{ | |||
idc = 100; | |||
text = ""; | |||
color[] = {1,1,1,1}; | |||
x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)"; | |||
y = "0 * (((safezoneW / safezoneH) min 1.2) / 40)"; | |||
w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; | |||
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; | |||
}; | |||
}; | |||
}; | |||
|description= | |||
}} | |||
=== E === | |||
{{CT|attribute | |||
|name=enabled | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaysinglemission\done_ca.paa" | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=enabledAI | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaymultiplayersetup\enabledai_ca.paa" | |||
|description= | |||
}} | |||
=== I === | |||
{{CT|attribute | |||
|name=idcx | |||
|type1=Number | |||
|value1=974 | |||
|description=Used in the Arsenal display for unknown reason. | |||
}} | |||
{{CT|attribute | |||
|name=itemBackground | |||
|type1=Array | |||
|value1={1,1,1,0.1} | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=Items | |||
|type1=Class | |||
|value1=// Yes, this is a vanilla config :D | |||
class Items | |||
{ | |||
class Item0 | |||
{ | |||
text = "LOL"; | |||
textRight = "ROFL"; | |||
tooltip = "OMG"; | |||
picture = "\a3\Ui_f\data\Map\Markers\Military\warning_CA.paa"; | |||
pictureRight = "\a3\Ui_f\data\Map\Markers\Military\unknown_CA.paa"; | |||
color[] = {1,0,1,1}; | |||
colorRight[] = {1,1,0,1}; | |||
colorPicture[] = {0,1,1,1}; | |||
colorPictureSelected[] = {1,0,0,1}; | |||
colorPictureDisabled[] = {0,0,0,1}; | |||
colorPictureRight[] = {0,1,0,1}; | |||
colorPictureRightSelected[] = {0,0,1,1}; | |||
colorPictureRightDisabled[] = {0,0,0,1}; | |||
data = "WTF"; | |||
value = 42; | |||
default = 0; | |||
}; | |||
class AnotherItem | |||
{ | |||
text = "O RLY"; | |||
default = 1; | |||
}; | |||
}; | |||
|description= Default entries for the listbox columns. | |||
}} | |||
{{CT|attribute | |||
|name=itemSpacing | |||
|type1=Number | |||
|value1=0 | |||
|description= | |||
}} | |||
=== L === | |||
{{CT|attribute | |||
|name=ListScrollBar | |||
|type1=Class | |||
|value1=class ListScrollBar | |||
{ | |||
color[] = {1,1,1,1}; | |||
autoScrollEnabled = 1; | |||
colorActive[] = {1,1,1,1}; | |||
colorDisabled[] = {1,1,1,0.3}; | |||
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; | |||
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; | |||
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; | |||
border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; | |||
shadow = 0; | |||
scrollSpeed = 0.06; | |||
width = 0; | |||
height = 0; | |||
autoScrollSpeed = -1; | |||
autoScrollDelay = 5; | |||
autoScrollRewind = 0; | |||
}; | |||
|description=Prior to Arma 3 use ScrollBar. Scrollbars might not show if h and w properties of the ListBox are not 0. see also [[DialogControls-Sliders]] | |||
}} | |||
{{CT|attribute | |||
|name=locked | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_locked_ca.paa" | |||
|description= | |||
}} | |||
=== M === | |||
{{CT|attribute | |||
|name=mainCollumW | |||
|type1=Number | |||
|value1=0.4 | |||
|description=Width of the left column 0..1; default 0.4 - <u>Only relevant to config keys dialog (type = 5; idc = 102)</u> | |||
}} | |||
{{CT|attribute | |||
|name=maxHistoryDelay | |||
|type1=Number | |||
|value1=1 | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=mods | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_mods_ca.paa" | |||
|description= | |||
}} | |||
=== N === | |||
{{CT|attribute | |||
|name=none | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_none_ca.paa" | |||
|description= | |||
}} | |||
=== P === | |||
{{CT|attribute | |||
|name=password | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_password_ca.paa" | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=period | |||
|type1=Number | |||
|value1=1.2 | |||
|description=Controls how fast the color changes from colorXXX to colorXXX2. | |||
}} | |||
=== R === | |||
{{CT|attribute | |||
|name=rowHeight | |||
|type1=Number | |||
|value1=0 | |||
|type2=String | |||
|value2="1.75 * (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)" | |||
|description=The height of a single row. | |||
}} | |||
{{CT|attribute | |||
|name=rows | |||
|type1=Number | |||
|value1=8 | |||
|description= | |||
}} | |||
=== S === | |||
{{CT|attribute | |||
|name=secndCollumW | |||
|type1=Number | |||
|value1=0.6 | |||
|description=Width of the right column 0..1; default 0.6 - <u>Only relevant to config keys dialog (type = 5; idc = 102)</u> | |||
}} | |||
{{CT|attribute | |||
|name=serverDislike | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\mp_serverdislike_ca.paa" | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=serverEmpty | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\mp_serverempty_ca.paa" | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=serverLike | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\mp_serverlike_ca.paa" | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=sizeEx2 | |||
|type1=String | |||
|value1="0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)" | |||
|description= | |||
}} | |||
{{CT|attribute | |||
|name=soundSelect | |||
|type1=Array | |||
|value1={"\A3\ui_f\data\sound\RscListbox\soundSelect",0.09,1} | |||
|description=Sound played when an entry is selected. | |||
}} | |||
{{CT|attribute | |||
|name=star | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_star_ca.paa" | |||
|description= | |||
}} | |||
=== V === | |||
{{CT|attribute | |||
|name=version | |||
|type1=String | |||
|value1="a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_version_ca.paa" | |||
|description= | |||
}} | |||
=== W === | |||
{{CT|attribute | |||
|name=wholeHeight | |||
|type1=Number | |||
|value1=0.21 | |||
|description= | |||
}} | |||
{{CT|abc end}} | |||
{{CT|examples}} | |||
=== RscListBox === | |||
<syntaxhighlight lang="cpp"> | |||
class RscListBox | |||
{ | |||
deletable = 0; | |||
fade = 0; | |||
access = 0; | |||
type = CT_LISTBOX; | |||
rowHeight = 0; | |||
colorText[] = {1,1,1,1}; | |||
colorDisabled[] = {1,1,1,0.25}; | |||
colorScrollbar[] = {1,0,0,0}; | |||
colorSelect[] = {0,0,0,1}; | |||
colorSelect2[] = {0,0,0,1}; | |||
colorSelectBackground[] = {0.95,0.95,0.95,1}; | |||
colorSelectBackground2[] = {1,1,1,0.5}; | |||
colorBackground[] = {0,0,0,0.3}; | |||
soundSelect[] = | |||
{ | |||
"\A3\ui_f\data\sound\RscListbox\soundSelect", | |||
0.09, | |||
1 | |||
}; | |||
autoScrollSpeed = -1; | |||
autoScrollDelay = 5; | |||
autoScrollRewind = 0; | |||
arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; | |||
arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; | |||
colorPicture[] = {1,1,1,1}; | |||
colorPictureSelected[] = {1,1,1,1}; | |||
colorPictureDisabled[] = {1,1,1,0.25}; | |||
colorPictureRight[] = {1,1,1,1}; | |||
colorPictureRightSelected[] = {1,1,1,1}; | |||
colorPictureRightDisabled[] = {1,1,1,0.25}; | |||
colorTextRight[] = {1,1,1,1}; | |||
colorSelectRight[] = {0,0,0,1}; | |||
colorSelect2Right[] = {0,0,0,1}; | |||
tooltipColorText[] = {1,1,1,1}; | |||
tooltipColorBox[] = {1,1,1,1}; | |||
tooltipColorShade[] = {0,0,0,0.65}; | |||
class ListScrollBar : ScrollBar | |||
{ | |||
color[] = {1,1,1,1}; | |||
autoScrollEnabled = 1; | |||
}; | |||
x = 0; | |||
y = 0; | |||
w = 0.3; | |||
h = 0.3; | |||
style = LB_TEXTURES; | |||
font = "RobotoCondensed"; | |||
sizeEx = GUI_TEXT_SIZE_MEDIUM; | |||
shadow = 0; | |||
colorShadow[] = {0,0,0,0.5}; | |||
period = 1.2; | |||
maxHistoryDelay = 1; | |||
}; | |||
</syntaxhighlight> | |||
=== Scripting Example === | |||
{| class="wikitable" | |||
|- | |||
! Code !! Picture | |||
|- | |||
| | |||
<sqf> | |||
{ | |||
private _ctrl = _x; | |||
{ | |||
_ctrl lbAdd getText (_x >> "displayName"); | |||
_ctrl lbSetPicture [_foreachindex,getText (_x >> "texture")]; | |||
_ctrl lbSetTooltip [_foreachindex,getText (_x >> "displayName")]; | |||
} forEach ("true" configClasses (configFile >> "CfgRanks")); | |||
_ctrl lbSetCurSel 0; | |||
</sqf> | |||
| [[File:WuChaoRen_lbCommand001.png|170px]] | |||
|- | |||
| | |||
<sqf notrim> | |||
private _current = lbCurSel _ctrl; | |||
_ctrl lbSetData [_current,"hi"]; | |||
private _data = _ctrl lbData _current; | |||
private _pic = _ctrl lbPicture _current; | |||
_ctrl lbSetValue [_current, 1]; | |||
private _value = _ctrl lbValue _current; | |||
private _size = lbSize _ctrl; | |||
private _color = _ctrl lbColor _current; | |||
_ctrl lbSetColor [_current, [(_color select 0) / 2, (_color select 1) / 4, 0, 1]]; | |||
</sqf> | |||
| [[File:WuChaoRen_lbColor.png|170px]] | |||
|- | |||
| | |||
<sqf notrim> | |||
lbSort [_ctrl, "DESC"]; | |||
lbSortByValue _ctrl; | |||
</sqf> | |||
| [[File:WuChaoRen_lbSortByValue.png|170px]] | |||
|- | |||
| | |||
<sqf notrim> | |||
if (_ctrl lbIsSelected _current) then | |||
{ | |||
_ctrl lbDelete _current; | |||
lbClear _ctrl; | |||
}; | |||
} forEach [_CT_COMBO, _CT_LISTBOX, _CT_XLISTBOX, _CT_XCOMBO]; | |||
</sqf> | |||
| [[File:WuChaoRen_lbDelete.png|170px]] [[File:WuChaoRen_lbClear.png|170px]] | |||
|} | |||
[[CT_LISTBOX]] command family can be used with [[CT_COMBO]], [[CT_LISTBOX]], [[CT_XLISTBOX]] and [[CT_XCOMBO]]. |
Latest revision as of 11:39, 8 March 2024
Control Types / MACRO (TYPE VALUE) | |
---|---|
Text/Image/Video |
CT_STATIC (0) | CT_EDIT (2) | CT_HTML (9) | CT_STRUCTURED_TEXT (13) |
Buttons |
CT_BUTTON (1) | CT_ACTIVETEXT (11) | CT_SHORTCUTBUTTON (16) | CT_CHECKBOX (77) | CT_XBUTTON (41) |
Lists |
CT_COMBO (4) | CT_TOOLBOX (6) | CT_CHECKBOXES (7) | CT_TREE (12) | CT_CONTROLS_TABLE (19) | CT_XCOMBO (44) | CT_LISTBOX (5) | CT_LISTNBOX (102) | CT_LISTNBOX_CHECKABLE (104) | CT_XLISTBOX (45) |
3D Objects |
CT_OBJECT (80) | CT_OBJECT_ZOOM (81) | CT_OBJECT_CONTAINER (82) | CT_OBJECT_CONT_ANIM (83) |
Maps |
CT_MAP (100) | CT_MAP_MAIN (101) |
Meta |
CT_SLIDER (3) | CT_XSLIDER (43) | CT_PROGRESS (8) | CT_CONTROLS_GROUP (15) | CT_WEBBROWSER (106) | CT_EXTENSION (107) |
Menu |
CT_CONTEXT_MENU (14) | CT_MENU (46) | CT_MENU_STRIP (47) |
Unknown |
CT_STATIC_SKEW (10) | CT_HITZONES (17) | CT_VEHICLETOGGLES (18) | CT_XKEYDESC (40) | CT_ANIMATED_TEXTURE (45) | CT_LINEBREAK (98) | CT_USER (99) | CT_ITEMSLOT (103) | CT_VEHICLE_DIRECTION (105) |
Introduction
The listbox displays a list of items. With ST_MULTI it is possible to select multiple entries. For listBoxes, the usage of 'ST_' style constants (ST_MULTI & ST_TITLE_BAR) behave differently than expected for other controls, so use the corresponding 'LB_' (LB_TEXTURES & LB_MULTI) list box style variants instead.
style = LB_TEXTURES; // solid scrollbar
style = LB_MULTI; // multiple item selection
Related commands & functions
Related User Interface Eventhandlers
Alphabetical Order
#define CT_LISTBOX 5
A
active
- Type
- String
- Description
- n/a
active = "a3\ui_f\data\gui\rsc\rscdisplaysinglemission\done_ca.paa";
addons
- Type
- String
- Description
- n/a
addons = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_addons_ca.paa";
allowedFilePatching
- Type
- String
- Description
- n/a
allowedFilePatching = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_version_ca.paa";
arrowEmpty
- Type
- String
- Description
- n/a
arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
arrowFull
- Type
- String
- Description
- n/a
arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
autoScrollDelay
- Type
- Number
- Description
- n/a
autoScrollDelay = 5;
autoScrollRewind
- Type
- Number
- Description
- n/a
autoScrollRewind = 0;
autoScrollSpeed
- Type
- Number
- Description
- n/a
autoScrollSpeed = -1;
C
canDrag
- Type
- Number
- Description
- Allow dragging and dropping listbox items similar to how the inventory works.
canDrag = 0;
collisionColor
- Type
- Array
- Description
- Color of the collision key binding; default {1,0,0,1} - Only relevant to config keys dialog (type = 5; idc = 102)
collisionColor[] = {"(profilenamespace getvariable ['IGUI_ERROR_RGB_R',0.8])","(profilenamespace getvariable ['IGUI_ERROR_RGB_G',0.0])","(profilenamespace getvariable ['IGUI_ERROR_RGB_B',0.0])",1};
collisionColorFirstKey
- Type
- Array
- Description
- n/a
collisionColorFirstKey[] = {"(profilenamespace getvariable ['IGUI_WARNING_RGB_R',0.8])","(profilenamespace getvariable ['IGUI_WARNING_RGB_G',0.5])","(profilenamespace getvariable ['IGUI_WARNING_RGB_B',0.0])",1};
color
- Type
- Array
- Description
- n/a
color[] = {0.95,0.95,0.95,1};
colorAI
- Type
- Array
- Description
- n/a
colorAI[] = {1,0,0,1};
colorNobody
- Type
- Array
- Description
- n/a
colorNobody[] = {1,1,1,0.25};
colorPicture
- Type
- Array
- Description
- n/a
colorPicture[] = {1,1,1,1};
colorPictureDisabled
- Type
- Array
- Description
- n/a
colorPictureDisabled[] = {1,1,1,0.25};
colorPictureRight
- Type
- Array
- Description
- n/a
colorPictureRight[] = {1,1,1,1};
colorPictureRightDisabled
- Type
- Array
- Description
- n/a
colorPictureRightDisabled[] = {1,1,1,0.25};
colorPictureRightSelected
- Type
- Array
- Description
- n/a
colorPictureRightSelected[] = {1,1,1,1};
colorPictureSelected
- Type
- Array
- Description
- n/a
colorPictureSelected[] = {1,1,1,1};
colorPingBad
- Type
- Array
- Description
- n/a
colorPingBad[] = {1,0,0,1};
colorPingGood
- Type
- Array
- Description
- n/a
colorPingGood[] = {0,1,0,1};
colorPingPoor
- Type
- Array
- Description
- n/a
colorPingPoor[] = {1,0.6,0,1};
colorPingUnknown
- Type
- Array
- Description
- n/a
colorPingUnknown[] = {0.4,0.4,0.4,1};
colorPlayer
- Type
- Array
- Description
- n/a
colorPlayer[] = {1,1,0,1};
colorScrollbar
- Type
- Array
- Description
- n/a
colorScrollbar[] = {1,0,0,0};
colorSelect
- Type
- Array
- Description
- Text color of a selected item.
colorSelect[] = {1,1,1,1};
colorSelect2
- Type
- Array
- Description
- Text color to pulsate to from colorSelect.
colorSelect2[] = {0,0,0,1};
colorSelect2Right
- Type
- Array
- Description
- n/a
colorSelect2Right[] = {0,0,0,1};
colorSelectBackground
- Type
- Array
- Description
- Background color of a selected entry.
colorSelectBackground[] = {0.95,0.95,0.95,1};
colorSelectBackground2
- Type
- Array
- Description
- Background color to pulsate to from colorSelectBackground of a selected entry.
colorSelectBackground2[] = {1,1,1,0.5};
colorSelectRight
- Type
- Array
- Description
- n/a
colorSelectRight[] = {0,0,0,1};
colorShadow
- Type
- Array
- Description
- n/a
colorShadow[] = {0,0,0,0.5};
colorTextRight
- Type
- Array
- Description
- n/a
colorTextRight[] = {1,1,1,1};
columns
Number example:
columns = 1;
Class example:
class Columns
{
class ColumnFavorite
{
x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40) + (SafezoneX)";
w = "(2 * (((safezoneW / safezoneH) min 1.2) / 40))";
};
class ColumnServer
{
x = "2.7 * (((safezoneW / safezoneH) min 1.2) / 40) + (SafezoneX)";
w = "(11 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
};
class ColumnType
{
x = "safezoneX + (15 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)";
};
class ColumnMission
{
x = "safezoneX + (18.3 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
w = "(10.5 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
};
class ColumnState
{
x = "safezoneX + (29.1 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.9*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)";
};
class ColumnPlayers
{
x = "safezoneX + (32.4 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.9*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)";
};
class ColumnPing
{
x = "safezoneX + (35.7 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.9*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)";
};
};
D
disabled
- Type
- String
- Description
- n/a
disabled = "a3\ui_f\data\gui\rsc\rscdisplaysinglemission\none_ca.paa";
disabledAI
- Type
- String
- Description
- n/a
disabledAI = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayersetup\disabledai_ca.paa";
disabledCtrlColor
- Type
- Array
- Description
- n/a
disabledCtrlColor[] = {1,1,1,0.5};
disabledKeyColor
- Type
- Array
- Description
- Color of the disabled key binding; default {0.3,0.3,0.3,1} - Only relevant to config keys dialog (type = 5; idc = 102)
disabledKeyColor[] = {0.4,0.4,0.4,1};
DLCTemplate
- Type
- Class
- Description
- n/a
class DLCTemplate
{
class controls
{
class DlcBg
{
idc = 101;
text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayInventory\InventoryStripe_ca.paa";
color[] = {1,1,1,1};
x = 0;
y = 0;
w = "1.8 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class DlcIcon
{
idc = 100;
text = "";
color[] = {1,1,1,1};
x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "0 * (((safezoneW / safezoneH) min 1.2) / 40)";
w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
};
};
E
enabled
- Type
- String
- Description
- n/a
enabled = "a3\ui_f\data\gui\rsc\rscdisplaysinglemission\done_ca.paa";
enabledAI
- Type
- String
- Description
- n/a
enabledAI = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayersetup\enabledai_ca.paa";
I
idcx
- Type
- Number
- Description
- Used in the Arsenal display for unknown reason.
idcx = 974;
itemBackground
- Type
- Array
- Description
- n/a
itemBackground[] = {1,1,1,0.1};
Items
- Type
- Class
- Description
- Default entries for the listbox columns.
// Yes, this is a vanilla config :D
class Items
{
class Item0
{
text = "LOL";
textRight = "ROFL";
tooltip = "OMG";
picture = "\a3\Ui_f\data\Map\Markers\Military\warning_CA.paa";
pictureRight = "\a3\Ui_f\data\Map\Markers\Military\unknown_CA.paa";
color[] = {1,0,1,1};
colorRight[] = {1,1,0,1};
colorPicture[] = {0,1,1,1};
colorPictureSelected[] = {1,0,0,1};
colorPictureDisabled[] = {0,0,0,1};
colorPictureRight[] = {0,1,0,1};
colorPictureRightSelected[] = {0,0,1,1};
colorPictureRightDisabled[] = {0,0,0,1};
data = "WTF";
value = 42;
default = 0;
};
class AnotherItem
{
text = "O RLY";
default = 1;
};
};
itemSpacing
- Type
- Number
- Description
- n/a
itemSpacing = 0;
L
ListScrollBar
- Type
- Class
- Description
- Prior to Arma 3 use ScrollBar. Scrollbars might not show if h and w properties of the ListBox are not 0. see also DialogControls-Sliders
class ListScrollBar
{
color[] = {1,1,1,1};
autoScrollEnabled = 1;
colorActive[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.3};
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
shadow = 0;
scrollSpeed = 0.06;
width = 0;
height = 0;
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
};
locked
- Type
- String
- Description
- n/a
locked = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_locked_ca.paa";
M
mainCollumW
- Type
- Number
- Description
- Width of the left column 0..1; default 0.4 - Only relevant to config keys dialog (type = 5; idc = 102)
mainCollumW = 0.4;
maxHistoryDelay
- Type
- Number
- Description
- n/a
maxHistoryDelay = 1;
mods
- Type
- String
- Description
- n/a
mods = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_mods_ca.paa";
N
none
- Type
- String
- Description
- n/a
none = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_none_ca.paa";
P
password
- Type
- String
- Description
- n/a
password = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_password_ca.paa";
period
- Type
- Number
- Description
- Controls how fast the color changes from colorXXX to colorXXX2.
period = 1.2;
R
rowHeight
Number example:
rowHeight = 0;
String example:
rowHeight = "1.75 * (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
rows
- Type
- Number
- Description
- n/a
rows = 8;
S
secndCollumW
- Type
- Number
- Description
- Width of the right column 0..1; default 0.6 - Only relevant to config keys dialog (type = 5; idc = 102)
secndCollumW = 0.6;
serverDislike
- Type
- String
- Description
- n/a
serverDislike = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\mp_serverdislike_ca.paa";
serverEmpty
- Type
- String
- Description
- n/a
serverEmpty = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\mp_serverempty_ca.paa";
serverLike
- Type
- String
- Description
- n/a
serverLike = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\mp_serverlike_ca.paa";
sizeEx2
- Type
- String
- Description
- n/a
sizeEx2 = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
soundSelect
- Type
- Array
- Description
- Sound played when an entry is selected.
soundSelect[] = {"\A3\ui_f\data\sound\RscListbox\soundSelect",0.09,1};
star
- Type
- String
- Description
- n/a
star = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_star_ca.paa";
V
version
- Type
- String
- Description
- n/a
version = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_version_ca.paa";
W
wholeHeight
- Type
- Number
- Description
- n/a
wholeHeight = 0.21;
Default Classes
RscListBox
class RscListBox
{
deletable = 0;
fade = 0;
access = 0;
type = CT_LISTBOX;
rowHeight = 0;
colorText[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.25};
colorScrollbar[] = {1,0,0,0};
colorSelect[] = {0,0,0,1};
colorSelect2[] = {0,0,0,1};
colorSelectBackground[] = {0.95,0.95,0.95,1};
colorSelectBackground2[] = {1,1,1,0.5};
colorBackground[] = {0,0,0,0.3};
soundSelect[] =
{
"\A3\ui_f\data\sound\RscListbox\soundSelect",
0.09,
1
};
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
colorPicture[] = {1,1,1,1};
colorPictureSelected[] = {1,1,1,1};
colorPictureDisabled[] = {1,1,1,0.25};
colorPictureRight[] = {1,1,1,1};
colorPictureRightSelected[] = {1,1,1,1};
colorPictureRightDisabled[] = {1,1,1,0.25};
colorTextRight[] = {1,1,1,1};
colorSelectRight[] = {0,0,0,1};
colorSelect2Right[] = {0,0,0,1};
tooltipColorText[] = {1,1,1,1};
tooltipColorBox[] = {1,1,1,1};
tooltipColorShade[] = {0,0,0,0.65};
class ListScrollBar : ScrollBar
{
color[] = {1,1,1,1};
autoScrollEnabled = 1;
};
x = 0;
y = 0;
w = 0.3;
h = 0.3;
style = LB_TEXTURES;
font = "RobotoCondensed";
sizeEx = GUI_TEXT_SIZE_MEDIUM;
shadow = 0;
colorShadow[] = {0,0,0,0.5};
period = 1.2;
maxHistoryDelay = 1;
};
Scripting Example
Code | Picture |
---|---|
{
private _ctrl = _x;
{
_ctrl lbAdd getText (_x >> "displayName");
_ctrl lbSetPicture [_foreachindex,getText (_x >> "texture")];
_ctrl lbSetTooltip [_foreachindex,getText (_x >> "displayName")];
} forEach ("true" configClasses (configFile >> "CfgRanks"));
_ctrl lbSetCurSel 0; |
|
private _current = lbCurSel _ctrl;
_ctrl lbSetData [_current,"hi"];
private _data = _ctrl lbData _current;
private _pic = _ctrl lbPicture _current;
_ctrl lbSetValue [_current, 1];
private _value = _ctrl lbValue _current;
private _size = lbSize _ctrl;
private _color = _ctrl lbColor _current;
_ctrl lbSetColor [_current, [(_color select 0) / 2, (_color select 1) / 4, 0, 1]];
|
|
|
|
CT_LISTBOX command family can be used with CT_COMBO, CT_LISTBOX, CT_XLISTBOX and CT_XCOMBO.