void HandleWidgetDragDrop(object o, Gtk.DragDropArgs args) { lastDragPosition = new Point (args.X, args.Y); var cda = ConvertDragAction (args.Context.Action); DragDropResult res; if ((enabledEvents & WidgetEvent.DragDropCheck) == 0) { if ((enabledEvents & WidgetEvent.DragDrop) != 0) res = DragDropResult.None; else res = DragDropResult.Canceled; } else { DragCheckEventArgs da = new DragCheckEventArgs (new Point (args.X, args.Y), Util.GetDragTypes (args.Context.Targets), cda); Toolkit.Invoke (delegate { EventSink.OnDragDropCheck (da); }); res = da.Result; if ((enabledEvents & WidgetEvent.DragDrop) == 0 && res == DragDropResult.None) res = DragDropResult.Canceled; } if (res == DragDropResult.Canceled) { args.RetVal = true; Gtk.Drag.Finish (args.Context, false, false, args.Time); } else if (res == DragDropResult.Success) { args.RetVal = true; Gtk.Drag.Finish (args.Context, true, cda == DragDropAction.Move, args.Time); } else { // Undefined, we need more data args.RetVal = true; QueryDragData (args.Context, args.Time, false); } }
internal bool DoDragDrop(Gdk.DragContext context, int x, int y, uint time) { DragDropInfo.LastDragPosition = new Point (x, y); var cda = ConvertDragAction (context.Action); DragDropResult res; if ((enabledEvents & WidgetEvent.DragDropCheck) == 0) { if ((enabledEvents & WidgetEvent.DragDrop) != 0) res = DragDropResult.None; else res = DragDropResult.Canceled; } else { DragCheckEventArgs da = new DragCheckEventArgs (new Point (x, y), Util.GetDragTypes (context.Targets), cda); ApplicationContext.InvokeUserCode (delegate { EventSink.OnDragDropCheck (da); }); res = da.Result; if ((enabledEvents & WidgetEvent.DragDrop) == 0 && res == DragDropResult.None) res = DragDropResult.Canceled; } if (res == DragDropResult.Canceled) { Gtk.Drag.Finish (context, false, false, time); return true; } else if (res == DragDropResult.Success) { Gtk.Drag.Finish (context, true, cda == DragDropAction.Move, time); return true; } else { // Undefined, we need more data QueryDragData (context, time, false); return true; } }
public void OnDragDropCheck(DragCheckEventArgs args) { Parent.OnDragDropCheck (args); }
/// <summary> /// Raises the DragDropCheck event. /// </summary> /// <param name='args'> /// Arguments. /// </param> protected internal virtual void OnDragDropCheck(DragCheckEventArgs args) { if (dragDropCheck != null) dragDropCheck (this, args); }
public void OnDragDropCheck(DragCheckEventArgs args) { Parent.OnDragDropCheck(args); }