public void SwitchView(BaseViewContent view) { if (subViewNotebook != null) { ShowPage(viewContents.IndexOf(view)); } }
public void InsertViewContent(int index, BaseViewContent subViewContent) { // need to create child Notebook when first IAttachableViewContent is added CheckCreateSubViewContents(); viewContents.Insert(index, subViewContent); subViewContent.WorkbenchWindow = this; InsertButton(index, subViewContent.TabPageLabel, subViewContent); if (ViewsChanged != null) { ViewsChanged(this, EventArgs.Empty); } }
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 DocumentToolbar GetToolbar(BaseViewContent targetView) { DocumentToolbar toolbar; if (!documentToolbars.TryGetValue(targetView, out toolbar)) { toolbar = new DocumentToolbar(); documentToolbars [targetView] = toolbar; box.PackStart(toolbar.Container, false, false, 0); box.ReorderChild(toolbar.Container, 0); toolbar.Visible = (targetView == ActiveViewContent); PathWidgetEnabled = !toolbar.Visible; } return(toolbar); }
DocumentView WrapView(BaseViewContent content) { if (content == null) { return(null); } if (views != null) { return(views.FirstOrDefault(v => v.BaseContent == content) ?? new DocumentView(this, content)); } else { return(new DocumentView(this, content)); } }
protected Tab AddButton(string label, BaseViewContent viewContent) { return(InsertButton(viewContents.Count, label, viewContent)); }
public void AttachViewContent(BaseViewContent subViewContent) { InsertViewContent(viewContents.Count, subViewContent); }
public ActiveViewContentEventArgs(BaseViewContent content) { this.content = content; }
#pragma warning restore 67 DocumentToolbar IWorkbenchWindow.GetToolbar(BaseViewContent targetView) { throw new System.NotImplementedException(); }
public void SwitchView(BaseViewContent view) { }
public DocumentToolbar GetToolbar(BaseViewContent targetView) { throw new NotImplementedException(); }
public void InsertViewContent(int index, BaseViewContent subViewContent) { }
public void AttachViewContent(BaseViewContent subViewContent) { }
internal DocumentView(Document doc, BaseViewContent content) { document = doc; this.content = content; }
public DocumentToolbar GetToolbar(BaseViewContent targetView) { return(null); }