Loading faster ListIcon like AddGadgetItem() [Resolved]

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Loading faster ListIcon like AddGadgetItem() [Resolved]

Post by Kwai chang caine »

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 8) 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" :|

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
Have a good day
Last edited by Kwai chang caine on Mon Aug 17, 2015 5:40 pm, edited 1 time in total.
ImageThe happiness is a road...
Not a destination
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Loading faster ListIcon like AddGadgetItem()

Post by Thunder93 »

PokeS() it is easier and allows for smooth reading afterwards in both ASCII and Unicode modes.
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Loading faster ListIcon like AddGadgetItem()

Post by Kwai chang caine »

Hello THUNDER93 :D

Easier and KCC is not compatible :oops:

I have not understand where i do put the Poke :cry:
ImageThe happiness is a road...
Not a destination
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Loading faster ListIcon like AddGadgetItem()

Post by Thunder93 »

Hey KCC.

In the callback procedure, you have the following;

Code: Select all

*pnmlvdi\item\pszText = @Field$
REM that line and insert on a new line;

Code: Select all

PokeS(*pnmlvdi\item\pszText, Field$)
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Loading faster ListIcon like AddGadgetItem()

Post by Kwai chang caine »

Waouuuh !!
You are too strong !!!


Just a line for 3 hours of thinking :cry:
Never i found without you

I wish you a very good day...and again more ....be crazy :lol:

I wish you a very good Week !!! :D
ImageThe happiness is a road...
Not a destination
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Loading faster ListIcon like AddGadgetItem() [Resolved]

Post by Thunder93 »

You too. :)
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
Post Reply