void HandleMotionNotifyEvent(object o, Gtk.MotionNotifyEventArgs args) { int cx, cy; Gtk.TreeIter iter; if (rendererTarget.GetCellPosition(CellRenderer, (int)args.Event.X, (int)args.Event.Y, out cx, out cy, out iter)) { var rect = rendererTarget.GetCellBackgroundBounds(target, CellRenderer, iter); if (rect.Contains(cx, cy)) { if (enabledEvents.HasFlag(WidgetEvent.MouseMoved)) { ApplicationContext.InvokeUserCode(delegate { LoadData(rendererTarget.Model, iter); SetCurrentEventRow(); EventSink.OnMouseMoved(new MouseMovedEventArgs(args.Event.Time, cx, cy)); }); } if (!mouseInsideCell) { mouseInsideCell = true; if (enabledEvents.HasFlag(WidgetEvent.MouseEntered)) { ApplicationContext.InvokeUserCode(delegate { LoadData(rendererTarget.Model, iter); SetCurrentEventRow(); EventSink.OnMouseEntered(); }); } } } else if (mouseInsideCell) { mouseInsideCell = false; if (enabledEvents.HasFlag(WidgetEvent.MouseExited)) { ApplicationContext.InvokeUserCode(delegate { LoadData(rendererTarget.Model, iter); SetCurrentEventRow(); EventSink.OnMouseExited(); }); } } } else if (mouseInsideCell) { mouseInsideCell = false; if (enabledEvents.HasFlag(WidgetEvent.MouseExited)) { ApplicationContext.InvokeUserCode(delegate { LoadData(rendererTarget.Model, iter); EventSink.OnMouseExited(); }); } } }
void HandleMouseEnter(object sender, MouseEventArgs e) { if (enabledEvents.HasFlag(WidgetEvent.MouseEntered)) { Load(sender as FrameworkElement); SetCurrentEventRow(); ApplicationContext.InvokeUserCode(EventSink.OnMouseEntered); } }
public bool GetIsEventEnabled(WidgetEvent eventId) { return(enabledEvents.HasFlag(eventId)); }