CT_LISTBOX should also support engine search similar to CT_TREE.
- It should search the the text of listbox entries (same as CT_TREE)
Engine search should be used if
idcSearch
property is define in config of the listbox
CT_LISTBOX should also support engine search similar to CT_TREE.
Engine search should be used if
idcSearch
property is define in config of the listbox
Example config:
class Dialog { idd = -1; class Controls { class _CT_EDIT { idc = 1337; text = ""; tooltip = "Type to search"; }; class _CT_LISTBOX { idc = 200; idcSearch = 1337; }; }; };
Due to how engine filtering works (removing items from the list, and storing them elsewhere internally) it can cause issues when you use script commands to retrieve the current values in the listbox..
and can also cause issues when you add items while a filter is active.
But it should all be same as with TreeView.
Alternatively I could leave the items in the list, but only disable rendering if they are filtered away.
But handling the scrollbar will be annoying...
Now where do I get a example listbox to test with from :U
I don't know UI config stuff :(
I could modify ACE arsenal I guess
[] spawn { disableSerialization; _display = findDisplay 313 createDisplay "RscDisplayEmpty"; _edit = _display ctrlCreate ["RscEdit", 645]; _edit ctrlSetPosition [0,0,1,0.04]; _edit ctrlSetBackgroundColor [0,0,0,1]; _edit ctrlCommit 0; _lb = _display ctrlCreate ["RscListBox", -1]; _lb ctrlSetFont "EtelkaMonospacePro"; _lb ctrlSetFontHeight 0.03; _lb ctrlSetPosition [0,0.06,1,0.94]; _lb ctrlSetBackgroundColor [0,0,0,1]; _lb ctrlCommit 0; _classes = "true" configClasses (configFile >> "CfgVehicles"); for "_i" from 0 to 5000 do { _lb lbAdd configName selectRandom _classes; }; lbSort _lb; };
Change Idc of edit control to whatever is the idcSearch and excute it in Eden Editor
I fear that just hiding the entries causes too many issues.
So will have to choose the variant of temporarily removing filtered out elements..
Which for listbox will be quite a bit more expensive than tree, but probably still better than scripted filtering ofc.