internal bool HandleClick(Gdk.EventButton evb) { int x = (int)evb.X, y = (int)evb.Y; int erx, ery, wrx, wry; // Translate from event window to widget window coords evb.Window.GetOrigin(out erx, out ery); Wrapped.GdkWindow.GetOrigin(out wrx, out wry); x += erx - wrx; y += ery - wry; Widget wrapper = FindWrapper(Wrapped, x, y); if (wrapper == null) { return(false); } if (wrapper.Wrapped != proj.Selection) { wrapper.Select(); return(true); } else if (evb.Button == 3) { proj.PopupContextMenu(wrapper); return(true); } else { return(false); } }
internal bool HandleClick(Gdk.EventButton evb) { int x = (int)evb.X, y = (int)evb.Y; int erx, ery, wrx, wry; // Translate from event window to widget window coords evb.Window.GetOrigin(out erx, out ery); Wrapped.GdkWindow.GetOrigin(out wrx, out wry); x += erx - wrx; y += ery - wry; Widget wrapper = FindWrapper(Wrapped, x, y); if (wrapper == null) { return(false); } bool handled = false; if (wrapper.Wrapped != proj.Selection) { wrapper.Select(); handled = true; } if (Stetic.Editor.GtkWorkarounds.TriggersContextMenu(evb)) { proj.PopupContextMenu(wrapper); return(true); } return(handled); }
void FixedDragDataReceived(object obj, Gtk.DragDataReceivedArgs args) { Widget dropped = WidgetUtils.Paste(proj, args.SelectionData); Gtk.Drag.Finish(args.Context, dropped != null, dropped != null, args.Time); if (dropped != null) { gtkfixed.Put(dropped.Wrapped, 0, 0); NotifyChildAdded(dropped.Wrapped); dropped.Select(); } }
void FixedDragDrop(object obj, Gtk.DragDropArgs args) { Gtk.Widget w = DND.Drop(args.Context, gtkfixed, args.Time); Widget ww = Widget.Lookup(w); if (ww != null) { gtkfixed.Put(w, args.X - DND.DragHotX, args.Y - DND.DragHotY); NotifyChildAdded(w); args.RetVal = true; ww.Select(); } }
void DragEnd(object obj, Gtk.DragEndArgs args) { using (UndoManager.AtomicChange) { gtkfixed.DragEnd -= DragEnd; if (DND.DragWidget != null) { DND.DragWidget.Unparent(); gtkfixed.Put(DND.DragWidget, dragX, dragY); NotifyChildAdded(DND.DragWidget); Widget ww = Widget.Lookup(DND.DragWidget); ww.Select(); } } }