PureLVSORT library : sorting ListIconGadgets (and more)

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update

Changes :
- improved eGrid compatibility
- added unicode / unicode+threadsafe versions
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

gnozal wrote:Update

Changes :
- improved eGrid compatibility
- added unicode / unicode+threadsafe versions
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.
I may look like a mule, but I'm not a complete ass.
rw
User
User
Posts: 27
Joined: Mon Sep 04, 2006 9:55 pm

Post by rw »

Deleted


rw
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

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.
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
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Yes, but it would most likely have to come from the sort callback proc. :)
I may look like a mule, but I'm not a complete ass.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

Yeah I could see that - ideally I was hoping to not have to wipe out what's already working well there. Thanks for the reply. Maybe I might just put something up there between the start & end sort message.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

No I mean the sort callback proc within PureLVSort.
I may look like a mule, but I'm not a complete ass.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

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?
AFAIK no.
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).
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

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. :)
I may look like a mule, but I'm not a complete ass.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

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. :)
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.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Fair enough. :)
I may look like a mule, but I'm not a complete ass.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

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.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

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.
Maybe you could try to animate the icon in an thread ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

gnozal wrote:Maybe you could try to animate the icon in an thread ?
Hmm.. I thought using timeSetEvent runs in its own thread.. maybe that's just the timer and not the function it calls.. thanks.
Post Reply