Inheritance: Gtk.RadioButton
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;
                toolbar.Insert(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.º 3
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.º 4
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 (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);
        }