protected override void EndEditing(Gdk.Key exitKey) { if (editing) { Gtk.Entry entry = label as Gtk.Entry; if (entry != null && exitKey != Gdk.Key.Escape) { localUpdate = true; if (entry.Text.Trim().Length > 0 || node.Action.GtkAction.StockId != null) { using (node.Action.UndoManager.AtomicChange) { node.Action.Label = entry.Text; node.Action.NotifyChanged(); } } localUpdate = false; } editing = false; Refresh(); while (Gtk.Application.EventsPending()) { Gtk.Application.RunIteration(); } if (node.Type == Gtk.UIManagerItemType.Menu) { if (wrapper != null) { IDesignArea area = wrapper.GetDesignArea(); if (area != null) { ShowSubmenu(area, this); } } } GrabFocus(); UpdateSelectionStatus(); if (EditingDone != null) { MenuItemEditEventArgs args = new MenuItemEditEventArgs(); args.ExitKey = exitKey; EditingDone(this, args); } } }
void OnEditingDone(object ob, MenuItemEditEventArgs args) { ActionMenuItem item = (ActionMenuItem)ob; item.EditingDone -= OnEditingDone; if (item.Node.Action.GtkAction.Label.Length == 0 && item.Node.Action.GtkAction.StockId == null) { IDesignArea area = wrapper.GetDesignArea(); area.ResetSelection(item); using (wrapper.UndoManager.AtomicChange) { nodes.Remove(item.Node); wrapper.LocalActionGroups [0].Actions.Remove(item.Node.Action); } SelectLastItem(); } else { if (args.ExitKey == Gdk.Key.Up || args.ExitKey == Gdk.Key.Down) { ProcessKey(item, args.ExitKey, Gdk.ModifierType.None); } } }
protected override void EndEditing (Gdk.Key exitKey) { if (editing) { Gtk.Entry entry = label as Gtk.Entry; if (entry != null && exitKey != Gdk.Key.Escape) { localUpdate = true; if (entry.Text.Trim().Length > 0 || node.Action.GtkAction.StockId != null) { using (node.Action.UndoManager.AtomicChange) { node.Action.Label = entry.Text; node.Action.NotifyChanged (); } } localUpdate = false; } editing = false; Refresh (); while (Gtk.Application.EventsPending ()) Gtk.Application.RunIteration (); if (node.Type == Gtk.UIManagerItemType.Menu) { if (wrapper != null) { IDesignArea area = wrapper.GetDesignArea (); if (area != null) ShowSubmenu (area, this); } } GrabFocus (); UpdateSelectionStatus (); if (EditingDone != null) { MenuItemEditEventArgs args = new MenuItemEditEventArgs (); args.ExitKey = exitKey; EditingDone (this, args); } } }
void OnEditingDone (object ob, MenuItemEditEventArgs args) { ActionMenuItem item = (ActionMenuItem) ob; item.EditingDone -= OnEditingDone; if (item.Node.Action.GtkAction.Label.Length == 0 && item.Node.Action.GtkAction.StockId == null) { IDesignArea area = wrapper.GetDesignArea (); area.ResetSelection (item); using (wrapper.UndoManager.AtomicChange) { nodes.Remove (item.Node); wrapper.LocalActionGroups [0].Actions.Remove (item.Node.Action); } SelectLastItem (); } else { if (args.ExitKey == Gdk.Key.Up || args.ExitKey == Gdk.Key.Down) ProcessKey (item, args.ExitKey, Gdk.ModifierType.None); } }