mousehit?

BlitzMax Forums/BlitzMax GUI Programming/mousehit?

Check eventdata() for EVENT_MOUSEDOWN for the mouse button hit.
SuperStrict

Local MyWindow:TGadget=CreateWindow("Panel Example", 200,200,320,240)
Local MyPanel:TGadget=CreatePanel(110,30,80,80, MyWindow, PANEL_ACTIVE)
Local image1:TPixmap=LoadPixmap("Button_1.jpg")
Local image2:TPixmap=LoadPixmap("Button_2.jpg")
Local image:TPixmap = image1

Repeat
  WaitEvent()
  Select EventID()
  Case EVENT_WINDOWCLOSE
     End
 Case EVENT_MOUSEDOWN	
		SetStatusText mywindow,"Mousebutton " + EventData() + " hit"
		Select EventData()
			Case 1
 			 image = image2
			
		End Select
  Default
     image=image1
   End Select
 SetPanelPixmap MyPanel , image , PANELPIXMAP_CENTER
 Flip 
Forever