Left, right and double click and watch the debuglog
SuperStrict
Import MaxGui.Drivers
Local Window14:TGadget = CreateWindow:TGadget("Window14",261,106,141,143,Null,WINDOW_TITLEBAR|WINDOW_RESIZABLE |WINDOW_STATUS |WINDOW_CLIENTCOORDS )
Local ListBox1:TGadget = CreateListBox:TGadget(27,28,80,100,Window14:TGadget,Null)
AddGadgetItem( ListBox1:TGadget,"Item1",GADGETITEM_DEFAULT )
AddGadgetItem( ListBox1:TGadget,"Item2",GADGETITEM_NORMAL )
Repeat
WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
Select EventSource()
Case Window14 Window14_WC( Window14:TGadget )
End Select
Case EVENT_GADGETACTION
Select EventSource()
Case ListBox1 ListBox1_GA( ListBox1:TGadget , EventData() , EventExtra:Object() )
End Select
Case EVENT_GADGETSELECT
Select EventSource()
Case ListBox1 ListBox1_GS( ListBox1:TGadget , EventData() , EventExtra:Object() )
End Select
Case EVENT_GADGETMENU
Select EventSource()
Case ListBox1 ListBox1_GM( ListBox1:TGadget , EventData() , EventExtra:Object() , Window14:TGadget )
End Select
End Select
Forever
Function Window14_WC( Window:TGadget )
DebugLog "Window Window14 wants to be closed"
End
End Function
Function ListBox1_GA( ListBox:TGadget , Number:Int , Extra:Object )
DebugLog "ListBox ListBox1 double clicked an Item " + Number
If Number => 0 DebugLog "Selected Text = "+ GadgetItemText( ListBox:TGadget , Number:Int )
End Function
Function ListBox1_GS( ListBox:TGadget , Number:Int , Extra:Object )
DebugLog "ListBox ListBox1 single clicked an Item"
End Function
Function ListBox1_GM( ListBox:TGadget , Number:Int , Extra:Object , Window:TGadget=Null )
DebugLog "ListBox ListBox1 right clicked an Item"
End Function