protected override void OnPanelClick(Gdk.EventButton e, Placement placement)
 {
     if (e.Button == 3) {
         CommandEntrySet opset = new CommandEntrySet ();
         opset.AddItem (CommandSystemCommands.ToolbarList);
         Gtk.Menu menu = manager.CreateMenu (opset);
         menu.Popup (null, null, null, 0, e.Time);
     }
     base.OnPanelClick (e, placement);
 }
        public MenuButtonEntry(Gtk.Entry entry, Gtk.Button button)
        {
            if (entry == null) entry = new Gtk.Entry ();
            if (button == null) button = new Gtk.Button (">");

            this.entry = entry;

            manager = new CommandManager ();
            manager.RegisterGlobalHandler (this);

            PackStart (entry, true, true, 0);
            PackStart (button, false, false, 6);

            ActionCommand cmd = new ActionCommand ("InsertOption", "InsertOption", null);
            cmd.CommandArray = true;
            manager.RegisterCommand (cmd);
            entrySet = new CommandEntrySet ();
            entrySet.AddItem ("InsertOption");

            button.Clicked += new EventHandler (ShowQuickInsertMenu);
        }
 void ShowPopup()
 {
     ITreeNavigator tnav = GetSelectedNode ();
     TypeNodeBuilder nb = GetTypeNodeBuilder (tnav.CurrentPosition._iter);
     if (nb == null || nb.ContextMenuAddinPath == null) {
         if (options.Length > 0) {
             CommandEntrySet opset = new CommandEntrySet ();
             opset.AddItem (ViewCommands.TreeDisplayOptionList);
             opset.AddItem (Command.Separator);
             opset.AddItem (ViewCommands.ResetTreeDisplayOptions);
             Runtime.Gui.CommandService.ShowContextMenu (opset);
         }
     } else {
         CommandEntrySet eset = Runtime.Gui.CommandService.CreateCommandEntrySet (nb.ContextMenuAddinPath);
         eset.AddItem (Command.Separator);
         CommandEntrySet opset = eset.AddItemSet (GettextCatalog.GetString ("Display Options"));
         opset.AddItem (ViewCommands.TreeDisplayOptionList);
         opset.AddItem (Command.Separator);
         opset.AddItem (ViewCommands.ResetTreeDisplayOptions);
         Runtime.Gui.CommandService.ShowContextMenu (eset);
     }
 }
        protected override bool OnButtonPressEvent(Gdk.EventButton e)
        {
            CompletionListWindow.HideWindow ();

            if (!ShowLineMarkers)
                return base.OnButtonPressEvent (e);

            if (e.Window == GetWindow (Gtk.TextWindowType.Left)) {
                int x, y;
                WindowToBufferCoords (Gtk.TextWindowType.Left, (int) e.X, (int) e.Y, out x, out y);
                TextIter line;
                int top;

                GetLineAtY (out line, y, out top);
                buf.PlaceCursor (line);

                if (e.Button == 1) {
                    buf.ToggleBookmark (line.Line);
                } else if (e.Button == 3) {
                    CommandEntrySet cset = new CommandEntrySet ();
                    cset.AddItem (EditorCommands.ToggleBookmark);
                    cset.AddItem (EditorCommands.ClearBookmarks);
                    cset.AddItem (Command.Separator);
                    cset.AddItem (DebugCommands.ToggleBreakpoint);
                    cset.AddItem (DebugCommands.ClearAllBreakpoints);
                    Gtk.Menu menu = Runtime.Gui.CommandService.CreateMenu (cset);

                    menu.Popup (null, null, null, 3, e.Time);
                }
            }
            return base.OnButtonPressEvent (e);
        }