示例#1
0
        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();
                    });
                }
            }
        }
示例#2
0
 void HandleMouseEnter(object sender, MouseEventArgs e)
 {
     if (enabledEvents.HasFlag(WidgetEvent.MouseEntered))
     {
         Load(sender as FrameworkElement);
         SetCurrentEventRow();
         ApplicationContext.InvokeUserCode(EventSink.OnMouseEntered);
     }
 }
示例#3
0
 public bool GetIsEventEnabled(WidgetEvent eventId)
 {
     return(enabledEvents.HasFlag(eventId));
 }