Exemplo n.º 1
0
 void UpdateTabs()
 {
     foreach (Gtk.Widget w in toolbar.Children)
     {
         TabRadioToolButton but = w as TabRadioToolButton;
         if (but != null)
         {
             but.Visible = currentObject != null && but.Tab.CanExtend(currentObject);
         }
     }
 }
Exemplo n.º 2
0
        private void AddPropertyTab(PropertyTab tab)
        {
            TabRadioToolButton rtb;

            if (propertyTabs.Count == 0)
            {
                selectedTab = tab;
                rtb         = new TabRadioToolButton(null);
                rtb.Active  = true;
                firstTab    = rtb;
#if false // Commented out by SLohse. Our PropertyGrid currently only supports 1 tab page, so no icon in the toolbar is needed.
                toolbar.Insert(new SeparatorToolItem(), FirstTabIndex - 1);
#endif
            }
            else
            {
                rtb = new TabRadioToolButton(firstTab);
            }

            //load image from PropertyTab's bitmap
            var icon = tab.GetIcon();
            if (icon != null)
            {
                rtb.Image = new Gtk.Image(icon);
            }
            else
            {
                rtb.Image = new Gtk.Image(Stock.MissingImage, IconSize.Menu);
            }

            rtb.Tab         = tab;
            rtb.TooltipText = tab.TabName;
            rtb.Toggled    += new EventHandler(toolbarClick);

#if false // Commented out by SLohse. Our PropertyGrid currently only supports 1 tab page, so no icon in the toolbar is needed.
            toolbar.Insert(rtb, propertyTabs.Count + FirstTabIndex);
#endif

            propertyTabs.Add(tab);
        }
Exemplo n.º 3
0
        private void AddPropertyTab(PropertyTab tab)
        {
            TabRadioToolButton rtb;

            if (propertyTabs.Count == 0)
            {
                selectedTab = tab;
                rtb         = new TabRadioToolButton(null);
                rtb.Active  = true;
                firstTab    = rtb;
                toolbar.Insert(tabSectionSeparator = new SeparatorToolItem(), FirstTabIndex - 1);
            }
            else
            {
                rtb = new TabRadioToolButton(firstTab);
            }

            //load image from PropertyTab's bitmap
            var icon = tab.GetIcon();

            if (icon != null)
            {
                rtb.Image = new Gtk.Image(icon);
            }
            else
            {
                rtb.Image = new Gtk.Image(Stock.MissingImage, IconSize.Menu);
            }

            rtb.Tab         = tab;
            rtb.TooltipText = tab.TabName;
            rtb.Toggled    += new EventHandler(toolbarClick);

            toolbar.Insert(rtb, propertyTabs.Count + FirstTabIndex);

            propertyTabs.Add(tab);
        }
Exemplo n.º 4
0
 void toolbarClick(object sender, EventArgs e)
 {
     if (sender == alphButton)
     {
         PropertySort = PropertySort.Alphabetical;
     }
     else if (sender == catButton)
     {
         PropertySort = PropertySort.Categorized;
     }
     else
     {
         TabRadioToolButton button = (TabRadioToolButton)sender;
         if (selectedTab == button.Tab)
         {
             return;
         }
         selectedTab = button.Tab;
         Populate();
     }
     // If the tree is re-populated while a value is being edited, the focus that the value editor had
     // is not returned back to the tree. We need to explicitly get it.
     tree.GrabFocus();
 }
Exemplo n.º 5
0
        private void AddPropertyTab(PropertyTab tab)
        {
            TabRadioToolButton rtb;
            if (propertyTabs.Count == 0) {
                selectedTab = tab;
                rtb = new TabRadioToolButton (null);
                rtb.Active = true;
                firstTab = rtb;
                toolbar.Insert (tabSectionSeparator = new SeparatorToolItem (), FirstTabIndex - 1);
            }
            else
                rtb = new TabRadioToolButton (firstTab);

            //load image from PropertyTab's bitmap
            var icon = tab.GetIcon ();
            if (icon != null)
                rtb.Image = new ImageView (icon);
            else
                rtb.Image = new ImageView (MonoDevelop.Ide.ImageService.GetIcon (Stock.MissingImage, IconSize.Menu));

            rtb.Tab = tab;
            rtb.TooltipText = tab.TabName;
            rtb.Toggled += new EventHandler (toolbarClick);

            toolbar.Insert (rtb, propertyTabs.Count + FirstTabIndex);

            propertyTabs.Add(tab);
        }
Exemplo n.º 6
0
        private void AddPropertyTab(PropertyTab tab)
        {
            TabRadioToolButton rtb;
             if(propertyTabs.Count == 0)
             {
            selectedTab = tab;
            rtb = new TabRadioToolButton(null);
            rtb.Active = true;
            firstTab = rtb;
            #if false // Commented out by SLohse. Our PropertyGrid currently only supports 1 tab page, so no icon in the toolbar is needed.
                toolbar.Insert (new SeparatorToolItem (), FirstTabIndex - 1);
            #endif
             }
             else
            rtb = new TabRadioToolButton(firstTab);

             //load image from PropertyTab's bitmap
             var icon = tab.GetIcon();
             if(icon != null)
            rtb.Image = new Gtk.Image(icon);
             else
            rtb.Image = new Gtk.Image(Stock.MissingImage, IconSize.Menu);

             rtb.Tab = tab;
             rtb.TooltipText = tab.TabName;
             rtb.Toggled += new EventHandler(toolbarClick);

            #if false // Commented out by SLohse. Our PropertyGrid currently only supports 1 tab page, so no icon in the toolbar is needed.
            toolbar.Insert (rtb, propertyTabs.Count + FirstTabIndex);
            #endif

             propertyTabs.Add(tab);
        }