public CommandEntrySet CreateCommandEntrySet(string addinPath)
 {
     CommandEntrySet cset = new CommandEntrySet ();
     ArrayList items = AddInTreeSingleton.AddInTree.GetTreeNode (addinPath).BuildChildItems (null);
     foreach (CommandEntry e in items)
         cset.Add (e);
     return cset;
 }
 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);
        }
 public void ShowContextMenu(CommandEntrySet entrySet)
 {
     ShowContextMenu (CreateMenu (entrySet));
 }
 public Gtk.Toolbar CreateToolbar(string id, CommandEntrySet entrySet)
 {
     CommandToolbar toolbar = new CommandToolbar (this, id, entrySet.Name);
     foreach (CommandEntry entry in entrySet)
         toolbar.Add (entry.CreateToolItem (this));
     return toolbar;
 }
 public Gtk.MenuBar CreateMenuBar(string name, CommandEntrySet entrySet)
 {
     Gtk.MenuBar topMenu = new CommandMenuBar (this);
     foreach (CommandEntry entry in entrySet)
         topMenu.Append (entry.CreateMenuItem (this));
     return topMenu;
 }
        /*		public Gtk.Toolbar CreateToolbar (CommandEntrySet entrySet)
        {
            return CreateToolbar ("", entrySet);
        }

        */
        public Gtk.Menu CreateMenu(CommandEntrySet entrySet)
        {
            CommandMenu menu = new CommandMenu (this);
            foreach (CommandEntry entry in entrySet)
                menu.Append (entry.CreateMenuItem (this));
            return menu;
        }
예제 #8
0
 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);
        }
 public CommandEntrySet AddItemSet(string name, string icon)
 {
     CommandEntrySet cmdset = new CommandEntrySet (name, icon);
     cmds.Add (cmdset);
     return cmdset;
 }
 public Gtk.Menu CreateMenu(CommandEntrySet cset)
 {
     return manager.CreateMenu (cset);
 }
 public void ShowContextMenu(CommandEntrySet cset)
 {
     manager.ShowContextMenu (cset);
 }