public void InsertView(int position, IShellDocumentViewItem shellView) { var widget = (GtkShellDocumentViewItem)shellView; widget.Show(); currentContainer.InsertView(position, widget); tabstrip.InsertTab(position, CreateTab((GtkShellDocumentViewItem)shellView)); UpdateTabstrip(); }
protected Tab InsertButton(int index, string label, BaseViewContent viewContent) { CheckCreateSubViewToolbar(); updating = true; var addedContent = (index == 0 || subViewToolbar.TabCount == 0) && IdeApp.Workbench.ActiveDocument == Document; var widgetBox = new Gtk.VBox(); var tab = new Tab(subViewToolbar, label) { Tag = viewContent }; if (tab.Accessible != null) { tab.Accessible.Help = viewContent.TabAccessibilityDescription; } // If this is the current displayed document we need to add the control immediately as the tab is already active. if (addedContent) { widgetBox.Add(viewContent.Control); widgetBox.Show(); } subViewToolbar.InsertTab(index, tab); subViewNotebook.InsertPage(widgetBox, new Gtk.Label(), index); tab.Activated += (sender, e) => { if (!addedContent) { widgetBox.Add(viewContent.Control); widgetBox.Show(); addedContent = true; } int page = viewContents.IndexOf((BaseViewContent)tab.Tag); SetCurrentView(page); QueueDraw(); }; EnsureToolbarBoxSeparator(); updating = false; if (index == 0) { ShowPage(0); } return(tab); }
public void InsertView(int position, GtkShellDocumentViewItem view) { tabstrip.InsertTab(position, CreateTab(view)); }