;... Use 1000000 items
#ItemCount = 1000000
#LVSICF_NOINVALIDATEALL = 1
#LVN_ODCACHEHINT = #LVN_FIRST - 13
;... Array to hold data
Global Dim myItems.s(#ItemCount,1)
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
;... Item text is being requested
*pnmlvdi\item\pszText = @myItems(*pnmlvdi\item\iItem,*pnmlvdi\item\iSubItem)
EndIf
EndSelect
EndSelect
ProcedureReturn result
EndProcedure
If OpenWindow(0, 0, 0, 640, 300, "ListIconGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
SetWindowCallback(@WinCallback())
; left column
list=ListIconGadget(#PB_Any,10,10,620,280,"ID",50,#LVS_OWNERDATA)
;... Set desired number of ListIconGdaget items
SendMessage_(GadgetID(list), #LVM_SETITEMCOUNT, #ItemCount, #LVSICF_NOINVALIDATEALL)
AddGadgetColumn(list,2,"Name",100)
For i=0 To #ItemCount
myItems(i,0) = Str(i)
myItems(i,1) = "Name"+Str(i)
Next i
; Here we change the ListIcon display to large icons and show an image
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Last edited by Sparkie on Mon Dec 08, 2008 7:21 pm, edited 2 times in total.
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Very interesting. I had also seen your other post on virtual lists (Sparkie) and am considering using them in an app I have which needs to refresh a list of potententially many thousand items, which can be a little sluggish.