コード例 #1
0
        protected internal override Gtk.ToolItem CreateToolItem(CommandManager manager)
        {
            if (manager.FindCommand (CommandId) == null)
                manager.RegisterCommand (cmd, "");

            return base.CreateToolItem (manager);
        }
コード例 #2
0
 public CommandToolButton(object commandId, CommandManager commandManager)
     : base("")
 {
     this.commandId = commandId;
     this.commandManager = commandManager;
     UseUnderline = true;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 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;
 }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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 ();
        }
コード例 #8
0
 public CommandToolbar(CommandManager manager, string id, string title)
     : base(id, title)
 {
     manager.RegisterToolbar (this);
 }
コード例 #9
0
 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;
 }
コード例 #10
0
 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;
 }
コード例 #11
0
 public CommandMenu(CommandManager manager)
 {
     this.manager = manager;
     this.AccelGroup = manager.AccelGroup;
 }
コード例 #12
0
 protected internal override Gtk.ToolItem CreateToolItem(CommandManager manager)
 {
     Gtk.Menu menu = manager.CreateMenu (this);
     return new MenuToolButton (menu, icon);
 }
コード例 #13
0
 protected internal override Gtk.MenuItem CreateMenuItem(CommandManager manager)
 {
     Gtk.MenuItem mi = new Gtk.MenuItem (name != null ? name : "");
     mi.Submenu = manager.CreateMenu (this);
     return mi;
 }
コード例 #14
0
        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);
        }
コード例 #15
0
 protected internal virtual Gtk.MenuItem CreateMenuItem(CommandManager manager)
 {
     return CreateMenuItem (manager, cmdId, true);
 }
コード例 #16
0
 public CommandFrame(CommandManager manager)
 {
     this.manager = manager;
     manager.RegisterGlobalHandler (this);
 }
コード例 #17
0
 public CommandMenuBar(CommandManager manager)
 {
     this.manager = manager;
 }
コード例 #18
0
 public CommandToggleToolButton(object commandId, CommandManager commandManager)
     : base("")
 {
     this.commandId = commandId;
     this.commandManager = commandManager;
 }