Exemple #1
0
        private static void _OnMotion(int x, int y)
        {
            Window w = null;

            if (mvarLastFullscreenWindow != null)
            {
                w = mvarLastFullscreenWindow;
            }
            else
            {
                int handle = Internal.FreeGLUT.Methods.glutGetWindow();
                w = handleWindows[handle];
            }
            MouseEventArgs args = new MouseEventArgs(MouseButton.None, x, y);

            if (w._motionCtl != null)
            {
                w._motionCtl.OnMouseMove(args);
            }
            else
            {
                Control2D ctl = w.HitTest(x, y);
                if (ctl != null)
                {
                    args = new MouseEventArgs(MouseButton.None, (int)(x - ctl.Position.X), (int)(y - ctl.Position.Y));
                    ctl.OnMouseMove(args);
                }
                else
                {
                    w.OnMouseMove(args);
                }
            }
        }
Exemple #2
0
 protected internal override void OnMouseMove(Input.Mouse.MouseEventArgs e)
 {
     base.OnMouseMove(e);
     if (mvarMoving)
     {
         base.Position = new PositionVector2((e.X - dx), (e.Y - dy));
         base.Parent.Refresh();
     }
     else
     {
         Control2D ctl = HitTest(e.X, e.Y);
         if (ctl != null)
         {
             MouseEventArgs args = new MouseEventArgs(e.Buttons, (int)(e.X - ctl.Position.X + mvarOffsetX), (int)(e.Y - ctl.Position.Y + mvarOffsetY));
             // args = new MouseEventArgs(e.Buttons, (int)(e.X), (int)(e.Y));
             ctl.OnMouseMove(args);
         }
     }
 }