I'm trying to detect wether the mouse is over two panels. I have another way more complex way of trying to do it that I believe will work. But I was wondering why the current way i'm trying to do it doesn't work. It's a little hard to adjust to blitz max b/c there's no examples using the commands I want to use (like blitz 3d). The code runs but it doesn't do what I want it to do. if u think you know how to do it, please let me know! thanks. By the way, does anyone know where I can find a bunch of examples using the most important and useful blitz GUI functions (besides on this website) ?
the code is right here...
Global MyWindow:TGadget=CreateWindow("My Window", 0,0,800,600)
Global Panel_1:TGadget=CreatePanel(200,100,100,50, MyWindow, 10, "Panel 1")
SetpanelColor(Panel_1, 255,0,0)
Global Panel_2:TGadget=CreatePanel(500,100,100,50, MyWindow, 10, "Panel 2")
SetpanelColor(Panel_2, 0,255,0)
Repeat
WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
End
Case EVENT_GADGETACTION
'----------------------------------
Select EventSource()
Case Panel_1
Select EventID()
Case EVENT_MOUSEENTER,EVENT_MOUSEUP
'Print("its on")
SetStatusText MyWindow,"Over Panel 1"
End Select
Case Panel_2
Select EventID()
Case EVENT_MOUSEENTER,EVENT_MOUSEUP
'Print("its on")
SetStatusText MyWindow,"Over Panel 2"
End Select
End Select 'eventSource
'-----------------------------------
End Select 'event_gadgetaction
Forever
the code is right here...
Global MyWindow:TGadget=CreateWindow("My Window", 0,0,800,600)
Global Panel_1:TGadget=CreatePanel(200,100,100,50, MyWindow, 10, "Panel 1")
SetpanelColor(Panel_1, 255,0,0)
Global Panel_2:TGadget=CreatePanel(500,100,100,50, MyWindow, 10, "Panel 2")
SetpanelColor(Panel_2, 0,255,0)
Repeat
WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
End
Case EVENT_GADGETACTION
'----------------------------------
Select EventSource()
Case Panel_1
Select EventID()
Case EVENT_MOUSEENTER,EVENT_MOUSEUP
'Print("its on")
SetStatusText MyWindow,"Over Panel 1"
End Select
Case Panel_2
Select EventID()
Case EVENT_MOUSEENTER,EVENT_MOUSEUP
'Print("its on")
SetStatusText MyWindow,"Over Panel 2"
End Select
End Select 'eventSource
'-----------------------------------
End Select 'event_gadgetaction
Forever