Beispiel #1
0
        void CalculateEnterLeaveEvent(MouseMoveNotification arg, IReadOnlyList <IUIElement> pickedViews)
        {
            FEnteredViews.Clear();
            FLeftViews = FHoveredViews.ToList();
            FHoveredViews.Clear();

            if (pickedViews.Any())
            {
                //add new views
                foreach (var view in LastOrDefaultAsSequence(pickedViews))
                {
                    FHoveredViews.Add(view);

                    if (!FLeftViews.Remove(view))
                    {
                        FEnteredViews.Add(view);
                    }
                }

                //remove old views
                foreach (var view in FLeftViews)
                {
                    FHoveredViews.Remove(view);
                }

                ViewsEnteredOrLeft(FEnteredViews, FLeftViews);
            }
            else
            {
                FHoveredViews.Clear();
                ViewsEnteredOrLeft(FEnteredViews, FLeftViews);
            }
        }
Beispiel #2
0
        void OnSelection(MouseMoveNotification mn, RectangleF selection)
        {
            FSelectionRect = selection;
            var leftovers = FSelectedElements.ToList();
            var picks     = GetPickPath(selection);

            foreach (var pick in picks)
            {
                if (!FSelectedElements.Contains(pick))
                {
                    FSelectedElements.Add(pick);
                    pick.Select();
                }

                leftovers.Remove(pick);
            }

            if (!mn.CtrlKey)
            {
                foreach (var item in leftovers)
                {
                    item.Deselect();
                    FSelectedElements.Remove(item);
                }
            }
        }
Beispiel #3
0
 public IMouseHandler MouseMove(MouseMoveNotification arg)
 {
     if (this.onMouseMove != null)
     {
         return(this.onMouseMove(this, arg));
     }
     return(null);
 }
Beispiel #4
0
        IUIHandler OnMouseMove(MouseMoveNotification mn)
        {
            CalculateEnterLeaveEvent(mn, FPickPath);

            foreach (var item in FHoveredViews)
            {
                item.Hover(mn);
            }

            return(null);
        }
Beispiel #5
0
 public IMouseHandler MouseMove(MouseMoveNotification arg)
 {
     if (Handler != null)
     {
         Handler = Handler.MouseMove(arg);
     }
     if (Handler == null)
     {
         return(this.continuation(arg));
     }
     return(this);
 }
Beispiel #6
0
 public IMouseHandler MouseMove(MouseMoveNotification arg)
 {
     if (Left != null)
     {
         Left = Left.MouseMove(arg);
     }
     if (Right != null)
     {
         Right = Right.MouseMove(arg);
     }
     return(ThisIfLeftAndRightIsNotNull());
 }
Beispiel #7
0
        public void Evaluate(int spreadMax)
        {
            var binCount = BinSizePin.IOObject.Length;

            FSubjects.ResizeAndDispose(binCount);
            MouseOut.ResizeAndDismiss(binCount, slice => new Mouse(FSubjects[slice]));
            for (int bin = 0; bin < binCount; bin++)
            {
                var subject           = FSubjects[bin];
                var notificationCount = EventTypeIn[bin].SliceCount;
                for (int i = 0; i < notificationCount; i++)
                {
                    var position = PositionIn[bin][i].ToMousePoint();
                    MouseNotification notification;
                    switch (EventTypeIn[bin][i])
                    {
                    case MouseNotificationKind.MouseDown:
                        notification = new MouseDownNotification(position, MouseExtensions.ClientArea, GetMouseButtons(bin, i));
                        break;

                    case MouseNotificationKind.MouseUp:
                        notification = new MouseUpNotification(position, MouseExtensions.ClientArea, GetMouseButtons(bin, i));
                        break;

                    case MouseNotificationKind.MouseMove:
                        notification = new MouseMoveNotification(position, MouseExtensions.ClientArea);
                        break;

                    case MouseNotificationKind.MouseWheel:
                        notification = new MouseWheelNotification(position, MouseExtensions.ClientArea, MouseWheelIn[bin][i]);
                        break;

                    case MouseNotificationKind.MouseClick:
                        notification = new MouseClickNotification(position, MouseExtensions.ClientArea, GetMouseButtons(bin, i), Math.Max(ClickCountIn[bin][i], 1));
                        break;

                    default:
                        throw new NotImplementedException();
                    }
                    if (notification != null)
                    {
                        subject.OnNext(notification);
                    }
                }
            }
        }
Beispiel #8
0
 IUIHandler OnMouseMove(MouseMoveNotification mn)
 {
     return(this);
 }
Beispiel #9
0
 IUIHandler OnMouseMoveUnhover(MouseMoveNotification mn)
 {
     CalculateEnterLeaveEvent(mn, FHoveredViews.Where(elem => elem.HitTest(mn.Position.GetUnitRect())).ToList());
     return(null);
 }
Beispiel #10
0
 public IMouseKeyboardHandler MouseMove(MouseMoveNotification arg)
 {
     return(FHandler.MouseMove(arg) ? this : null);
 }