Ejemplo n.º 1
0
        protected override void OnPointerReleased(PointerReleasedEventArgs e)
        {
            var left  = e.GetCurrentPoint(this).Properties.IsLeftButtonPressed;
            var right = e.GetCurrentPoint(this).Properties.IsRightButtonPressed;

            engine?.inputManager.mouse.MouseUp((left ? MouseButton.Left : MouseButton.None) | (right ? MouseButton.Right : MouseButton.None));
            base.OnPointerReleased(e);
        }
Ejemplo n.º 2
0
        async void MouseUp(object sender, PointerReleasedEventArgs e)
        {
            PointerUpdateKind MouseButton = e.GetCurrentPoint(this).Properties.PointerUpdateKind;

            if (mouseHeld)
            {
                if (MouseButton == PointerUpdateKind.LeftButtonReleased)
                {
                    bool remove = false;

                    if (File.Exists(_path))
                    {
                        Opened?.Invoke(_path);
                    }
                    else
                    {
                        remove = await ShouldRemove();
                    }

                    if (remove)
                    {
                        Removed?.Invoke(this, _path);
                    }
                }
                else if (MouseButton == PointerUpdateKind.RightButtonReleased)
                {
                    ((ApolloContextMenu)this.Resources["InfoContextMenu"]).Open((Control)sender);
                }

                mouseHeld = false;
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// just sets the is <see cref="_isMouseDownOverEllipse"/> flag
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void EllipsePointer_MouseLeftButtonUp(object sender, PointerReleasedEventArgs e)
 {
     if (e.GetCurrentPoint(_ellipsePointer).Properties.IsLeftButtonPressed == false)
     {
         _isMouseDownOverEllipse = false;
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// is the left button is pressed e.handled is set to true
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void CanvasColor_MouseLeftButtonUp(object sender, PointerReleasedEventArgs e)
 {
     if (e.GetCurrentPoint(_ellipsePointer).Properties.IsLeftButtonPressed == false)
     {
         e.Handled = true;
     }
 }
Ejemplo n.º 5
0
        void MouseUp(object sender, PointerReleasedEventArgs e)
        {
            PointerUpdateKind MouseButton = e.GetCurrentPoint(this).Properties.PointerUpdateKind;

            if (MouseButton == PointerUpdateKind.LeftButtonReleased)
            {
                MouseMove(sender, e);

                if (old != null)
                {
                    Program.Project.Undo.Add(new MacroFilter.FilterUndoEntry(
                                                 _filter,
                                                 old.ToArray()
                                                 ));

                    old = null;
                }

                mouseHeld = false;
                mouseOver = null;

                e.Pointer.Capture(null);
                MacrosGrid.Cursor = new Cursor(StandardCursorType.Arrow);
            }
        }
Ejemplo n.º 6
0
        private async void OnCarPointerReleased(object sender, PointerReleasedEventArgs e)
        {
            var actualWidth = car.DesiredSize.Width;

            if (!double.IsNaN(actualWidth))
            {
                var pos  = e.GetCurrentPoint(sender as IVisual);
                var left = actualWidth / 2;
                try
                {
                    if (pos.Position.X >= left)
                    {
                        await vm.NextPageAsync();
                    }
                    else
                    {
                        await vm.PrevPageAsync();
                    }
                }
                catch (Exception ex)
                {
                    vm.ExceptionService.Exception = ex;
                }
            }
        }
Ejemplo n.º 7
0
        void MouseUp(object sender, PointerReleasedEventArgs e)
        {
            PointerUpdateKind MouseButton = e.GetCurrentPoint(this).Properties.PointerUpdateKind;

            if (MouseButton == PointerUpdateKind.LeftButtonReleased)
            {
                MouseMove(sender, e);

                if (old != null)
                {
                    bool[]     u    = old.ToArray();
                    bool[]     r    = _filter.Filter.ToArray();
                    List <int> path = Track.GetPath(_filter);

                    Program.Project.Undo.Add($"MacroFilter Changed", () => {
                        Track.TraversePath <MacroFilter>(path).Filter = u.ToArray();
                    }, () => {
                        Track.TraversePath <MacroFilter>(path).Filter = r.ToArray();
                    });

                    old = null;
                }

                mouseHeld = false;
                mouseOver = null;

                e.Pointer.Capture(null);
                MacrosGrid.Cursor = new Cursor(StandardCursorType.Arrow);
            }
        }
Ejemplo n.º 8
0
        protected override void OnPointerReleased(PointerReleasedEventArgs e)
        {
            if (_isDrawing || _isSelecting)
            {
                PointerPoint pp = e.GetCurrentPoint(this);
                switch (pp.Properties.PointerUpdateKind)
                {
                case PointerUpdateKind.LeftButtonReleased:
                {
                    _isDrawing = false;
                    e.Handled  = true;
                    break;
                }

                case PointerUpdateKind.RightButtonReleased:
                {
                    _isSelecting = false;
                    int  startX  = _selection.X;
                    int  startY  = _selection.Y;
                    int  width   = _selection.Width;
                    int  height  = _selection.Height;
                    bool changed = false;
                    for (int y = 0; y < Overworld.Block_NumTilesY; y++)
                    {
                        Blockset.Block.Tile[] arrY = Clipboard[y];
                        for (int x = 0; x < Overworld.Block_NumTilesX; x++)
                        {
                            Blockset.Block.Tile t = arrY[x];
                            if (x < width && y < height)
                            {
                                Blockset.Block.Tile got = SubLayerModel.GetTile(_block, _eLayerNum, _subLayerNum, startX + x, startY + y);
                                if (got != null)
                                {
                                    if (!got.Equals(t))
                                    {
                                        changed = true;
                                        got.CopyTo(t);
                                    }
                                    continue;
                                }
                            }
                            if (t.TilesetTile != null)
                            {
                                changed = true;
                            }
                            t.TilesetTile = null;
                        }
                    }
                    if (changed)
                    {
                        ClipboardChanged?.Invoke(this, EventArgs.Empty);
                    }
                    InvalidateVisual();
                    e.Handled = true;
                    break;
                }
                }
            }
        }
Ejemplo n.º 9
0
        protected override void OnPointerReleased(PointerReleasedEventArgs e)
        {
            var p = e.GetCurrentPoint(this);

            if (DataContext is EditProjectVM ed)
            {
                ed.Canvas_MouseUp(ScreenPointToDominoCoordinates(p.Position), e);
            }
        }
Ejemplo n.º 10
0
        private void MouseUpCanvas(object sender, PointerReleasedEventArgs args)
        {
            if (args.GetCurrentPoint(this).Properties.IsRightButtonPressed)
            {
                return;
            }

            Cursor    = new Cursor(StandardCursorType.Arrow);
            isDragged = false;
        }
Ejemplo n.º 11
0
        void Click(object sender, PointerReleasedEventArgs e)
        {
            PointerUpdateKind MouseButton = e.GetCurrentPoint(this).Properties.PointerUpdateKind;

            if (MouseButton == PointerUpdateKind.RightButtonReleased)
            {
                ((ApolloContextMenu)this.Resources["TrackContextMenu"]).Open((Control)sender);
            }

            e.Handled = true;
        }
Ejemplo n.º 12
0
        void ResizeUp(object sender, PointerReleasedEventArgs e)
        {
            PointerUpdateKind MouseButton = e.GetCurrentPoint(this).Properties.PointerUpdateKind;

            if (MouseButton == PointerUpdateKind.LeftButtonReleased)
            {
                ResizeMove(sender, e);

                mouseHeld = false;
                e.Pointer.Capture(null);
            }
        }
Ejemplo n.º 13
0
        protected override void Click(PointerReleasedEventArgs e)
        {
            PointerUpdateKind MouseButton = e.GetCurrentPoint(this).Properties.PointerUpdateKind;

            if (MouseButton == PointerUpdateKind.LeftButtonReleased)
            {
                InvokeAdded();
            }
            else if (MouseButton == PointerUpdateKind.RightButtonReleased)
            {
                ((ApolloContextMenu)this.Resources["ActionContextMenu"]).Open(Icon);
            }
        }
Ejemplo n.º 14
0
        /// <inheritdoc />
        protected override void OnPointerReleased(PointerReleasedEventArgs e)
        {
            base.OnPointerReleased(e);
            if (e.Handled)
            {
                return;
            }

            PointerPoint point = e.GetCurrentPoint(this);

            if (HandlePointerEvent(point, Vector.Zero))
            {
                e.Handled = true;
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Handles the <see cref="E:PointerReleased" /> event.
        /// </summary>
        /// <param name="e">The <see cref="PointerReleasedEventArgs" /> instance containing the event data.</param>
        protected override void OnPointerReleased(PointerReleasedEventArgs e)
        {
            base.OnPointerReleased(e);

            if (e.GetCurrentPoint(null).Properties.PointerUpdateKind == PointerUpdateKind.LeftButtonReleased)
            {
                var hoveredItemContent = GetHoveredItem(e.GetPosition(this))?.Content;
                if (draggedItemContent != null && hoveredItemContent != null && hoveredItemContent != draggedItemContent)
                {
                    ItemDragged?.Invoke(draggedItemContent, hoveredItemContent);
                }
                ClearDragStyles();
                draggedItemContent = null;
                Cursor             = originalCursor;
            }
        }
Ejemplo n.º 16
0
        private void OnPointerReleased(object?sender, PointerReleasedEventArgs e)
        {
            switch (e.GetCurrentPoint(this).Properties.PointerUpdateKind)
            {
            case PointerUpdateKind.LeftButtonReleased:
            {
                LeftDown = false;
                break;
            }

            case PointerUpdateKind.RightButtonReleased:
            {
                RightDown = false;
                break;
            }
            }
        }
Ejemplo n.º 17
0
        void Click(object sender, PointerReleasedEventArgs e)
        {
            PointerUpdateKind MouseButton = e.GetCurrentPoint(this).Properties.PointerUpdateKind;

            if (MouseButton == PointerUpdateKind.RightButtonReleased)
            {
                if (sender == DropZoneBefore)
                {
                    ((ApolloContextMenu)this.Resources["DeviceContextMenuBefore"]).Open((Control)sender);
                }
                else if (sender == DropZoneAfter)
                {
                    ((ApolloContextMenu)this.Resources["DeviceContextMenuAfter"]).Open((Control)sender);
                }
            }

            e.Handled = true;
        }
Ejemplo n.º 18
0
        public void PhonemeCanvasPointerReleased(object sender, PointerReleasedEventArgs args)
        {
            if (editState == null)
            {
                return;
            }
            if (editState.MouseButton != args.InitialPressMouseButton)
            {
                return;
            }
            var canvas = (Canvas)sender;
            var point  = args.GetCurrentPoint(canvas);

            editState.Update(point.Pointer, point.Position);
            editState.End(point.Pointer, point.Position);
            editState = null;
            Cursor    = null;
        }
Ejemplo n.º 19
0
        void MouseUp(object sender, PointerReleasedEventArgs e)
        {
            PointerUpdateKind MouseButton = e.GetCurrentPoint(this).Properties.PointerUpdateKind;

            if (MouseButton == PointerUpdateKind.LeftButtonReleased)
            {
                MouseMove(sender, e);
                PadFinished?.Invoke(Array.IndexOf(Buttons, (IControl)sender));

                mouseHeld = false;
                if (mouseOver != null)
                {
                    MouseLeave(mouseOver);
                }
                mouseOver = null;

                e.Pointer.Capture(null);
                Root.Cursor = new Cursor(StandardCursorType.Arrow);
            }
        }
Ejemplo n.º 20
0
        protected override void OnPointerReleased(PointerReleasedEventArgs e)
        {
            var pt = e.GetCurrentPoint(this);

            if (pt.Properties.PointerUpdateKind == PointerUpdateKind.XButton1Released)
            {
                if (_frame.CanGoBack)
                {
                    _frame.GoBack();
                    e.Handled = true;
                }
            }
            else if (pt.Properties.PointerUpdateKind == PointerUpdateKind.XButton2Released)
            {
                if (_frame.CanGoForward)
                {
                    _frame.GoForward();
                    e.Handled = true;
                }
            }
            base.OnPointerReleased(e);
        }
Ejemplo n.º 21
0
 public void PartsCanvasPointerReleased(object sender, PointerReleasedEventArgs args)
 {
     if (partEditState != null)
     {
         if (partEditState.MouseButton != args.InitialPressMouseButton)
         {
             return;
         }
         var canvas = (Canvas)sender;
         var point  = args.GetCurrentPoint(canvas);
         partEditState.Update(point.Pointer, point.Position);
         partEditState.End(point.Pointer, point.Position);
         partEditState = null;
         Cursor        = null;
     }
     if (openPianoRollWindow)
     {
         pianoRollWindow?.Show();
         pianoRollWindow?.Activate();
         openPianoRollWindow = false;
     }
 }
Ejemplo n.º 22
0
        private void Parent_PointerReleaseEvent(object o, PointerReleasedEventArgs args)
        {
            var pointerProperties = args.GetCurrentPoint(_widget).Properties;

            PressedButtons[(int)args.InitialPressMouseButton - 1] = false;
        }