Пример #1
0
        void CreateTracking()
        {
            if (!mouseMove)
            {
                return;
            }
            if (tracking != null)
            {
                EventControl.RemoveTrackingArea(tracking);
            }
            //Console.WriteLine ("Adding mouse tracking {0} for area {1}", this.Widget.GetType ().FullName, Control.Frame.Size);
            if (mouseDelegate == null)
            {
                mouseDelegate = new MouseDelegate {
                    Handler = this
                }
            }
            ;
            var options = mouseOptions | NSTrackingAreaOptions.ActiveAlways | NSTrackingAreaOptions.EnabledDuringMouseDrag | NSTrackingAreaOptions.InVisibleRect;

            tracking = new NSTrackingArea(new CGRect(CGPoint.Empty, EventControl.Frame.Size), options, mouseDelegate, new NSDictionary());
            EventControl.AddTrackingArea(tracking);
        }
Пример #2
0
 void CreateTracking()
 {
     if (!mouseMove)
     {
         return;
     }
     if (tracking != null)
     {
         EventControl.RemoveTrackingArea(tracking);
     }
     //Console.WriteLine ("Adding mouse tracking {0} for area {1}", this.Widget.GetType ().FullName, Control.Frame.Size);
     if (mouseDelegate == null)
     {
         mouseDelegate = new MouseDelegate {
             Widget = this.Widget, View = EventControl
         }
     }
     ;
     tracking = new NSTrackingArea(new SD.RectangleF(new SD.PointF(0, 0), EventControl.Frame.Size),
                                   NSTrackingAreaOptions.ActiveAlways | mouseOptions | NSTrackingAreaOptions.EnabledDuringMouseDrag | NSTrackingAreaOptions.InVisibleRect,
                                   mouseDelegate,
                                   new NSDictionary());
     EventControl.AddTrackingArea(tracking);
 }