示例#1
0
 public override void OnMouseDown(MouseEventArgs mouseEvent)
 {
     double x = mouseEvent.X;
     double y = mouseEvent.Y;
     GetTransform().InverseTransform(ref x, ref y);
     if (Bounds.HitTest(x, y))
     {
         m_status = !m_status;
         mouseEvent.Handled = true;
     }
 }
示例#2
0
 public override void OnMouseUp(MouseEventArgs mouseEvent)
 {
 }
示例#3
0
        public override void OnMouseMove(MouseEventArgs mouseEvent)
        {
            double x = mouseEvent.X;
            double y = mouseEvent.Y;
            GetTransform().InverseTransform(ref x, ref y);

            if (m_mouse_move)
            {
                double xp = x + m_pdx;
                m_preview_value = (xp - m_xs1) / (m_xs2 - m_xs1);
                if (m_preview_value < 0.0) m_preview_value = 0.0;
                if (m_preview_value > 1.0) m_preview_value = 1.0;
                mouseEvent.Handled = true;
            }
        }
示例#4
0
 public override void OnMouseUp(MouseEventArgs mouseEvent)
 {
     if (m_mouse_move)
     {
         m_mouse_move = false;
         NormalizeValue(true);
         mouseEvent.Handled = true;
     }
 }
示例#5
0
        public override void OnMouseMove(MouseEventArgs mouseEvent)
        {
            double x = mouseEvent.X;
            double y = mouseEvent.Y;

            if (mouseEvent.Button == MouseButtons.Left && IsOverTitleBar(x, y))
            {
                double dx = mouseX - x;
                double dy = mouseY - y;
                double totalExtra = BorderWidth + TextPadding;
                Affine transform = GetTransform();
                transform.Translate(-dx, -dy);
                SetTransform(transform);
                m_Bounds.Left -= dx;
                m_Bounds.Right -= dx;
                m_Bounds.Top -= dy;
                m_Bounds.Bottom -= dy;
                mouseEvent.Handled = true;
            }
            mouseX = x;
            mouseY = y;
            Invalidate();
        }
示例#6
0
        public override void OnMouseDown(MouseEventArgs mouseEvent)
        {
            double x = mouseEvent.X;
            double y = mouseEvent.Y;
            GetTransform().InverseTransform(ref x, ref y);

            double xp = m_xs1 + (m_xs2 - m_xs1) * m_value;
            double yp = (m_ys1 + m_ys2) / 2.0;

            if (IsOver(x, y))
            {
                m_pdx = xp - x;
                m_mouse_move = true;
                mouseEvent.Handled = true;
            }
        }
示例#7
0
 public virtual void OnMouseMove(MouseEventArgs mouseEvent)
 {
     foreach (UIWidget child in children)
     {
         if (child.Visible)
         {
             child.OnMouseMove(mouseEvent);
         }
     }
 }
示例#8
0
 public virtual void OnMouseUp(MouseEventArgs mouseEvent)
 {
     for (int i = 0; i < children.Count; i++)
     {
         if (children[i].Visible)
         {
             children[i].OnMouseUp(mouseEvent);
         }
     }
 }
示例#9
0
 public virtual void OnMouseDown(MouseEventArgs mouseEvent)
 {
     int i = 0;
     foreach (UIWidget child in children)
     {
         if (child.Visible)
         {
             child.OnMouseDown(mouseEvent);
             if (child.InRect(mouseEvent.X, mouseEvent.Y))
             {
                 if (child.CanFocus)
                 {
                     child.Focus();
                 }
                 return;
             }
         }
         i++;
     }
 }
示例#10
0
        public override void OnMouseUp(MouseEventArgs mouseEvent)
        {
            if (MouseDownOnButton
              && InRect(mouseEvent.X, mouseEvent.Y))
            {
                if (ButtonClick != null)
                {
                    ButtonClick(this);
                }
                mouseEvent.Handled = true;
            }

            MouseDownOnButton = false;
        }
示例#11
0
 public override void OnMouseMove(MouseEventArgs mouseEvent)
 {
     if (InRect(mouseEvent.X, mouseEvent.Y))
     {
         if (!MouseOverButton)
         {
             MouseOverButton = true;
             if (m_DrawHoverEffect)
             {
                 Invalidate();
             }
         }
     }
     else
     {
         if (MouseOverButton)
         {
             MouseOverButton = false;
             if (m_DrawHoverEffect)
             {
                 Invalidate();
             }
         }
     }
 }
示例#12
0
 public override void OnMouseDown(MouseEventArgs mouseEvent)
 {
     if (InRect(mouseEvent.X, mouseEvent.Y))
     {
         MouseDownOnButton = true;
         MouseOverButton = true;
         mouseEvent.Handled = true;
     }
     else
     {
         MouseDownOnButton = false;
     }
 }
示例#13
0
 //public MouseEventArgs(MouseButtons button, int clicks, int x, int y, int wheelDelta)
 //: this
 public MouseEventArgs(MouseEventArgs original, double newX, double newY)
     : this(original.Button, original.Clicks, newX, newY, original.WheelDelta)
 {
 }