Page MenuHomeFeedback Tracker

Add support for engine search to CT_LISTBOX (Optionally also CT_LISTNBOX)
Assigned, NormalPublic

Description

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

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Config
Steps To Reproduce

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;
		};
	};
};

Event Timeline

R3vo created this task.Nov 25 2020, 11:35 AM
R3vo updated the task description. (Show Details)
7erra added a subscriber: 7erra.Nov 25 2020, 11:45 AM
dedmen claimed this task.Nov 25 2020, 12:09 PM
dedmen changed the task status from New to Assigned.
dedmen set Ref Ticket to AIII-53607.
dedmen added a comment.EditedThu, Jan 7, 11:49 AM

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

R3vo added a comment.EditedThu, Jan 7, 2:51 PM

@dedmen

[] 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.