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); }
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; } }
/// <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; } }
/// <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; } }
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); } }
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; } } }
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); } }
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; } } } }
protected override void OnPointerReleased(PointerReleasedEventArgs e) { var p = e.GetCurrentPoint(this); if (DataContext is EditProjectVM ed) { ed.Canvas_MouseUp(ScreenPointToDominoCoordinates(p.Position), e); } }
private void MouseUpCanvas(object sender, PointerReleasedEventArgs args) { if (args.GetCurrentPoint(this).Properties.IsRightButtonPressed) { return; } Cursor = new Cursor(StandardCursorType.Arrow); isDragged = false; }
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; }
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); } }
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); } }
/// <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; } }
/// <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; } }
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; } } }
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; }
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; }
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); } }
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); }
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; } }
private void Parent_PointerReleaseEvent(object o, PointerReleasedEventArgs args) { var pointerProperties = args.GetCurrentPoint(_widget).Properties; PressedButtons[(int)args.InitialPressMouseButton - 1] = false; }