protected internal override Gtk.ToolItem CreateToolItem(CommandManager manager)
        {
            if (manager.FindCommand (CommandId) == null)
                manager.RegisterCommand (cmd, "");

            return base.CreateToolItem (manager);
        }
 public CommandToolButton(object commandId, CommandManager commandManager)
     : base("")
 {
     this.commandId = commandId;
     this.commandManager = commandManager;
     UseUnderline = true;
 }
 public CommandCheckMenuItem(object commandId, CommandManager commandManager)
     : base("")
 {
     this.commandId = commandId;
     this.commandManager = commandManager;
     ActionCommand cmd = commandManager.GetCommand (commandId) as ActionCommand;
     if (cmd != null && cmd.ActionType == ActionType.Radio)
         this.DrawAsRadio = true;
 }
 public CommandMenuItem(object commandId, CommandManager commandManager)
     : base("")
 {
     this.commandId = commandId;
     this.commandManager = commandManager;
     ActionCommand cmd = commandManager.GetCommand (commandId) as ActionCommand;
     if (cmd != null)
         isArray = cmd.CommandArray;
 }
        internal static Gtk.MenuItem CreateMenuItem(CommandManager manager, object cmdId, bool isArrayMaster)
        {
            if (cmdId == Command.Separator)
                return new Gtk.SeparatorMenuItem ();

            Command cmd = manager.GetCommand (cmdId);
            if (cmd is CustomCommand) {
                Gtk.Widget child = (Gtk.Widget) Activator.CreateInstance (((CustomCommand)cmd).WidgetType);
                CustomMenuItem ti = new CustomMenuItem ();
                ti.Child = child;
                return ti;
            }

            ActionCommand acmd = cmd as ActionCommand;
            if (acmd.ActionType == ActionType.Normal || (isArrayMaster && acmd.CommandArray))
                return new CommandMenuItem (cmdId, manager);
            else
                return new CommandCheckMenuItem (cmdId, manager);
        }
        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 TreeViewOptions(Gtk.Window parentWindow, IProperties properties, IAddInTreeNode node)
        {
            this.properties = properties;

            Glade.XML treeViewXml = new Glade.XML (null, "Base.glade", "TreeViewOptionDialog", null);
            treeViewXml.Autoconnect (this);

            TreeViewOptionDialog.TransientFor = parentWindow;
            TreeViewOptionDialog.WindowPosition = Gtk.WindowPosition.CenterOnParent;

            TreeViewOptionDialog.Title = GettextCatalog.GetString ("MonoDevelop options");

            cmdManager = new CommandManager (TreeViewOptionDialog);
            cmdManager.RegisterGlobalHandler (this);

            this.InitializeComponent();

            if (node != null)
                AddNodes (properties, Gtk.TreeIter.Zero, node.BuildChildItems(this));

            SelectFirstNode ();
        }
 public CommandToolbar(CommandManager manager, string id, string title)
     : base(id, title)
 {
     manager.RegisterToolbar (this);
 }
 protected internal override Gtk.ToolItem CreateToolItem(CommandManager manager)
 {
     Gtk.ToolButton item = new Gtk.ToolButton (text);
     item.StockId = icon;
     item.Clicked += new EventHandler (HandleActivation);
     return item;
 }
 protected internal override Gtk.MenuItem CreateMenuItem(CommandManager manager)
 {
     Gtk.ImageMenuItem item = new Gtk.ImageMenuItem (text != null ? text : url);
     item.Image = new Gtk.Image (icon, Gtk.IconSize.Menu);
     item.Activated += new EventHandler (HandleActivation);
     return item;
 }
 public CommandMenu(CommandManager manager)
 {
     this.manager = manager;
     this.AccelGroup = manager.AccelGroup;
 }
 protected internal override Gtk.ToolItem CreateToolItem(CommandManager manager)
 {
     Gtk.Menu menu = manager.CreateMenu (this);
     return new MenuToolButton (menu, icon);
 }
 protected internal override Gtk.MenuItem CreateMenuItem(CommandManager manager)
 {
     Gtk.MenuItem mi = new Gtk.MenuItem (name != null ? name : "");
     mi.Submenu = manager.CreateMenu (this);
     return mi;
 }
        protected internal virtual Gtk.ToolItem CreateToolItem(CommandManager manager)
        {
            if (cmdId == Command.Separator)
                return new Gtk.SeparatorToolItem ();

            Command cmd = manager.GetCommand (cmdId);
            if (cmd is CustomCommand) {
                Gtk.Widget child = (Gtk.Widget) Activator.CreateInstance (((CustomCommand)cmd).WidgetType);
                Gtk.ToolItem ti = new Gtk.ToolItem ();
                ti.Child = child;
                if (cmd.Text != null && cmd.Text.Length > 0) {
                    Gtk.Tooltips tips = new Gtk.Tooltips ();
                    ti.SetTooltip (tips, cmd.Text, cmd.Text);
                    tips.Enable ();
                }
                return ti;
            }

            ActionCommand acmd = cmd as ActionCommand;
            if (acmd == null)
                throw new InvalidOperationException ("Unknown cmd type.");

            if (acmd.CommandArray) {
                CommandMenu menu = new CommandMenu (manager);
                menu.Append (CreateMenuItem (manager));
                return new MenuToolButton (menu, acmd.Icon);
            }
            else if (acmd.ActionType == ActionType.Normal)
                return new CommandToolButton (cmdId, manager);
            else
                return new CommandToggleToolButton (cmdId, manager);
        }
 protected internal virtual Gtk.MenuItem CreateMenuItem(CommandManager manager)
 {
     return CreateMenuItem (manager, cmdId, true);
 }
 public CommandFrame(CommandManager manager)
 {
     this.manager = manager;
     manager.RegisterGlobalHandler (this);
 }
 public CommandMenuBar(CommandManager manager)
 {
     this.manager = manager;
 }
 public CommandToggleToolButton(object commandId, CommandManager commandManager)
     : base("")
 {
     this.commandId = commandId;
     this.commandManager = commandManager;
 }