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); }
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 (); }
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); }