It is currently Sat May 25, 2013 12:01 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 429 posts ]  Go to page Previous  1 ... 20, 21, 22, 23, 24, 25, 26 ... 29  Next
Author Message
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Oct 12, 2010 11:18 am 
Offline
Enthusiast
Enthusiast

Joined: Sat May 05, 2007 5:31 pm
Posts: 102
Location: Linz - Austria
Thanks for pointing that out, gnozal!
I already use Demivec´s StableMergeSort routine for sorting the listview... viewtopic.php?f=12&t=41068

cheers, chi


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Sat Oct 23, 2010 12:26 pm 
Offline
Addict
Addict

Joined: Thu Nov 01, 2007 5:37 pm
Posts: 1566
Location: Germany
Is it possible to use the standard system sort icons for #PureLVSORT_ShowClickedHeader_Icon?
Example: http://www.thebitguru.com/site_media/uploads/attachments/143_Sorting_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?


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Oct 25, 2010 8:43 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
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?

I don't know about system icons for ListView headers.
How do you get them ?

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Oct 25, 2010 11:51 am 
Offline
Addict
Addict

Joined: Thu Nov 01, 2007 5:37 pm
Posts: 1566
Location: Germany
gnozal wrote:
I don't know about system icons for ListView headers.
How do you get them ?
I'm not fully sure either but I found this article about it:
http://www.thebitguru.com/articles/16-How%20to%20Set%20ListView%20Column%20Header%20Sort%20Icons%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?


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Oct 25, 2010 2:11 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
c4s wrote:
I'm not fully sure either but I found this article about it:
http://www.thebitguru.com/articles/16-How%20to%20Set%20ListView%20Column%20Header%20Sort%20Icons%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 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.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Oct 25, 2010 4:26 pm 
Offline
Addict
Addict

Joined: Thu Nov 01, 2007 5:37 pm
Posts: 1566
Location: Germany
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.
Seriously who is still using something under XP? Or which developer focuses on windows 98?
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. ;)


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Oct 26, 2010 8:17 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
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. ;)

I may release a new version with an extra flag, when I have some more time.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Oct 26, 2010 8:41 am 
Offline
Addict
Addict

Joined: Thu Nov 01, 2007 5:37 pm
Posts: 1566
Location: Germany
Thank you gnozal.


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Oct 26, 2010 10:28 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
c4s wrote:
Thank you gnozal.

I just had a look, it should be easy (not too much code to change).

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Oct 26, 2010 11:22 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

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

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Oct 26, 2010 2:32 pm 
Offline
Addict
Addict

Joined: Thu Nov 01, 2007 5:37 pm
Posts: 1566
Location: Germany
Thanks again gnozal, works perfectly!


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Sun Nov 14, 2010 9:05 pm 
Offline
User
User

Joined: Sun Feb 18, 2007 11:57 am
Posts: 26
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.


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Nov 15, 2010 11:18 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
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 ?
Without code to demonstrate the issue, it's hard to tell.
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).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Nov 15, 2010 9:15 pm 
Offline
User
User

Joined: Sun Feb 18, 2007 11:57 am
Posts: 26
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 :
Code:
#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


- 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.


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Nov 16, 2010 8:44 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
linkerstorm wrote:
EDIT : I just found the answer : I must call the two functions BEFORE the ClearGadgetItems function...
Yes, #LVM_DELETEALLITEMS clears the information.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 429 posts ]  Go to page Previous  1 ... 20, 21, 22, 23, 24, 25, 26 ... 29  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye