PureLVSORT library : sorting ListIconGadgets (and more)
Moderator: gnozal
Re: PureLVSORT library : sorting ListIconGadgets (and more)
Thanks for pointing that out, gnozal!
I already use Demivec´s StableMergeSort routine for sorting the listview... http://www.purebasic.fr/english/viewtop ... 12&t=41068
cheers, chi
I already use Demivec´s StableMergeSort routine for sorting the listview... http://www.purebasic.fr/english/viewtop ... 12&t=41068
cheers, chi
Et cetera is my worst enemy
Re: PureLVSORT library : sorting ListIconGadgets (and more)
Is it possible to use the standard system sort icons for #PureLVSORT_ShowClickedHeader_Icon?
Example: http://www.thebitguru.com/site_media/up ... g_Icon.jpg
I just saw there is the PureLVSORT_SetUserIcons() function. Could you make it possible to assign the system icons here, maybe via a constant or just by default?
Example: http://www.thebitguru.com/site_media/up ... g_Icon.jpg
I just saw there is the PureLVSORT_SetUserIcons() function. Could you make it possible to assign the system icons here, maybe via a constant or just by default?
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureLVSORT library : sorting ListIconGadgets (and more)
I don't know about system icons for ListView headers.c4s wrote:I just saw there is the PureLVSORT_SetUserIcons() function. Could you make it possible to assign the system icons here, maybe via a constant or just by default?
How do you get them ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureLVSORT library : sorting ListIconGadgets (and more)
I'm not fully sure either but I found this article about it:gnozal wrote:I don't know about system icons for ListView headers.
How do you get them ?
http://www.thebitguru.com/articles/16-H ... %20in%20C#
It is about using the HDITEM structure with HDF_SORTDOWN and HDF_SORTUP flags:
http://msdn.microsoft.com/en-us/library/ms671802.aspx
Can you do something with this?
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureLVSORT library : sorting ListIconGadgets (and more)
I use this in PureLVSORT.c4s wrote:I'm not fully sure either but I found this article about it:
http://www.thebitguru.com/articles/16-H ... %20in%20C#It is about using the HDITEM structure with HDF_SORTDOWN and HDF_SORTUP flags:
http://msdn.microsoft.com/en-us/library/ms671802.aspx
Can you do something with this?
I still have to provide an image : I can't use #HDF_SORTDOWN/#HDF_SORTUP to draw the 'system' icons because they are only available for Windows >= XP.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureLVSORT library : sorting ListIconGadgets (and more)
Seriously who is still using something under XP? Or which developer focuses on windows 98?gnozal wrote:I use this in PureLVSORT.
I still have to provide an image : I can't use #HDF_SORTDOWN/#HDF_SORTUP to draw the 'system' icons because they are only available for Windows >= XP.
Anyway that's why meant that you could add this as on optional flag. Or you could check if XP or higher is available and otherwise still draw these internal ones...I hope I was able to convince you.

If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureLVSORT library : sorting ListIconGadgets (and more)
I may release a new version with an extra flag, when I have some more time.c4s wrote:Anyway that's why meant that you could add this as on optional flag. Or you could check if XP or higher is available and otherwise still draw these internal ones...I hope I was able to convince you.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureLVSORT library : sorting ListIconGadgets (and more)
Thank you gnozal.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureLVSORT library : sorting ListIconGadgets (and more)
I just had a look, it should be easy (not too much code to change).c4s wrote:Thank you gnozal.
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:
Re: PureLVSORT library : sorting ListIconGadgets (and more)
Update Version 4.48 (PB4.5x version only)
Changes :
- new function : PureLVSORT_UseNativeWindowsIcons() : enable or disable 'native' windows sorting icons.
. this feature requires Windows XP minimum with themes enabled and 'XP skin support' checked in compiler options ;
. the 'native' icon is always to the right ;
. if PureLVSORT doesn't detect themes support, it will use its own default icons.
Changes :
- new function : PureLVSORT_UseNativeWindowsIcons() : enable or disable 'native' windows sorting icons.
. this feature requires Windows XP minimum with themes enabled and 'XP skin support' checked in compiler options ;
. the 'native' icon is always to the right ;
. if PureLVSORT doesn't detect themes support, it will use its own default icons.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureLVSORT library : sorting ListIconGadgets (and more)
Thanks again gnozal, works perfectly!
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
-
- User
- Posts: 47
- Joined: Sun Feb 18, 2007 11:57 am
Re: PureLVSORT library : sorting ListIconGadgets (and more)
Hi gnozal.
Have a problem to get the actual sorted column.
Scenario :
- a grid displays one column not sorted with datas like B, A and C;
- the user sort this column asc : A, B and C;
- the app reloads the grid : B, A and C but the sort arrow is displayed yet; the app can't retrieve the actual sort column (neither the sort direction).
I have used PureLVSORT_GetClickedColumn (always returns -1) and PureLVSORT_GetSortingDirection (always returns zero) with no success.
How do I get the current sorted column ans the current sort direction ?
Thanx.
Have a problem to get the actual sorted column.
Scenario :
- a grid displays one column not sorted with datas like B, A and C;
- the user sort this column asc : A, B and C;
- the app reloads the grid : B, A and C but the sort arrow is displayed yet; the app can't retrieve the actual sort column (neither the sort direction).
I have used PureLVSORT_GetClickedColumn (always returns -1) and PureLVSORT_GetSortingDirection (always returns zero) with no success.
How do I get the current sorted column ans the current sort direction ?
Thanx.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureLVSORT library : sorting ListIconGadgets (and more)
Without code to demonstrate the issue, it's hard to tell.linkerstorm wrote:Have a problem to get the actual sorted column.
Scenario :
- a grid displays one column not sorted with datas like B, A and C;
- the user sort this column asc : A, B and C;
- the app reloads the grid : B, A and C but the sort arrow is displayed yet; the app can't retrieve the actual sort column (neither the sort direction).
I have used PureLVSORT_GetClickedColumn (always returns -1) and PureLVSORT_GetSortingDirection (always returns zero) with no success.
How do I get the current sorted column ans the current sort direction ?
Did you use PureLVSORT_SortListIconNow() to sort the gadget after "the app reloads the grid" ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- User
- Posts: 47
- Joined: Sun Feb 18, 2007 11:57 am
Re: PureLVSORT library : sorting ListIconGadgets (and more)
But I nned the current sorted column and the sort direction in order to use the PureLVSORT_SortListIconNow() function !
That's my goal.
Consider this piece of code :
- Run it.
- Sort the column.
- Reload the grid by clicking the button.
- The two functions returns, respectively, -1 and zero : why ?
EDIT : I just found the answer : I must call the two functions BEFORE the ClearGadgetItems function...
Thanx anyway, gnozal.
That's my goal.
Consider this piece of code :
Code: Select all
#WindowTimbres = 0
#ListIconTimbres = 0
#ButtonReload = 1
Procedure OpenWindow_WindowTimbres()
If OpenWindow(#WindowTimbres, 120, 229, 1024, 529, "Timbres", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar|#PB_Window_ScreenCentered)
ButtonGadget(#ButtonReload, 905, 60, 115, 30, "Reload")
ListIconGadget(#ListIconTimbres, 5, 60, 895, 465, "Pays", 200, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_FullRowSelect|#PB_ListIcon_GridLines)
PureCOLOR_SetWindowColor(#WindowTimbres, $FFFFF3)
PureLVSORT_SelectGadgetToSort(#ListIconTimbres, #PureLVSORT_ShowClickedHeader_IconLeft)
EndIf
EndProcedure
Procedure LoadGrid()
ClearGadgetItems(#ListIconTimbres)
AddGadgetItem(#ListIconTimbres, -1, "B")
AddGadgetItem(#ListIconTimbres, -1, "A")
AddGadgetItem(#ListIconTimbres, -1, "C")
MessageRequester("LVSORTTest", "PureLVSORT_GetClickedColumn :" + Str(PureLVSORT_GetClickedColumn(#ListIconTimbres)))
MessageRequester("LVSORTTest", "PureLVSORT_GetSortingDirection :" + Str(PureLVSORT_GetSortingDirection(#ListIconTimbres)))
EndProcedure
OpenWindow_WindowTimbres()
LoadGrid()
Repeat
ev = WaitWindowEvent()
If ev = #PB_Event_Gadget
If EventGadget() = #ButtonReload
LoadGrid()
EndIf
EndIf
Until ev = #PB_Event_CloseWindow
- Sort the column.
- Reload the grid by clicking the button.
- The two functions returns, respectively, -1 and zero : why ?
EDIT : I just found the answer : I must call the two functions BEFORE the ClearGadgetItems function...
Thanx anyway, gnozal.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureLVSORT library : sorting ListIconGadgets (and more)
Yes, #LVM_DELETEALLITEMS clears the information.linkerstorm wrote:EDIT : I just found the answer : I must call the two functions BEFORE the ClearGadgetItems function...
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).