Simple find in big lists (Shortcuts/commands, Toolbar etc.)

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, xnview

Post Reply
User avatar
Posts: 1579
Joined: Wed Aug 16, 2006 6:31 am

Simple find in big lists (Shortcuts/commands, Toolbar etc.)

Post by m.Th. » Fri Jan 24, 2014 10:16 am

The program has and will have more big lists of items (ok, some of them are trees). Some examples: The big list from Settings | Shortcuts (how do I find a certain command to assign a shortcut?), the big list from Settings | Toolbar (how do I find a certain button?), Auto Correct (in the future), Bookmarks manager (in the future) aso. Having the lists sorted really isn't enough.

Of course, we can implement for all of them the Auto Complete engine but I think that it could be rather complicated. If Pierre thinks that it is simple to do it, then it will be the best thing.

But if it is not, then we can live with a simple search view like this one:
Auto-Correct Tooling.png
Auto-Correct Tooling.png (15.04 KiB) Viewed 350 times
...which will do a simple case INsensitive(!!!) search on the grids, line by line till it will found something.

The untested, unoptimized pseudo-code will be something like:

Code: Select all

function DoSearch(aFromRow: integer; myText: string; myGrid: TGrid): boolean;
	for y:=aFromRow to myGrid.RowCount-1 do
		for x:=0 to myGrid.ColCount-1 do
			if Pos(UpperCase(myText), UpperCase(myGrid.Cells[x,y]))>0 then //found!!
				Break; //out from cycle!
		if Result then
			Break; //out from y cycle also!
	if not Result then
		ShowMessage('Text not found!');
Of course, for Find First the call will be with aFromRow = 0 and for FindNext will be with CurrentRow+1.

This could be very easy a shared code and view among many lists in our program: list of Toolbar buttons, list of the Shortcuts, Auto-Correct list aso.
m. Th.

The Ascetic Experience - The best photos and texts from Holy Mountain (Athos)

- Dark Themed XnViewMP 0.90 64bit & XnView 2.00 x64 on Win7 x64 -

Post Reply