It is currently Sat May 25, 2013 7:36 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 429 posts ]  Go to page Previous  1 ... 19, 20, 21, 22, 23, 24, 25 ... 29  Next
Author Message
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue May 11, 2010 2:14 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
dige wrote:
... After some more tests, I've find out it depends on PureCOLOR.
Could you recompile the lib too? thx!

Ok, will do.

_________________
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 May 11, 2010 2:55 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Apr 30, 2003 8:15 am
Posts: 710
Location: Germany
gnozal wrote:
dige wrote:
... After some more tests, I've find out it depends on PureCOLOR.
Could you recompile the lib too? thx!

Ok, will do.

Solved. Now it works .. thx again!

_________________
"Daddy, I'll run faster, then it is not so far..."


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Sat Jul 03, 2010 11:09 pm 
Offline
Enthusiast
Enthusiast

Joined: Sun Jan 11, 2004 11:34 am
Posts: 233
Location: France
Il y a un problème avec le tri en utilisant #PureLVSORT_Alphabetic_User
Les items ne sont plus dans l'ordre :!: :?:

Voici le code de démonstration:
Code:
#Window_0 = 0
#ListIcon_0 = 0

Structure Array256
  Byte.b[256]
EndStructure
UserArray.Array256
; standard ASCII values
For i = 0 To 255
  UserArray\Byte[i] = i
Next
; change some values
; UserArray\Byte[Asc("à")] = 'a'
; UserArray\Byte[Asc("â")] = 'a'
; UserArray\Byte[Asc("ù")] = 'u'
; UserArray\Byte[Asc("û")] = 'u'
; UserArray\Byte[Asc("ü")] = 'u'
; UserArray\Byte[Asc("é")] = 'e'
; UserArray\Byte[Asc("è")] = 'e'
; UserArray\Byte[Asc("ê")] = 'e'
; declare user array (before using #PureLVSORT_Alphabetic_User !)
PureLVSORT_DefineAlphabeticOrder(@UserArray)

Procedure Open_Window_0()
  If OpenWindow(#Window_0, 216, 0, 602, 302, "PureLVSORT User Array Test", #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered)
      ListIconGadget(#ListIcon_0, 5, 5, 590, 285, "User", 110)
     
      AddGadgetItem(#ListIcon_0, -1, "ab")
      AddGadgetItem(#ListIcon_0, -1, "aba")
      AddGadgetItem(#ListIcon_0, -1, "abb")
      AddGadgetItem(#ListIcon_0, -1, "ac") 

  EndIf
EndProcedure
Open_Window_0()
; define alphabetic order user array

; ListIcon Sort Setup
If PureLVSORT_SelectGadgetToSort(#ListIcon_0, #PureLVSORT_ShowClickedHeader_IconLeft) = #PureLVSORT_Ok
  ;PureLVSORT_SetColumnType(#ListIcon_0, 0, #PureLVSORT_String)
  PureLVSORT_SetColumnType(#ListIcon_0, 0, #PureLVSORT_Alphabetic_User)
  PureLVSORT_SortListIconNow(#ListIcon_0, 0, 1)
EndIf
;
Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
End


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

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
Nico wrote:
Il y a un problème avec le tri en utilisant #PureLVSORT_Alphabetic_User
Les items ne sont plus dans l'ordre :!: :?:
PureLVSORT does not work with one column (you may use the #LVS_SORT* styles in this case).
Try the code below :
Code:
#Window_0 = 0
#ListIcon_0 = 0
Structure Array256
  Byte.b[256]
EndStructure
UserArray.Array256
; standard ASCII values
For i = 0 To 255
  UserArray\Byte[i] = i
Next
PureLVSORT_DefineAlphabeticOrder(@UserArray)
Procedure Open_Window_0()
  If OpenWindow(#Window_0, 216, 0, 602, 302, "PureLVSORT User Array Test", #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered)
    ListIconGadget(#ListIcon_0, 5, 5, 590, 285, "User", 110)
    AddGadgetColumn(#ListIcon_0, 1, "", 0)
    AddGadgetItem(#ListIcon_0, -1, "abb" + Chr(10) + "")
    AddGadgetItem(#ListIcon_0, -1, "ab" + Chr(10) + "")
    AddGadgetItem(#ListIcon_0, -1, "aba" + Chr(10) + "")
    AddGadgetItem(#ListIcon_0, -1, "ac" + Chr(10) + "") 
  EndIf
EndProcedure
Open_Window_0()
If PureLVSORT_SelectGadgetToSort(#ListIcon_0, #PureLVSORT_ShowClickedHeader_IconLeft) = #PureLVSORT_Ok
  PureLVSORT_SetColumnType(#ListIcon_0, 0, #PureLVSORT_Alphabetic_User)
  PureLVSORT_SetColumnFlag(#ListIcon_0, 1, #PureLVSORT_Column_Hidden)
  PureLVSORT_SortListIconNow(#ListIcon_0, 0, 1)
EndIf
;
Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
End

_________________
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 Jul 05, 2010 5:41 pm 
Offline
Enthusiast
Enthusiast

Joined: Sun Jan 11, 2004 11:34 am
Posts: 233
Location: France
Dans l'exemple, je n'ai mis qu'une colonne mais c'était pour simplifier le code!
Tu peux ré-essayer avec UserLibUnicode ou UserLibUnicodeThreadSafe, car cela ne fonctionne pas chez moi avec window XP ou Vista.

In the example, I put a column but it was to simplify the code!
You can retry with UserLibUnicode or UserLibUnicodeThreadSafe because it does not work for me with window XP or Vista.


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Jul 06, 2010 7:45 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
Nico wrote:
In the example, I put a column but it was to simplify the code!
You can retry with UserLibUnicode or UserLibUnicodeThreadSafe because it does not work for me with window XP or Vista.
Should be fixed in next version.

_________________
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 Jul 06, 2010 8:57 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
Update (PB4.50 version)

Changes :
- fixed #PureLVSORT_Alphabetic_User issue in unicode mode.
  Note : the alphabetic order user array is now a character array (previously a byte array).

_________________
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 Jul 06, 2010 8:37 pm 
Offline
Enthusiast
Enthusiast

Joined: Sun Jan 11, 2004 11:34 am
Posts: 233
Location: France
Thanks, work very well. :)


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Jul 20, 2010 10:59 am 
Offline
PureBasic Protozoa
PureBasic Protozoa
User avatar

Joined: Fri Apr 25, 2003 3:08 pm
Posts: 3011
Hello Gnozal, I am using your library for pb4.5.

If I setup custom icons on the header, I can see them during a sort:

Code:
PureLVSORT_SetUserIcons(ImageID(#Image_picsender_sortup), ImageID(#Image_picsender_sortdown))


If I add data to the ListiconGadget with icons as in:

Code:
      AddGadgetItem(#Gadget_picsender_maillist, -1, CurrentFile.s + Chr(10) + Currentpath.s), ImageID(#Image_picsender_photos))


The custom sort header icons disappear.

_________________
Resist FaceBorg or have your ass laminated!


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

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
Hi Fangbeast, it seems to work here :
Code:
Procedure Open_Window_0()
  If OpenWindow(0, 216, 0, 602, 152, "PureLVSORT Test", #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered)
    ListIconGadget(0, 5, 5, 590, 140, "String", 110)
    AddGadgetColumn(0, 1, "Numeric", 110)
    AddGadgetColumn(0, 2, "Float", 110)
    AddGadgetColumn(0, 3, "DateDDMMYYYY", 120)
    AddGadgetColumn(0, 4, "DateMMDDYYYY", 120)
    SomeIcon = LoadImage(2, #PB_Compiler_Home + "Examples\Sources\Data\CdPlayer.ico")
    AddGadgetItem(0, -1, "ABCDE" + Chr(10) + "514" + Chr(10) + "0.9" + Chr(10) + "31/12/2004" + Chr(10) + "12/31/2004")
    AddGadgetItem(0, -1, "ACDEF" + Chr(10) + "118" + Chr(10) + "1.9" + Chr(10) + "11/12/2004" + Chr(10) + "12/11/2004", SomeIcon)
    AddGadgetItem(0, -1, "ZABCD" + Chr(10) + "-414" + Chr(10) + "7.0" + Chr(10) + "21/01/2003" + Chr(10) + "01/21/2003")
    AddGadgetItem(0, -1, "DEFGH" + Chr(10) + "524" + Chr(10) + "900" + Chr(10) + "10/06/2001" + Chr(10) + "06/10/2001", SomeIcon)
  EndIf
EndProcedure
Open_Window_0()
; User Icons
IconArrowUp.l = CatchImage(0, ?IconArrowUp)
IconArrowDown.l = CatchImage(1, ?IconArrowDown)
PureLVSORT_SetUserIcons(IconArrowUp, IconArrowDown)
; ListIcon Sort Setup
If PureLVSORT_SelectGadgetToSort(0, #PureLVSORT_ShowClickedHeader_IconLeft) = #PureLVSORT_Ok
  PureLVSORT_SetColumnType(0, 0, #PureLVSORT_String) ; default, not necessary
  PureLVSORT_SetColumnType(0, 1, #PureLVSORT_Numeric)
  PureLVSORT_SetColumnType(0, 2, #PureLVSORT_Float)
  PureLVSORT_SetColumnType(0, 3, #PureLVSORT_DateDDMMYYYY)
  PureLVSORT_SetColumnType(0, 4, #PureLVSORT_DateMMDDYYYY)
  PureLVSORT_SortListIconNow(0, 1, -1)
EndIf
;
Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
End
;{ Icons
DataSection
  IconArrowUp:
  Data.l $04C64D42,$00000000,$04360000,$00280000,$000C0000,$000C0000,$00010000,$00000008,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$C6C60000,$C8C800C6,$CECE00C8,$DEDE00CE,$EFEF00DE,$FFFF00EF,$000000FF,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$06000000,$06060606,$06060606,$06000006
  Data.l $00060606,$06060600,$06000006,$00060606,$06060600,$06000006,$00060606,$06060600,$06000006,$00060606,$06060600,$06000006
  Data.l $00000000,$00000000,$06000006,$00000006,$06000000,$06000006,$00000606,$06060000,$06000006,$00060606,$06060600,$06000006
  Data.l $06060606,$06060606,$00000006,$00000000,$00000000
  Data.b $00,$00
  IconArrowDown:
  Data.l $04C64D42,$00000000,$04360000,$00280000,$000C0000,$000C0000,$00010000,$00000008,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$C6C60000,$C8C800C6,$CECE00C8,$DEDE00CE,$EFEF00DE,$FFFF00EF,$000000FF,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$06000000,$06060606,$06060606,$06000006
  Data.l $00060606,$06060600,$06000006,$00000606,$06060000,$06000006,$00000006,$06000000,$06000006,$00000000,$00000000,$06000006
  Data.l $00060606,$06060600,$06000006,$00060606,$06060600,$06000006,$00060606,$06060600,$06000006,$00060606,$06060600,$06000006
  Data.l $06060606,$06060606,$00000006,$00000000,$00000000
  Data.b $00,$00
EndDataSection ;}

_________________
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 Jul 20, 2010 12:24 pm 
Offline
PureBasic Protozoa
PureBasic Protozoa
User avatar

Joined: Fri Apr 25, 2003 3:08 pm
Posts: 3011
Yes, I can see that your ways works, mine doesn't for some reason. The below are my constants for my ListIcon and sorting images and the way I load them

Code:
Enumeration #ImageIndex
  #Image_picsender_album          ; Anormal.i     family16x16.ico                       ; Normal address icon
  #Image_picsender_photos         ; Acustom.i     custom16x16.ico                       ; Custom address icon
  #Image_picsender_sortup                                                               ; sorting up
  #Image_picsender_sortdown                                                             ; sorting down
EndEnumeration

CatchImage(#Image_picsender_sortup,    ?_PTK_picsender_sortup)                          ; sorting up
CatchImage(#Image_picsender_sortdown,  ?_PTK_picsender_sortdown)                        ; sorting down
CatchImage(#Image_picsender_album,     ?_PTK_picsender_album)                           ; family16x16.ico           Normal address icon
CatchImage(#Image_picsender_photos,    ?_PTK_picsender_photos)                          ; custom16x16.ico           Custom address icon

DataSection
  _PTK_picsender_sortup     : IncludeBinary "Images\sortup12x12.ico"                    ;
  _PTK_picsender_sortdown   : IncludeBinary "Images\sortdown12x12.ico"                  ;

  _PTK_picsender_album      : IncludeBinary "Images\address16x16.ico"                   ;
  _PTK_picsender_photos     : IncludeBinary "Images\camera16x16.ico"                    ;
EndDataSection



Then in the main body of code I do the following:

Code:
  PureLVSORT_SetUserIcons(ImageID(#Image_picsender_sortup), ImageID(#Image_picsender_sortdown))

; ListIcon Sort Setup

  If PureLVSORT_SelectGadgetToSort(#Gadget_picsender_maillist, #PureLVSORT_ShowClickedHeader_IconLeft) = #PureLVSORT_Ok
    PureLVSORT_SetColumnType(#Gadget_picsender_maillist,     0, #PureLVSORT_String)
    PureLVSORT_SetColumnType(#Gadget_picsender_maillist,     1, #PureLVSORT_String)
    PureLVSORT_SortListIconNow(#Gadget_picsender_maillist, 0, 1)
  EndIf


And the header buttons always vanish if I add items to a ListIcon with image. By the way, "Enumeration #ImageIndex" is a continuation of the visual designer last used image index it created and I know the icons work.

_________________
Resist FaceBorg or have your ass laminated!


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Jul 20, 2010 12:37 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
Fangbeast wrote:
Yes, I can see that your ways works, mine doesn't for some reason. The below are my constants for my ListIcon and sorting images and the way I load them
I don't see any obvious problem in your posted code.
I need a small working snippet that demonstrates the issue.

_________________
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 Jul 20, 2010 1:49 pm 
Offline
PureBasic Protozoa
PureBasic Protozoa
User avatar

Joined: Fri Apr 25, 2003 3:08 pm
Posts: 3011
gnozal wrote:
Fangbeast wrote:
Yes, I can see that your ways works, mine doesn't for some reason. The below are my constants for my ListIcon and sorting images and the way I load them
I don't see any obvious problem in your posted code.
I need a small working snippet that demonstrates the issue.


Maybe the enumeration is the issue (the way I am doing it) and the icon numbers clash somewhere.

I bet if I cut out a snippet, it will probably work (LOL!). I am due to post this project shortly as it is public and see how I can cut something out of it. Thanks Gnozal.

_________________
Resist FaceBorg or have your ass laminated!


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Oct 04, 2010 1:54 am 
Offline
Enthusiast
Enthusiast

Joined: Sat May 05, 2007 5:31 pm
Posts: 102
Location: Linz - Austria
Why is PureLVSort not working with virtual listicon gadgets?
It seems to sort (compute) but the gadget won´t updated... Any chance for a fix?

thx, chi

Code:
#LVSICF_NOINVALIDATEALL = 1
#LVN_ODCACHEHINT = #LVN_FIRST - 13
#ItemCount = 30000


Structure StructItems
  ItemID.s
  ItemName.s
  ItemNumber.s
EndStructure
Global Dim myItems.StructItems(#ItemCount)


Procedure WinCallback(hwnd, msg, wParam, lParam)
  result = #PB_ProcessPureBasicEvents
  Select msg
    Case #WM_NOTIFY
      *pnmh.NMHDR = lParam
      Select *pnmh\code
        Case #LVN_ODCACHEHINT
          result = 0
        Case #LVN_GETDISPINFO
          *pnmlvdi.NMLVDISPINFO = lParam
          If *pnmlvdi\item\mask & #LVIF_TEXT
            If *pnmlvdi\item\iSubItem = 0
              *pnmlvdi\item\pszText = @myItems(*pnmlvdi\item\iItem)\ItemID
            ElseIf *pnmlvdi\item\iSubItem = 1
              *pnmlvdi\item\pszText = @myItems(*pnmlvdi\item\iItem)\ItemName
            ElseIf *pnmlvdi\item\iSubItem = 2
              *pnmlvdi\item\pszText = @myItems(*pnmlvdi\item\iItem)\ItemNumber
            EndIf
          EndIf
      EndSelect
  EndSelect
  ProcedureReturn result
EndProcedure


If OpenWindow(0, 0, 0, 640, 300, "Virtual ListIconGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
 
  SetWindowCallback(@WinCallback())
 
  ListIconGadget(0,10,10,620,280,"ID",50,#LVS_OWNERDATA)
  AddGadgetColumn(0,1,"Name",100)
  AddGadgetColumn(0,2,"Number",100)
 
  SendMessage_(GadgetID(0), #LVM_SETITEMCOUNT, #ItemCount, #LVSICF_NOINVALIDATEALL)
  For i=0 To #ItemCount
    myItems(i)\ItemID = Str(i)
    myItems(i)\ItemName = "Name"+Str(i)
    myItems(i)\ItemNumber = Str(Random(1000))
  Next i
 
  If PureLVSORT_SelectGadgetToSort(0,#PureLVSORT_ShowClickedHeader_IconRight) = #PureLVSORT_Ok
    PureLVSORT_SetColumnType(0, 0, #PureLVSORT_Numeric)
    PureLVSORT_SetColumnType(0, 1, #PureLVSORT_String)
    PureLVSORT_SetColumnType(0, 2, #PureLVSORT_Numeric)
  EndIf
 
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
 
EndIf


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

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
chi wrote:
Why is PureLVSort not working with virtual listicon gadgets?
It seems to sort (compute) but the gadget won´t updated...
PureLVSORT uses the Windows API LVM_SORTITEMS message, so virtual listicons are not supported (see MSDN article about List-View controls).

_________________
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 ... 19, 20, 21, 22, 23, 24, 25 ... 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