Ejemplo n.º 1
0
 void CreateTracking()
 {
     if (!mouseMove)
     {
         return;
     }
     if (tracking != null)
     {
         Control.RemoveTrackingArea(tracking);
     }
     //Console.WriteLine ("Adding mouse tracking {0} for area {1}", this.Widget.GetType ().FullName, Control.Frame.Size);
     mouseDelegate = new MouseDelegate {
         Widget = this.Widget, View = Control
     };
     tracking = new NSTrackingArea(new SD.RectangleF(new SD.PointF(0, 0), Control.Frame.Size),
                                   NSTrackingAreaOptions.ActiveAlways | mouseOptions | NSTrackingAreaOptions.EnabledDuringMouseDrag | NSTrackingAreaOptions.InVisibleRect,
                                   mouseDelegate,
                                   new NSDictionary());
     Control.AddTrackingArea(tracking);
 }
Ejemplo n.º 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 = Widget, View = EventControl
                }
            }
            ;
            var options = mouseOptions | NSTrackingAreaOptions.ActiveAlways | NSTrackingAreaOptions.EnabledDuringMouseDrag | NSTrackingAreaOptions.InVisibleRect;

            tracking = new NSTrackingArea(new SD.RectangleF(SD.PointF.Empty, EventControl.Frame.Size), options, mouseDelegate, new NSDictionary());
            EventControl.AddTrackingArea(tracking);
        }