Loading faster ListIcon like AddGadgetItem() [Resolved]
Posted: Mon Aug 17, 2015 10:19 am
Hello at all
I have take the code of RASHAD (Virtual ListIcon) for loading quickly a ListIcon
http://www.purebasic.fr/english/viewtop ... 05#p403305
User_Russian help me yesterday
for use a structured array with this code
But this time, i need to use like RASHAD a simple array, with CHR(10) separator like the AddgadgetItem() for the ListIconGadget
I don't understand why Debug PeekS(*pnmlvdi\item\pszText) return good "Hello" and "I'm" and "Kcc" then in the ListIcon i have just the first letter of "Hello"
Have a good day
I have take the code of RASHAD (Virtual ListIcon) for loading quickly a ListIcon
http://www.purebasic.fr/english/viewtop ... 05#p403305
User_Russian help me yesterday

But this time, i need to use like RASHAD a simple array, with CHR(10) separator like the AddgadgetItem() for the ListIconGadget
I don't understand why Debug PeekS(*pnmlvdi\item\pszText) return good "Hello" and "I'm" and "Kcc" then in the ListIcon i have just the first letter of "Hello"

Code: Select all
#ItemCount = 350000
#LVSICF_NOINVALIDATEALL = 1
#LVN_ODCACHEHINT = #LVN_FIRST - 13
Global Dim myItems.s(#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
Field$ = StringField(PeekS(@myItems(*pnmlvdi\item\iItem)), *pnmlvdi\item\iSubItem + 1, Chr(10))
*pnmlvdi\item\pszText = @Field$
Debug PeekS(*pnmlvdi\item\pszText)
EndIf
;
EndSelect
EndSelect
ProcedureReturn result
EndProcedure
;
If OpenWindow(0, 0, 0, 300, 430, "Virtual ListIconGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
SetWindowCallback(@WinCallback())
Licon = ListIconGadget(0,5,5,290,390,"1",100,#LVS_OWNERDATA)
SendMessage_(Licon, #LVM_SETITEMCOUNT, #ItemCount, #LVSICF_NOINVALIDATEALL)
AddGadgetColumn(0,2,"2",100)
AddGadgetColumn(0,3,"3",100)
For i=0 To #ItemCount
myItems(i) = "Hello" + Chr(10) + "i'm" + Chr(10) + "KCC"
Next i
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf