Пример #1
0
        public static MouseEventArgs GetMouseEvent(NSView view, NSEvent theEvent, bool includeWheel)
        {
            var          pt        = Conversions.GetLocation(view, theEvent);
            Keys         modifiers = KeyMap.GetModifiers(theEvent);
            MouseButtons buttons   = theEvent.GetMouseButtons();
            SizeF?       delta     = null;

            if (includeWheel)
            {
                delta = new SizeF((float)theEvent.DeltaX, (float)theEvent.DeltaY);
            }
            return(new MouseEventArgs(buttons, modifiers, pt, delta));
        }
Пример #2
0
        public static MouseEventArgs GetMouseEvent(IMacViewHandler handler, NSEvent theEvent, bool includeWheel)
        {
            var view = handler.ContainerControl;
            var pt   = theEvent.LocationInWindow;

            pt = handler.GetAlignmentPointForFramePoint(pt);
            Keys         modifiers = theEvent.ModifierFlags.ToEto();
            MouseButtons buttons   = theEvent.GetMouseButtons();
            SizeF?       delta     = null;

            if (includeWheel)
            {
                delta = new SizeF((float)theEvent.DeltaX, (float)theEvent.DeltaY);
            }
            return(new MouseEventArgs(buttons, modifiers, pt.ToEto(view), delta));
        }
Пример #3
0
		public static MouseEventArgs GetMouseEvent(NSView view, NSEvent theEvent, bool includeWheel)
		{
			var pt = MacConversions.GetLocation(view, theEvent);
			Keys modifiers = theEvent.ModifierFlags.ToEto();
			MouseButtons buttons = theEvent.GetMouseButtons();
			SizeF? delta = null;
			if (includeWheel)
				delta = new SizeF((float)theEvent.DeltaX, (float)theEvent.DeltaY);
			return new MouseEventArgs(buttons, modifiers, pt, delta);
		}
Пример #4
0
		public static MouseEventArgs GetMouseEvent(NSView view, NSEvent theEvent, bool includeWheel)
		{
			var pt = Conversions.GetLocation(view, theEvent);
			Key modifiers = KeyMap.GetModifiers(theEvent);
			MouseButtons buttons = theEvent.GetMouseButtons();
			SizeF? delta = null;
			if (includeWheel)
				delta = new SizeF(theEvent.DeltaX, theEvent.DeltaY);
			return new MouseEventArgs(buttons, modifiers, pt, delta);
		}