Beispiel #1
0
		public static Point GetLocation (NSView view, NSEvent theEvent)
		{
			var loc = view.ConvertPointFromView (theEvent.LocationInWindow, null);
			if (!view.IsFlipped)
				loc.Y = view.Frame.Height - loc.Y;
			return Generator.ConvertF (loc);
		}
Beispiel #2
0
 public static PointF GetMouseLocation(NSView view, NSEvent theEvent)
 {
     return view.ConvertPointFromView(theEvent.LocationInWindow, null);
 }    
		public override NSCellHit HitTest (NSEvent forEvent, RectangleF inRect, NSView ofView)
		{
			PointF point = ofView.ConvertPointFromView (forEvent.LocationInWindow, null);

			if (_image != null) {
				RectangleF imageFrame;
				inRect.Divide(3 + _image.Size.Width, CGRectEdge.MinXEdge, out imageFrame, out inRect);

				imageFrame.X += 3;
				imageFrame.Size = _image.Size;
				if (ofView.MouseinRect(point, imageFrame))
					return NSCellHit.ContentArea;
			}

			return base.HitTest (forEvent, inRect, ofView);
		}