/// <summary> /// Raises the <see cref="E:System.Windows.Forms.Control.MouseWheel"/> event. /// </summary> /// <param name="e"> /// A <see cref="T:System.Windows.Forms.MouseEventArgs"/> that contains the event data. /// </param> protected override void OnMouseWheel(MouseEventArgs e) { base.OnMouseWheel(e); bool isControlDown = ModifierKeys == Keys.Control; var m = new ZoomStepManipulator(this, e.Delta * 0.001, isControlDown); m.Started(new ManipulationEventArgs(e.Location.ToScreenPoint())); }
/// <summary> /// Zooms the view by the mouse wheel delta in the specified <see cref="OxyKeyEventArgs" />. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyMouseWheelEventArgs" /> instance containing the event data.</param> /// <param name="factor">The zoom speed factor. Default value is 1.</param> private static void HandleZoomByWheel(IPlotView view, OxyMouseWheelEventArgs args, double factor = 1) { var m = new ZoomStepManipulator(view) { Step = args.Delta * 0.001 * factor, FineControl = args.IsControlDown }; m.Started(args); }
/// <summary> /// Zooms the view by the specified factor at the position specified in the <see cref="OxyMouseEventArgs" />. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyMouseWheelEventArgs" /> instance containing the event data.</param> /// <param name="delta">The zoom factor.</param> private static void HandleZoomAt(IPlotView view, OxyMouseEventArgs args, double delta) { var m = new ZoomStepManipulator(view) { Step = delta, FineControl = args.IsControlDown }; m.Started(args); }
/// <summary> /// Called before the <see cref="E:System.Windows.UIElement.MouseWheel"/> event occurs to provide handling for the event in a derived class without attaching a delegate. /// </summary> /// <param name="e"> /// A <see cref="T:System.Windows.Input.MouseWheelEventArgs"/> that contains the event data. /// </param> protected override void OnMouseWheel(MouseWheelEventArgs e) { base.OnMouseWheel(e); if (!this.IsMouseWheelEnabled) { return; } bool isControlDown = IsControlDown(); var m = new ZoomStepManipulator(this, e.Delta * 0.001, isControlDown); m.Started(new ManipulationEventArgs(e.GetPosition(this).ToScreenPoint())); }
/// <summary> /// Called before the PointerWheelChanged event occurs. /// </summary> /// <param name="e"> /// Event data for the event. /// </param> protected override void OnPointerWheelChanged(PointerRoutedEventArgs e) { base.OnPointerWheelChanged(e); if (!this.IsMouseWheelEnabled) { return; } var point = e.GetCurrentPoint(this); var delta = point.Properties.MouseWheelDelta; var position = point.Position; var control = (e.KeyModifiers & VirtualKeyModifiers.Control) == VirtualKeyModifiers.Control; var m = new ZoomStepManipulator(this, delta * 0.001, control); m.Started(new ManipulationEventArgs(position.ToScreenPoint())); }
/// <summary> /// Called before the PointerWheelChanged event occurs. /// </summary> /// <param name="e"> /// Event data for the event. /// </param> protected override void OnPointerWheelChanged(PointerRoutedEventArgs e) { base.OnPointerWheelChanged(e); if (!this.IsMouseWheelEnabled) { return; } var point = e.GetCurrentPoint(this); var delta = point.Properties.MouseWheelDelta; var position = point.Position; var control = (e.KeyModifiers & VirtualKeyModifiers.Control) == VirtualKeyModifiers.Control; var m = new ZoomStepManipulator(this, delta * 0.001, control); m.Started(new ManipulationEventArgs(position.ToScreenPoint())); }
/// <summary> /// Raises the <see cref="E:System.Windows.Forms.Control.MouseWheel"/> event. /// </summary> /// <param name="e"> /// A <see cref="T:System.Windows.Forms.MouseEventArgs"/> that contains the event data. /// </param> protected override void OnMouseWheel(MouseEventArgs e) { base.OnMouseWheel(e); bool isControlDown = ModifierKeys == Keys.Control; var m = new ZoomStepManipulator(this, e.Delta * 0.001, isControlDown); m.Started(new ManipulationEventArgs(e.Location.ToScreenPoint())); }
/// <summary> /// Called before the <see cref="E:System.Windows.UIElement.MouseWheel"/> event occurs to provide handling for the event in a derived class without attaching a delegate. /// </summary> /// <param name="e"> /// A <see cref="T:System.Windows.Input.MouseWheelEventArgs"/> that contains the event data. /// </param> protected override void OnMouseWheel(MouseWheelEventArgs e) { base.OnMouseWheel(e); if (!this.IsMouseWheelEnabled) { return; } bool isControlDown = IsControlDown(); var m = new ZoomStepManipulator(this, e.Delta * 0.001, isControlDown); m.Started(new ManipulationEventArgs(e.GetPosition(this).ToScreenPoint())); }
/// <summary> /// Zooms the view by the mouse wheel delta in the specified <see cref="OxyKeyEventArgs" />. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyMouseWheelEventArgs" /> instance containing the event data.</param> /// <param name="factor">The zoom speed factor. Default value is 1.</param> private static void HandleZoomByWheel(IPlotView view, OxyMouseWheelEventArgs args, double factor = 1) { var m = new ZoomStepManipulator(view) { Step = args.Delta * 0.001 * factor, FineControl = args.IsControlDown }; m.Started(args); }
/// <summary> /// Zooms the view by the specified factor at the position specified in the <see cref="OxyMouseEventArgs" />. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyMouseWheelEventArgs" /> instance containing the event data.</param> /// <param name="delta">The zoom factor.</param> private static void HandleZoomAt(IPlotView view, OxyMouseEventArgs args, double delta) { var m = new ZoomStepManipulator(view) { Step = delta, FineControl = args.IsControlDown }; m.Started(args); }
/// <summary> /// Invoked when an unhandled MouseWheel attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. /// </summary> /// <param name="e"> /// The <see cref="T:System.Windows.Input.MouseWheelEventArgs"/> that contains the event data. /// </param> protected override void OnMouseWheel(MouseWheelEventArgs e) { base.OnMouseWheel(e); if (e.Handled) { return; } if (!this.IsMouseWheelEnabled) { return; } bool isControlDown = Keyboard.IsKeyDown(Key.LeftCtrl); //// bool isShiftDown = Keyboard.IsKeyDown(Key.LeftShift); //// bool isAltDown = Keyboard.IsKeyDown(Key.LeftAlt); var m = new ZoomStepManipulator(this, e.Delta * 0.001, isControlDown); m.Started(new ManipulationEventArgs(e.GetPosition(this).ToScreenPoint())); e.Handled = true; }