Esempio n. 1
0
        public void SetToolbarProvider(IToolbarProvider toolbarProvider)
        {
            InspectorGridToolbar t = toolbar as InspectorGridToolbar;

            if (t == null)
            {
                throw new InvalidOperationException("Custom toolbar provider already set");
            }
            Remove(t);
            foreach (Widget w in t.Children)
            {
                t.Remove(w);
                toolbarProvider.Insert(w, -1);
            }
            t.Destroy();
            toolbarSeparator.Hide();
            toolbar = toolbarProvider;
            UpdateTabs();
        }
Esempio n. 2
0
        internal InspectorGrid(EditorManager editorManager)
        {
            this.editorManager = editorManager;

            #region Toolbar

            InspectorGridToolbar tb = new InspectorGridToolbar();
            base.PackStart(tb, false, false, 0);
            toolbar = tb;

            catButton = new RadioButton((Gtk.RadioButton)null);
            catButton.DrawIndicator = false;
            catButton.Relief        = ReliefStyle.None;
//      Gdk.Pixbuf pixbuf = null;
//      try {
//        pixbuf = new Gdk.Pixbuf(typeof(InspectorGrid).Assembly, "MonoDevelop.Components.InspectorGrid.SortByCat.png");
//      } catch(Exception e) {
//        LoggingService.LogError("Can't create pixbuf from resource: MonoDevelop.Components.InspectorGrid.SortByCat.png", e);
//      }
//      if(pixbuf != null) {
//        catButton.Image = new Gtk.Image(pixbuf);
//        catButton.Image.Show();
//      }
//      catButton.TooltipText = GettextCatalog.GetString("Sort in categories");
//      catButton.Toggled += new EventHandler(toolbarClick);
//      toolbar.Insert(catButton, 0);

            alphButton = new RadioButton(catButton);
            alphButton.DrawIndicator = false;
            alphButton.Relief        = ReliefStyle.None;
            alphButton.Image         = new Gtk.Image(Stock.SortAscending, IconSize.Menu);
            alphButton.Image.Show();
//      alphButton.TooltipText = GettextCatalog.GetString("Sort alphabetically");
            alphButton.Clicked += new EventHandler(toolbarClick);
//      toolbar.Insert(alphButton, 1);

            catButton.Active = true;

            #endregion

            vpaned = new VPaned();

            tree          = new InspectorGridTable(editorManager, this);
            tree.Changed += delegate {
                Update();
            };

            ScrolledWindow sw = new ScrolledWindow();
            sw.AddWithViewport(tree);
            ((Gtk.Viewport)sw.Child).ShadowType = Gtk.ShadowType.None;
            sw.ShadowType       = Gtk.ShadowType.None;
            sw.HscrollbarPolicy = PolicyType.Never;
            sw.VscrollbarPolicy = PolicyType.Automatic;

            VBox tbox = new VBox();
            toolbarSeparator         = new HSeparator();
            toolbarSeparator.Visible = true;
            tbox.PackStart(toolbarSeparator, false, false, 0);
            tbox.PackStart(sw, true, true, 0);
            helpSeparator = new HSeparator();
            tbox.PackStart(helpSeparator, false, false, 0);
            helpSeparator.NoShowAll = true;
            vpaned.Pack1(tbox, true, true);

            AddInspectorTab(new DefaultInspectorTab());
            AddInspectorTab(new EventInspectorTab());

            base.PackEnd(vpaned);
            base.FocusChain = new Gtk.Widget [] { vpaned };

            Populate();
            UpdateTabs();
        }