Ok, will do.dige wrote:... After some more tests, I've find out it depends on PureCOLOR.
Could you recompile the lib too? thx!
PureLVSORT library : sorting ListIconGadgets (and more)
Moderator: gnozal
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureLVSORT library : sorting ListIconGadgets (and more)
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureLVSORT library : sorting ListIconGadgets (and more)
Solved. Now it works .. thx again!gnozal wrote:Ok, will do.dige wrote:... After some more tests, I've find out it depends on PureCOLOR.
Could you recompile the lib too? thx!
"Daddy, I'll run faster, then it is not so far..."
Re: PureLVSORT library : sorting ListIconGadgets (and more)
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:
Les items ne sont plus dans l'ordre


Voici le code de démonstration:
Code: Select all
#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
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureLVSORT library : sorting ListIconGadgets (and more)
PureLVSORT does not work with one column (you may use the #LVS_SORT* styles in this case).Nico wrote:Il y a un problème avec le tri en utilisant #PureLVSORT_Alphabetic_User
Les items ne sont plus dans l'ordre![]()
![]()
Try the code below :
Code: Select all
#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).
Re: PureLVSORT library : sorting ListIconGadgets (and more)
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.
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.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureLVSORT library : sorting ListIconGadgets (and more)
Should be fixed in next version.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.
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 (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).
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).
Re: PureLVSORT library : sorting ListIconGadgets (and more)
Thanks, work very well. 

- Fangbeast
- PureBasic Protozoa
- Posts: 4789
- Joined: Fri Apr 25, 2003 3:08 pm
- Location: Not Sydney!!! (Bad water, no goats)
Re: PureLVSORT library : sorting ListIconGadgets (and more)
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:
If I add data to the ListiconGadget with icons as in:
The custom sort header icons disappear.
If I setup custom icons on the header, I can see them during a sort:
Code: Select all
PureLVSORT_SetUserIcons(ImageID(#Image_picsender_sortup), ImageID(#Image_picsender_sortdown))
Code: Select all
AddGadgetItem(#Gadget_picsender_maillist, -1, CurrentFile.s + Chr(10) + Currentpath.s), ImageID(#Image_picsender_photos))
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureLVSORT library : sorting ListIconGadgets (and more)
Hi Fangbeast, it seems to work here :
Code: Select all
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).
- Fangbeast
- PureBasic Protozoa
- Posts: 4789
- Joined: Fri Apr 25, 2003 3:08 pm
- Location: Not Sydney!!! (Bad water, no goats)
Re: PureLVSORT library : sorting ListIconGadgets (and more)
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
Then in the main body of code I do the following:
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.
Code: Select all
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
Code: Select all
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
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
-
- 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 see any obvious problem in your posted code.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 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).
- Fangbeast
- PureBasic Protozoa
- Posts: 4789
- Joined: Fri Apr 25, 2003 3:08 pm
- Location: Not Sydney!!! (Bad water, no goats)
Re: PureLVSORT library : sorting ListIconGadgets (and more)
Maybe the enumeration is the issue (the way I am doing it) and the icon numbers clash somewhere.gnozal wrote:I don't see any obvious problem in your posted code.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 need a small working snippet that demonstrates the issue.
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.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Re: PureLVSORT library : sorting ListIconGadgets (and more)
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
It seems to sort (compute) but the gadget won´t updated... Any chance for a fix?
thx, chi
Code: Select all
#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
Et cetera is my worst enemy
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureLVSORT library : sorting ListIconGadgets (and more)
PureLVSORT uses the Windows API LVM_SORTITEMS message, so virtual listicons are not supported (see MSDN article about List-View controls).chi wrote:Why is PureLVSort not working with virtual listicon gadgets?
It seems to sort (compute) but the gadget won´t updated...
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).