0.61: Sorting list boxes items

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, helmut, xnview

User avatar
Infernoweb
Posts: 8
Joined: Wed Aug 28, 2013 7:17 pm
Location: France

0.61: Sorting list boxes items

Post by Infernoweb »

Hi !

Please, could it be possible (in a futur version) to alphabetically order the items in list boxes from IPTC-IIM/XMP window ?

It would be easier to find existing keyword or object names (i.e.)

Any way, thx for your great software !
You do not have the required permissions to view the files attached to this post.
Regards,

Eric
User avatar
m.Th.
XnThusiast
Posts: 1610
Joined: Wed Aug 16, 2006 6:31 am

Re: [0.61] Sorting list boxes items

Post by m.Th. »

Hmmm.... Yes... mmmhmm... Ok... Well... meh...
Image

...Of course it is pretty easy to sort them:

1. Setup a case insensitive index on Tags.Label field: Create Index Tags_Label_Idx on Tags(Label) collate NoCase;
2. Fill the lists by using the following SQL: Select Label from Tags order by Label collate nocase;

Of course, this feature is useful to some degree...

...But this will work only for a rather small number of keywords / categories, number which will be easy surpassed, especially if one does landscape and/or portraiture and/or event (weddings, news report etc.) and/or sports (and/or etc.) photography.

The real solution IMHO is to have a real auto-complete engine with partial match anywhere as described here: http://newsgroup.xnview.com/viewtopic.php?f=60&t=28375
m. Th.

- Dark Themed XnViewMP 1.0 64bit on Win10 x64 -
User avatar
Infernoweb
Posts: 8
Joined: Wed Aug 28, 2013 7:17 pm
Location: France

Re: [0.61] Sorting list boxes items

Post by Infernoweb »

Hi m.Th.,

Auto-completion is already active for IPTC keywords list box, isn't it?
But, sometimes, it could be better to use the drop-down list. I.e : looking for existing similar keywords.

Any way, a sorted items list is nicer (cosmetically) than all of them in disorder. :wink:
Regards,

Eric
User avatar
m.Th.
XnThusiast
Posts: 1610
Joined: Wed Aug 16, 2006 6:31 am

Re: [0.61] Sorting list boxes items

Post by m.Th. »

Infernoweb wrote:Hi m.Th.,

Auto-completion is already active for IPTC keywords list box, isn't it?
You're speaking about the drop-down list which you posted. Ie. the history drop-down list. Which by its very nature has only a few number of keywords in it. Hence the auto-completion which you mention (a standard feature of any GUI framework nowadays btw) has a very limited impact. I'm speaking about a global search on the entire keywords table. And to make things worse (in our case) the drop-down auto-complete has a case-sensitive 'partial match at the beginning' algorithm while we need a case-INsensitive 'partial match anywhere' search on the entire collection of keywords, as I said, - it is a standard feature to quickly find the desired keyword in order to keep the duplication of human meaning in keywords at minimum (IOW the phenomenon in which several keywords while (slightly) different cover the same human meaning - usually this is the case with the synonyms but not only).
But, sometimes, it could be better to use the drop-down list. I.e : looking for existing similar keywords.

Any way, a sorted items list is nicer (cosmetically) than all of them in disorder. :wink:
...hehehe... I certainly understand what you're saying. :)

Also as you saw above I gave the solution for you - in fact it is a small improvement - because in the keyword lists from that form Pierre already provides us the keywords sorted in each list which represent a tree level.

...However, unfortunately, I don't think that what you want is possible with ease.

This is because the drop-down list is a HISTORY drop-down list.

Usually this is implemented like this:

When the user presses Enter (or whatever triggering button):

Code: Select all

myDropDown.Items.Insert(0, myDropDown.Text); //insert the text of the drop down list in the front of the list.
if myDropDown.Items.Count > MAX_ITEMS then //if the items are more than a maximum (usually around of 20 or so)
   myDropDown.Items.Delete(myDropDown.Items.Count-1); //delete the last item. "-1" is added because, usually, these lists/arrays are 0 based
As you see above, in order to keep his history trail in certain limits he needs to delete the last item because the last item in list is the oldest one. Sorting the items from the dd-list blows away the entire algorithm (for the programmer) and the history paradigm for the user.

Of course if one really wants to have the items sorted this is possible by keeping the (real) history list outside of the drop-down and after each history update, sort the items and (re)assign the entire drop-down with the newly sorted items.

ISTM that a much more solid solution for your needs is to have keyword sets / favorites (which are sorted by default) like we described a long time ago (already) here: http://newsgroup.xnview.com/viewtopic.php?f=60&t=27999
m. Th.

- Dark Themed XnViewMP 1.0 64bit on Win10 x64 -
User avatar
xnview
Author of XnView
Posts: 38817
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: [0.61] Sorting list boxes items

Post by xnview »

Right, i'll sort them
Pierre.
User avatar
xnview
Author of XnView
Posts: 38817
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 0.61: Sorting list boxes items

Post by xnview »

Pierre.