Hi
can someone explain me what's wrong with this?
I really think that is a bug with EventX() but it's can be
me that don't understand how it's work .. here the code
the problem is when I try to position the panel in the window with the mouse I got strange thing the panel sometime don't position where the mouse is.
can someone explain me what's wrong with this?
I really think that is a bug with EventX() but it's can be
me that don't understand how it's work .. here the code
the problem is when I try to position the panel in the window with the mouse I got strange thing the panel sometime don't position where the mouse is.
' createwindow.bmx Strict Global MouseXEndPosi:Int Global MouseYEndPosi:Int Global selected:Int Global window:TGadget=CreateWindow("My Window",40,40,320,240) Global panelwindow:TGadget=CreatePanel(0,0,GadgetWidth(window),GadgetHeight(window),window,PANEL_ACTIVE) Global SelectPan:TGadget=CreatePanel(20,20,30,30,panelwindow,PANEL_ACTIVE) SetPanelColor( SelectPan,50,120,10 ) While True WaitEvent Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_MOUSEDOWN If EventSource() = SelectPan Then selected = 1 Case EVENT_MOUSEMOVE MouseXEndPosi = EventX() MouseYEndPosi = EventY() Print MouseXEndPosi + "," + MouseYEndPosi Delay 100 Case EVENT_MOUSEUP Local MouseXEndPosi = EventX() Local MouseYEndPosi = EventY() Print "Before gadgetshape" + MouseXEndPosi + "," + MouseXEndPosi SetGadgetShape( SelectPan,MouseXEndPosi,MouseYEndPosi,30,30 ) Print "After gadgetshape" + MouseXEndPosi + "," + MouseXEndPosi Delay 100 End Select Wend