Search in ListViewGadget and ListIconGadget
Posted: Thu Dec 25, 2014 2:41 pm
Hi
I need to find a number in ListViewGadget and when found it show at the top line.
The ListViewGadget is filled in ascending order (little random).
This code is just an example to give you better idea what i want:
I found some related topic here:
http://www.purebasic.fr/english/viewtop ... GetItem+ID+
...but i don't know if is possible to change it to my needs (also don't know how
)
Thank's
I need to find a number in ListViewGadget and when found it show at the top line.
The ListViewGadget is filled in ascending order (little random).
This code is just an example to give you better idea what i want:
Code: Select all
OpenWindow(0, 0, 0, 300, 300,"Listview example",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
ListViewGadget(1,10,10,200,250)
StringGadget(2,230,10,60,20,"",#PB_String_Numeric)
ButtonGadget(3,230,40,60,20,"SEARCH")
SendMessage_(GadgetID(1),#WM_SETREDRAW,#False,0)
For f = 0 To 60000
r = Random(3 , 1)
AddGadgetItem(1,-1,RSet((Str((f+r)&$FFFF)),5,"0"))
f+r
Next
SendMessage_(GadgetID(1),#WM_SETREDRAW,#True,0)
Repeat
Event = WaitWindowEvent()
gadgetID = EventGadget()
If Event = #PB_Event_Gadget
If gadgetID = 3
Debug "I need to show at the top of ListViewGadgeget, the number found"
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
http://www.purebasic.fr/english/viewtop ... GetItem+ID+
...but i don't know if is possible to change it to my needs (also don't know how

Thank's