示例#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);
		}
示例#2
0
 public static PointF GetMouseLocation(NSView view, NSEvent theEvent)
 {
     return view.ConvertPointFromView(theEvent.LocationInWindow, null);
 }    
示例#3
0
		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);
		}