Ejemplo n.º 1
0
        protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs mouseEvent)
        {
            base.OnMouseMove(mouseEvent);

            int Y = mouseEvent.Y;

            if (m_app.FlipY())
            {
                Y = (int)m_app.RenderBufferWindow.Height() - Y;
            }
            Pictor.UI.MouseEventArgs PictorMouseEvent = new Pictor.UI.MouseEventArgs((Pictor.UI.MouseButtons)mouseEvent.Button, mouseEvent.Clicks, mouseEvent.X, Y, mouseEvent.Delta);

            m_app.OnMouseMove(PictorMouseEvent);
            if (PictorMouseEvent.Handled)
            {
                m_app.OnControlChanged();
                m_app.ForceRedraw();
            }
            else
            {
                if (!m_app.InRect(PictorMouseEvent.X, PictorMouseEvent.Y))
                {
                    m_app.OnMouseMove(PictorMouseEvent);
                }
            }
        }
Ejemplo n.º 2
0
        public override void OnMouseMove(Pictor.UI.MouseEventArgs mouseEvent)
        {
            if (mouseEvent.Button == Pictor.UI.MouseButtons.Left)
            {
                if (m_idx >= 0)
                {
                    m_x[m_idx] = mouseEvent.X - m_dx;
                    m_y[m_idx] = mouseEvent.Y - m_dy;
                    ForceRedraw();
                }
            }

            base.OnMouseMove(mouseEvent);
        }
Ejemplo n.º 3
0
        public override void OnMouseDown(Pictor.UI.MouseEventArgs mouseEvent)
        {
            if (mouseEvent.Button == Pictor.UI.MouseButtons.Left)
            {
                for (int i = 0; i < 2; i++)
                {
                    double x = mouseEvent.X;
                    double y = mouseEvent.Y;
                    if (System.Math.Sqrt((x - m_x[i]) * (x - m_x[i]) + (y - m_y[i]) * (y - m_y[i])) < 5.0)
                    {
                        m_dx  = x - m_x[i];
                        m_dy  = y - m_y[i];
                        m_idx = i;
                        break;
                    }
                }
            }

            base.OnMouseDown(mouseEvent);
        }
        protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs mouseEvent)
        {
            base.OnMouseUp(mouseEvent);

            int Y = mouseEvent.Y;
            if (m_app.FlipY())
            {
                Y = (int)m_app.RenderBufferWindow.Height() - Y;
            }
            Pictor.UI.MouseEventArgs PictorMouseEvent = new Pictor.UI.MouseEventArgs((Pictor.UI.MouseButtons)mouseEvent.Button, mouseEvent.Clicks, mouseEvent.X, Y, mouseEvent.Delta);

            m_app.OnMouseUp(PictorMouseEvent);
            if (PictorMouseEvent.Handled)
            {
                m_app.OnControlChanged();
                m_app.ForceRedraw();
            }
            m_app.OnMouseUp(PictorMouseEvent);
        }
Ejemplo n.º 5
0
 override public void OnMouseUp(Pictor.UI.MouseEventArgs mouseEvent)
 {
     m_idx = -1;
     base.OnMouseUp(mouseEvent);
 }