PureLVSORT library : sorting ListIconGadgets (and more)
Moderator: gnozal
Works perfectly. egrid can now track the sort and can notify applications when the sort is complete, thus enabling them to reinstate the selection box etc.gnozal wrote:Update
Changes :
- improved eGrid compatibility
- added unicode / unicode+threadsafe versions
Thanks Gnozal.
I may look like a mule, but I'm not a complete ass.
A question for either gnozal or srod about tracking the sort. For lengthy sorts, is it possible to show the user a progress bar indication of the sort progress?srod wrote:Works perfectly. egrid can now track the sort and can notify applications when the sort is complete, thus enabling them to reinstate the selection box etc.
Thanks Gnozal.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
AFAIK no.mskuma wrote:A question for either gnozal or srod about tracking the sort. For lengthy sorts, is it possible to show the user a progress bar indication of the sort progress?
I use the #LVM_SORTITEMS message, and in the sorting callback (pointed by pfnCompare) there is no way to know the progression.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
It's probably some king of quicksort (?), but I don't know if there is a way to predict the number of comparisons needed : if the list is already sorted, i = few, if the list is in random order, i = max. And tracking the progression could slow it down.srod wrote:I was thinking of some kind of estimate. You can obviously keep a track of how many comparisons are made - with the absolute max being n(n-1)/2 etc. Course, I do not know which sort algorithm Windows employs here.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Regarding my earlier posting about giving the user some feedback (e.g. progress) during a long sort, I'm resorting to using a 'cheap way' i.e. changing a status bar icon. I thought maybe I could animate it with the aid of a timer (timeSetEvent) triggered to start and end with egrid messages, but it seems no window updates are available or done during the sort (which is understandable) because I can't see any animation (only the first frame is shown). I was wondering if you can suggest another way to achieve an animated effect during a long sort, otherwise I think perhaps an ok way to give feedback is to do a popup or maybe better still, change the statusbar icon using egrid messages. If any other suggestions, I'd be glad to hear. Thanks.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Maybe you could try to animate the icon in an thread ?mskuma wrote:Regarding my earlier posting about giving the user some feedback (e.g. progress) during a long sort, I'm resorting to using a 'cheap way' i.e. changing a status bar icon. I thought maybe I could animate it with the aid of a timer (timeSetEvent) triggered to start and end with egrid messages, but it seems no window updates are available or done during the sort (which is understandable) because I can't see any animation (only the first frame is shown). I was wondering if you can suggest another way to achieve an animated effect during a long sort, otherwise I think perhaps an ok way to give feedback is to do a popup or maybe better still, change the statusbar icon using egrid messages. If any other suggestions, I'd be glad to hear. Thanks.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).