public static Drag ( Gtk source, Gdk evt, Gtk dragWidget ) : void | ||
source | Gtk | |
evt | Gdk | |
dragWidget | Gtk | |
return | void |
protected override void OnDragBegin(Gdk.DragContext ctx) { Gtk.Widget ob = CreateItemWidget(); if (ob != null) { DND.Drag(this, ctx, ob); } }
internal void BeginComponentDrag(ProjectBackend project, string desc, string className, ObjectWrapper wrapper, Gtk.Widget source, Gdk.DragContext ctx, ComponentDropCallback callback) { if (wrapper != null) { Stetic.Wrapper.ActionPaletteItem it = new Stetic.Wrapper.ActionPaletteItem(Gtk.UIManagerItemType.Menuitem, null, (Wrapper.Action)wrapper); DND.Drag(source, ctx, it); } else if (callback != null) { DND.Drag(source, ctx, delegate() { callback(); // If the class name has an assembly name, remove it now int i = className.IndexOf(','); if (i != -1) { className = className.Substring(0, i); } ClassDescriptor cls = Registry.LookupClassByName(className); if (cls != null) { return(cls.NewInstance(project) as Gtk.Widget); } else { // Class not found, show an error string msg = string.Format("The widget '{0}' could not be found.", className); Gtk.MessageDialog dlg = new Gtk.MessageDialog(null, Gtk.DialogFlags.Modal, Gtk.MessageType.Error, Gtk.ButtonsType.Close, msg); dlg.Run(); dlg.Destroy(); return(null); } }, (desc != null && desc.Length > 0) ? desc : className ); } else { ClassDescriptor cls = Registry.LookupClassByName(className); DND.Drag(source, ctx, cls.NewInstance(project) as Gtk.Widget); } }