| Global MouseInCanvas1:Int=True '-Flag For Mouse whereabout Global Mx1:Int '-----------------MouseX location For Main Canvas (Canvas1) Global My1:Int '-----------------MouseY location For Main Canvas (Canvas1) Global xsize:Int=48 '------------width of Cursor in Canvas1 Global ysize:Int=48 '------------height of Cursor in Canvas1 |
| Case EVENT_MOUSEENTER Process_MouseEnterEvent Case EVENT_MOUSELEAVE Process_MouseLeaveEvent Case EVENT_MOUSEMOVE Process_MouseMoveEvent |
| Function DrawCursor(x:Int,y:Int,xs:Int, ys:Int) DrawLine x,y,x+xs,y DrawLine x,y,x,y+ys DrawLine x+xs,y,x+xs,y+ys DrawLine x,y+ys,x+xs,y+ys End Function |
| Function Process_MouseEnterEvent:Int() Select EventSource() Case Canvas1 HideMouse() MouseInCanvas1=True RedrawGadget(Canvas1) End Select End Function |
| Function Process_MouseLeaveEvent:Int() Select EventSource() Case Canvas1 ShowMouse() MouseInCanvas1=False RedrawGadget(Canvas1) End Select End Function |
| Function Process_MouseMoveEvent:Int() Select EventSource() Case Canvas1 mx1=EventX() my1=EventY() RedrawGadget(Canvas1) End Select End Function |
| Function Process_GadgetPaintEvent:Int() SetGraphics CanvasGraphics (Canvas1) Cls DrawPixmap Pix,0,0 If MouseInCanvas1 Then DrawCursor(mx1,my1,xsize, ysize) EndIf Flip End Function |