Win xp only.
Code: Select all
Global timerset
Procedure TimerProc(uID, uMsg, dwUser, dw1, dw2)
If timerset = 0
Debug "Single click!"
EndIf
timerset=0
EndProcedure
If OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If CreateGadgetList(WindowID(0))
ListIconGadget(0, 5, 5, 290, 90, "Name", 100, #PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(0, 1, "Address", 250)
AddGadgetItem(0, -1, "Harry Rannit"+Chr(10)+"12 Parliament Way, Battle Street, By the Bay")
AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 PureBasic Road, BigTown, CodeCity")
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
If EventGadget()=0
Select EventType()
Case #PB_EventType_LeftClick
timeSetEvent_(200,10,@TimerProc(),0, #TIME_ONESHOT)
Case #PB_EventType_LeftDoubleClick
timerset=1
Debug "Double click!"
EndSelect
EndIf
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf
EndIf