public void ResetSelection(Gtk.Widget widget) { if (selectionWidget == widget || widget == null) { PlaceSelectionBox(null); if (currentObjectSelection != null) { currentObjectSelection.FireDisposed(); currentObjectSelection = null; // This makes the property editor to flicker // when changing widget selection // UpdateObjectViewers (); } if (widget == null) { Gtk.Container cc = this as Gtk.Container; while (cc.Parent != null) { cc = cc.Parent as Gtk.Container; } if (cc is Gtk.Window) { ((Gtk.Window)cc).Focus = this; } } } }
public IObjectSelection SetSelection(Gtk.Widget widget, object obj, bool allowDrag) { if (currentObjectSelection != null) { currentObjectSelection.Dispose(); currentObjectSelection = null; } if (widget != null) { currentObjectSelection = new ObjectSelection(this, widget, obj); currentObjectSelection.AllowDrag = allowDrag; } else { currentObjectSelection = null; } PlaceSelectionBox(widget); // Make sure the selection box is shown before doing anything else. // The UI looks more responsive in this way. // while (Gtk.Application.EventsPending ()) // Gtk.Application.RunIteration (); UpdateObjectViewers(); if (SelectionChanged != null) { SelectionChanged(this, EventArgs.Empty); } return(currentObjectSelection); }
public void ResetSelection (Gtk.Widget widget) { if (selectionWidget == widget || widget == null) { PlaceSelectionBox (null); if (currentObjectSelection != null) { currentObjectSelection.FireDisposed (); currentObjectSelection = null; // This makes the property editor to flicker // when changing widget selection // UpdateObjectViewers (); } if (widget == null) { Gtk.Container cc = this as Gtk.Container; while (cc.Parent != null) cc = cc.Parent as Gtk.Container; if (cc is Gtk.Window) { ((Gtk.Window)cc).Focus = this; } } } }
public IObjectSelection SetSelection (Gtk.Widget widget, object obj, bool allowDrag) { if (currentObjectSelection != null) { currentObjectSelection.Dispose (); currentObjectSelection = null; } if (widget != null) { currentObjectSelection = new ObjectSelection (this, widget, obj); currentObjectSelection.AllowDrag = allowDrag; } else currentObjectSelection = null; PlaceSelectionBox (widget); // Make sure the selection box is shown before doing anything else. // The UI looks more responsive in this way. // while (Gtk.Application.EventsPending ()) // Gtk.Application.RunIteration (); UpdateObjectViewers (); if (SelectionChanged != null) SelectionChanged (this, EventArgs.Empty); return currentObjectSelection; }