internal protected virtual void OnDragOverCheck(DragOverCheckEventArgs args) { if (dragOverCheck != null) { dragOverCheck(this, args); } }
void HandleWidgetDragMotion(object o, Gtk.DragMotionArgs args) { lastDragPosition = new Point (args.X, args.Y); DragDropAction ac; if ((enabledEvents & WidgetEvent.DragOverCheck) == 0) { if ((enabledEvents & WidgetEvent.DragOver) != 0) ac = DragDropAction.Default; else ac = ConvertDragAction (destDragAction); } else { DragOverCheckEventArgs da = new DragOverCheckEventArgs (new Point (args.X, args.Y), Util.GetDragTypes (args.Context.Targets), ConvertDragAction (args.Context.Actions)); Toolkit.Invoke (delegate { EventSink.OnDragOverCheck (da); }); ac = da.AllowedAction; if ((enabledEvents & WidgetEvent.DragOver) == 0 && ac == DragDropAction.Default) ac = DragDropAction.None; } if (ac == DragDropAction.None) { args.RetVal = true; Gdk.Drag.Status (args.Context, (Gdk.DragAction)0, args.Time); } else if (ac == DragDropAction.Default) { // Undefined, we need more data args.RetVal = true; QueryDragData (args.Context, args.Time, true); } else { // Gtk.Drag.Highlight (Widget); args.RetVal = true; Gdk.Drag.Status (args.Context, ConvertDragAction (ac), args.Time); } }
internal bool DoDragMotion(Gdk.DragContext context, int x, int y, uint time) { DragDropInfo.LastDragPosition = new Point (x, y); DragDropAction ac; if ((enabledEvents & WidgetEvent.DragOverCheck) == 0) { if ((enabledEvents & WidgetEvent.DragOver) != 0) ac = DragDropAction.Default; else ac = ConvertDragAction (DragDropInfo.DestDragAction); } else { // This is a workaround to what seems to be a mac gtk bug. // Suggested action is set to all when no control key is pressed var cact = ConvertDragAction (context.Actions); if (cact == DragDropAction.All) cact = DragDropAction.Move; var target = Gtk.Drag.DestFindTarget (EventsRootWidget, context, null); var targetTypes = Util.GetDragTypes (new Gdk.Atom[] { target }); DragOverCheckEventArgs da = new DragOverCheckEventArgs (new Point (x, y), targetTypes, cact); ApplicationContext.InvokeUserCode (delegate { EventSink.OnDragOverCheck (da); }); ac = da.AllowedAction; if ((enabledEvents & WidgetEvent.DragOver) == 0 && ac == DragDropAction.Default) ac = DragDropAction.None; } if (ac == DragDropAction.None) { OnSetDragStatus (context, x, y, time, (Gdk.DragAction)0); return true; } else if (ac == DragDropAction.Default) { // Undefined, we need more data QueryDragData (context, time, true); return true; } else { // Gtk.Drag.Highlight (Widget); OnSetDragStatus (context, x, y, time, ConvertDragAction (ac)); return true; } }
/// <summary> /// Raises the DragOverCheck event. /// </summary> /// <param name='args'> /// Arguments. /// </param> protected internal virtual void OnDragOverCheck(DragOverCheckEventArgs args) { if (dragOverCheck != null) dragOverCheck (this, args); }
public void OnDragOverCheck(DragOverCheckEventArgs args) { Parent.OnDragOverCheck (args); }
public void OnDragOverCheck(DragOverCheckEventArgs args) { Parent.OnDragOverCheck(args); }