Example #1
0
 protected virtual void OnMouseMoved(MouseMovedEventArgs args)
 {
     if (MouseMoved != null)
     {
         MouseMoved(this, args);
     }
 }
Example #2
0
 protected override void OnMouseMoved(MouseMovedEventArgs args)
 {
     base.OnMouseMoved(args);
     if (buttonPressed)
     {
         OnSelectionChanged((int)args.Y - padding);
         QueueDraw();
     }
 }
Example #3
0
 protected override void OnMouseMoved(MouseMovedEventArgs args)
 {
     base.OnMouseMoved(args);
     if (buttonDown)
     {
         QueueDraw();
         selection = new Point(args.X - padding, args.Y - padding);
         OnSelectionChanged();
     }
 }
Example #4
0
 protected override void OnMouseMoved(MouseMovedEventArgs args)
 {
     // Clear previous overlay
     Rectangle focus = new Rectangle (lastCursor.X - 32, lastCursor.Y - 32, 64, 64);
     QueueDraw (focus);
     lastCursor.X = args.X;
     lastCursor.Y = args.Y;
     // Queue new overlay drawing
     focus = new Rectangle (lastCursor.X - 32, lastCursor.Y - 32, 64, 64);
     QueueDraw (focus);
     base.OnMouseMoved (args);
 }
Example #5
0
        private void HandleMouseMoved(object sender, MouseMovedEventArgs e)
        {
            if(lastX == null || lastY == null)
            {
                lastX = (int)e.X;
                lastY = (int)e.Y;
                return;
            }

            handler.MouseMoved((int)e.X, (int)e.Y, lastX.Value - (int)e.X, lastY.Value - (int)e.Y);
            lastX = (int)e.X;
            lastY = (int)e.Y;
        }
Example #6
0
        protected override void OnMouseMoved(MouseMovedEventArgs args)
        {
            base.OnMouseMoved(args);

            //if (mOver != args.X > 16)
            //{
            //    if (args.X > 16)
            //    {
            //        mOver = true;
            //        QueueDraw();
            //    }
            //    else
            //    {
            //        mOver = false;
            //        QueueDraw();
            //    }
            //}
        }
Example #7
0
 void HandleMotionNotifyEvent(object o, Gtk.MotionNotifyEventArgs args)
 {
     var sc = ConvertToScreenCoordinates (new Point (0, 0));
     var a = new MouseMovedEventArgs ((long) args.Event.Time, args.Event.XRoot - sc.X, args.Event.YRoot - sc.Y);
     ApplicationContext.InvokeUserCode (delegate {
         EventSink.OnMouseMoved (a);
     });
     if (a.Handled)
         args.RetVal = true;
 }
Example #8
0
 void HandleMotionNotifyEvent(object o, Gtk.MotionNotifyEventArgs args)
 {
     var sc = ConvertToScreenCoordinates (new Point (0, 0));
     var a = new MouseMovedEventArgs ((long) args.Event.Time, args.Event.XRoot - sc.X, args.Event.YRoot - sc.Y);
     Toolkit.Invoke (delegate {
         EventSink.OnMouseMoved (a);
     });
 }
Example #9
0
 void HandleMotionNotifyEvent(object o, Gtk.MotionNotifyEventArgs args)
 {
     var a = new MouseMovedEventArgs ((long) args.Event.Time, args.Event.X, args.Event.Y);
     Toolkit.Invoke (delegate {
         EventSink.OnMouseMoved (a);
     });
 }
Example #10
0
 protected override void OnMouseMoved(MouseMovedEventArgs args)
 {
     GradientButton B = Buttons.FirstOrDefault(X => CheckIfIn(args.Position, X));
     if (B != null && B != Layout.PrimaryButton && !this.AnimationIsRunning(""))
         Layout.MakePrimary(B);
 }
Example #11
0
 void HandleMotionNotifyEvent(object o, Gtk.MotionNotifyEventArgs args)
 {
     var a = new MouseMovedEventArgs ();
     a.X = args.Event.X;
     a.Y = args.Event.Y;
     Toolkit.Invoke (delegate {
         EventSink.OnMouseMoved (a);
     });
 }
Example #12
0
 void HandleMotionNotifyEvent(object o, Gtk.MotionNotifyEventArgs args)
 {
     var a = new MouseMovedEventArgs ((long) args.Event.Time, args.Event.X, args.Event.Y);
     ApplicationContext.InvokeUserCode (delegate {
         EventSink.OnMouseMoved (a);
     });
     if (a.Handled)
         args.RetVal = true;
 }
Example #13
0
        public override bool OnMouseMoved(MouseMovedEventArgs args, PlotCanvas pc)
        {
            Rectangle area = pc.PlotAreaBoundingBoxCache;

            if (dragging) {
                pc.CacheAxes();

                double dX = args.X - lastPoint.X;		// distance mouse has moved
                double dY = args.Y - lastPoint.Y;
                lastPoint = new Point (args.X, args.Y);

                // Axis translation required
                double xShift = -dX / area.Width;
                double yShift = +dY / area.Height;

                if (Horizontal) {
                    pc.TranslateXAxes (xShift);
                }
                if (Vertical) {
                    pc.TranslateYAxes (yShift);
                }
                return true;
            }
            return false;
        }
Example #14
0
        protected override void OnMouseMoved(MouseMovedEventArgs args)
        {
            mousePosition = new Point(args.X, args.Y);
            if (isEditMode && !Keyboard.CurrentModifiers.HasFlag(ModifierKeys.Shift)) {
                Point scaleFactor = new Point(
                                        scan.Size.Width / image.Size.Width,
                                        scan.Size.Height / image.Size.Height);

                if (pointer.HasFlag(Pointer.Left)) {
                    SetMask(
                        new Point(args.X * scaleFactor.X, args.Y * scaleFactor.Y),
                        Keyboard.CurrentModifiers.HasFlag(ModifierKeys.Control) ||
                        Keyboard.CurrentModifiers.HasFlag(ModifierKeys.Command)
                    );
                }

                QueueDraw();
            }

            if (Keyboard.CurrentModifiers.HasFlag(ModifierKeys.Shift)) {
                QueueDraw();
            }
        }
Example #15
0
 /// <summary>
 /// MouseMove method for PlotScroll
 /// </summary>
 public override bool OnMouseMoved(MouseMovedEventArgs args, PlotCanvas pc)
 {
     // delete previous focusPoint drawing
     pc.Canvas.QueueDraw (focusRect);
     return false;
 }
Example #16
0
		protected override void OnMouseMoved (MouseMovedEventArgs e)
		{
			if (draggingCursor) {
				double x, y;
				GetValue ((int)e.X, (int)e.Y, out x, out y);
				
				if (activeCursor.Dimension == AxisDimension.X) {
					if (x < startX) x = startX;
					else if (x > endX) x = endX;
					activeCursor.Value = x;
				}
				else {
					if (y < startY) y = startY;
					else if (y > endY) y = endY;
					activeCursor.Value = y;
				}
				return;
			}
			base.OnMouseMoved (e);
		}
Example #17
0
		protected override void OnMouseMoved (MouseMovedEventArgs e)
		{
			base.OnMouseMoved (e);

			Margin margin = GetMarginAtX ((int)e.X);
			
			if (margin != null)
				margin.MouseHover (new MarginMouseMovedEventArgs (this, margin, e));
		}
Example #18
0
        public override bool OnMouseMoved(MouseMovedEventArgs args, PlotCanvas pc)
        {
            Rectangle area = pc.PlotAreaBoundingBoxCache;

            if (scaling) {
                pc.CacheAxes();

                double dX = args.X - lastPoint.X;		// distance mouse has moved
                double dY = args.Y - lastPoint.Y;
                lastPoint = new Point (args.X, args.Y);

                // Alt key reduces sensitivity
                double factor = Sensitivity;
                if (key == Key.AltLeft || key == Key.AltRight) {
                    factor *= 0.25;	   // arbitrary change
                }

                double xProportion = +dX*factor/area.Width;
                double yProportion = -dY*factor/area.Height;
                if (Horizontal) {
                    pc.ZoomXAxes (xProportion, focusX);
                }
                if (Vertical) {
                    pc.ZoomYAxes (yProportion, focusY);
                }
                return true;
            }
            return false;
        }
Example #19
0
 public virtual bool OnMouseMoved(MouseMovedEventArgs args, PlotCanvas pc)
 {
     return false;
 }
Example #20
0
 protected virtual void OnMouseMoved(MouseMovedEventArgs args)
 {
     if (mouseMoved != null)
         mouseMoved (this, args);
 }
Example #21
0
 protected override void OnMouseMoved(MouseMovedEventArgs args)
 {
     var scaledPos = new Xwt.Point(args.X, args.Y);
     GradientButton B = Buttons.FirstOrDefault(X => CheckIfIn(scaledPos, X));
     if (B != null && B != Layout.PrimaryButton && !this.AnimationIsRunning(""))
         Layout.MakePrimary(B);
 }
Example #22
0
 public void OnMouseMoved(MouseMovedEventArgs args)
 {
     Parent.OnMouseMoved (args);
 }
Example #23
0
 protected override void OnMouseMoved(MouseMovedEventArgs args)
 {
     base.OnMouseMoved(args);
     mx = args.X;
     QueueDraw();
 }
		async void Editor_MouseMoved (object sender, MouseMovedEventArgs e)
		{
			if (e != null) {
				x = e.X;
				y = e.Y;
			}
			if (LinksShown) {
				var lineNumber = Editor.PointToLocation (x, y).Line;
				var line = Editor.GetLine (lineNumber);
				if (visibleLines.Any (l => l.Equals (line))) {
					return;
				}
				visibleLines.Add (line);
				var segments = await RequestLinksAsync (line.Offset, line.Length, default (CancellationToken));
				await Runtime.RunInMainThread (delegate {
					foreach (var segment in segments) {
						var marker = Editor.TextMarkerFactory.CreateLinkMarker (Editor, segment.Offset, segment.Length, delegate { segment.Activate (); });
						marker.OnlyShowLinkOnHover = true;
						Editor.AddMarker (marker);
						markers.Add (marker);
					}
				});
			}
		}
Example #25
0
		protected override void OnMouseMoved (MouseMovedEventArgs args)
		{
			base.OnMouseMoved (args);
			if (buttonDown) {
				QueueDraw ();
				selection = new Point (args.X - padding, args.Y - padding);
				OnSelectionChanged ();
			}
		}
Example #26
0
 protected override void OnMouseMoved(MouseMovedEventArgs args)
 {
     SetFocus ();
     bool modified = false;
     foreach (Interaction interaction in plotCanvas.interactions) {
         modified |= interaction.OnMouseMoved (args, plotCanvas);
     }
     CheckForRedraw (modified);
 }
Example #27
0
		protected override void OnMouseMoved (MouseMovedEventArgs args)
		{
			xStart = args.X;
			xEnd = Bounds.Width - xStart;	// Change gradient endpoints
			QueueDraw ();
		}
Example #28
0
 protected override void OnMouseMoved(MouseMovedEventArgs args)
 {
     var data = GetValue (ValueField);
     data.Value = (int) (100 * ((args.X - Bounds.X) / Bounds.Width));
     data.YPos = args.Y - Bounds.Y;
     QueueDraw ();
     base.OnMouseMoved (args);
 }
Example #29
0
 public void OnMouseMoved(MouseMovedEventArgs args)
 {
     Parent.OnMouseMoved(args);
 }
		async void Editor_MouseMoved (object sender, MouseMovedEventArgs e)
		{
			if (e != null) {
				x = e.X;
				y = e.Y;
			}
			CancelRequestLinks ();
			var token = src.Token;
			if (LinksShown) {
				var lineNumber = Editor.PointToLocation (x, y).Line;
				var line = Editor.GetLine (lineNumber);
				if (visibleLines.Any (l => l.Equals (line))) {
					return;
				}
				visibleLines.Add (line);

				IEnumerable<NavigationSegment> segments;
				try {
					segments = await RequestLinksAsync (line.Offset, line.Length, token).ConfigureAwait (false);
				} catch (OperationCanceledException) {
					return;
				} catch (Exception ex) {
					LoggingService.LogError ("Error while requestling navigation links", ex);
					return;
				}
				if (segments == null)
					return;
				await Runtime.RunInMainThread (delegate {
					try {
						foreach (var segment in segments) {
							if (token.IsCancellationRequested) {
								return;
							}
							var marker = Editor.TextMarkerFactory.CreateLinkMarker (Editor, segment.Offset, segment.Length, delegate { segment.Activate (); });
							marker.OnlyShowLinkOnHover = true;
							Editor.AddMarker (marker);
							markers.Add (marker);
						}
					} catch (Exception ex) {
						LoggingService.LogError ("Error while creating navigation line markers", ex);
					}
				});
			}
		}
Example #31
0
 public void OnMouseMoved(MouseMovedEventArgs args)
 {
     ((Canvas)Parent).OnMouseMoved (args);
 }
Example #32
0
 public void OnMouseMoved(MouseMovedEventArgs args)
 {
     ((Canvas)Parent).OnMouseMoved(args);
 }
Example #33
0
        /// <summary>
        /// OnMouseMoved method for AxisScale interaction
        /// </summary>
        public override bool OnMouseMoved(MouseMovedEventArgs args, PlotCanvas pc)
        {
            if (dragging && physicalAxis != null) {
                pc.CacheAxes();

                double dX = (args.X - lastPoint.X);
                double dY = (args.Y - lastPoint.Y);
                lastPoint = new Point (args.X, args.Y);

                // In case the physical axis is not horizontal/vertical, combine dX and dY
                // in a way which preserves their sign and intuitive axis zoom sense, ie
                // because the physical origin is top-left, expand with +ve dX, but -ve dY
                double distance = dX - dY;
                double proportion = distance*Sensitivity /physicalAxis.PhysicalLength;
                axis.IncreaseRange (proportion, focusRatio);
                return true;
            }
            return false;
        }
Example #34
0
		protected override void OnMouseMoved (MouseMovedEventArgs args)
		{
			base.OnMouseMoved (args);
			if (buttonPressed) {
				OnSelectionChanged ((int)args.Y - padding);
				QueueDraw ();
			}
		}
Example #35
0
		public MarginMouseMovedEventArgs (HexEditor editor, Margin margin, MouseMovedEventArgs args)
		{
			this.margin = margin;
			this.Editor = editor;
			this.Args = args;
		}