Пример #1
0
        public virtual IMouseEventHandler MouseMove(object sender, VMouseEventArgs arg)
        {
            if (pressed)
            {
                var point = MouseTransformInverse.TransformPoint(new PointF(arg.X, arg.Y));
                MouseDrag(sender, point, new PointF(point.X - LastPoint.X, point.Y - LastPoint.Y), DragCallCounter);

                var rect = new RectangleF(StartPoint, new SizeF(point.X - StartPoint.X, point.Y - StartPoint.Y));
                var x    = rect.X;
                var y    = rect.Y;
                var w    = Math.Abs(rect.Width);
                var h    = Math.Abs(rect.Height);

                if (rect.Width < 0)
                {
                    x = x + rect.Width;
                }
                if (rect.Height < 0)
                {
                    y = y + rect.Height;
                }

                MouseSelection(sender, new RectangleF(x, y, w, h));
                LastPoint = point;
                DragCallCounter++;
            }

            return(this);
        }
Пример #2
0
 public virtual IMouseEventHandler MouseDown(object sender, VMouseEventArgs arg)
 {
     pressed    = true;
     Button     = arg.Button;
     StartPoint = MouseTransformInverse.TransformPoint(new PointF(arg.X, arg.Y));
     LastPoint  = StartPoint;
     return(this);
 }
Пример #3
0
 public override IMouseEventHandler MouseDown(object sender, VMouseEventArgs arg)
 {
     foreach (var rect in FSelectedQuads)
     {
         rect.Unselect();
     }
     FSelectedQuads.Clear();
     FLabel.X = arg.X;
     FLabel.Y = arg.Y;
     return(base.MouseDown(sender, arg));
 }
Пример #4
0
 public override IMouseEventHandler MouseDown(object sender, VMouseEventArgs arg)
 {
     if (!FSelectedQuads.Contains(Instance))
     {
         foreach (var rect in FSelectedQuads)
         {
             rect.Unselect();
         }
         FSelectedQuads.Clear();
         Instance.Select();
         FSelectedQuads.Add(Instance);
     }
     return(base.MouseDown(sender, arg));
 }
Пример #5
0
 public override IMouseEventHandler MouseUp(object sender, VMouseEventArgs arg)
 {
     FLastSelection.Location = FRectTransform.Matrix.TransformPoint(FLastSelection.Location);
     foreach (var rect in FQuads)
     {
         if (FLastSelection.Contains(rect.GetRectangle()))
         {
             rect.Select();
             FSelectedQuads.Add(rect);
         }
     }
     Instance.SetRectangle(new RectangleF(-100, -100, 0, 0));
     FLabel.X = -1000;
     return(base.MouseUp(sender, arg));
 }
Пример #6
0
 public virtual IMouseEventHandler MouseUp(object sender, VMouseEventArgs arg)
 {
     pressed = false;
     MouseClick(sender, arg);
     return(null);
 }
Пример #7
0
 public virtual void MouseClick(object sender, VMouseEventArgs arg)
 {
 }