/* public void OnDeactivated () * { * if (pathBar != null) * pathBar.HideMenu (); * } * * public void OnActivated () * { * if (subViewToolbar != null) * subViewToolbar.Tabs [subViewToolbar.ActiveTab].Activate (); * }*/ public void ShowPathBar(IPathedDocument pathDoc) { if (box == null) { pathDocPending = pathDoc; return; } DetachPathedDocument(); this.pathDoc = pathDoc; pathDoc.PathChanged += HandlePathChange; // If a toolbar is already being shown, we don't show the pathbar yet if (topToolbar != null && topToolbar.Visible) { return; } if (pathBar == null) { pathBar = new PathBar(pathDoc.CreatePathWidget); box.PackStart(pathBar, false, true, 0); box.ReorderChild(pathBar, 0); pathBar.Show(); } pathBar.SetPath(pathDoc.CurrentPath); }
private TreeView TreeView() { IPathedDocument padDoc = IdeApp.Workbench.ActiveDocument.GetContent <IPathedDocument>(); Gtk.TreeView tree = new Gtk.TreeView(); Gtk.TreeViewColumn objectColumn = new Gtk.TreeViewColumn(); objectColumn.Title = "object"; Gtk.TreeViewColumn metrixColumn = new Gtk.TreeViewColumn(); metrixColumn.Title = "metrix"; // Add the columns to the TreeView tree.AppendColumn(objectColumn); tree.AppendColumn(metrixColumn); Gtk.ListStore listStore = new Gtk.ListStore(typeof(string), typeof(string)); foreach (var item in padDoc.CurrentPath) { listStore.AppendValues(item.Markup, "0"); } tree.Model = listStore; Gtk.CellRendererText artistNameCell = new Gtk.CellRendererText(); objectColumn.PackStart(artistNameCell, true); Gtk.CellRendererText songTitleCell = new Gtk.CellRendererText(); metrixColumn.PackStart(songTitleCell, true); objectColumn.AddAttribute(artistNameCell, "text", 0); metrixColumn.AddAttribute(songTitleCell, "text", 1); return(tree); }
void DetachPathedDocument() { if (pathDoc != null) { pathDoc.PathChanged -= HandlePathChange; pathDoc = null; } }
internal override IShellDocumentViewItem OnCreateShellView(IWorkbenchWindow window) { shellContentView = window.CreateViewContent(); shellContentView.SetContentLoader(LoadControl); if (pathDoc != null) { shellContentView.ShowPathBar(pathDoc); pathDoc = null; } shellContentView.ContentInserted += ShellContentView_ContentInserted; return(shellContentView); }
protected override async Task OnLoad(CancellationToken cancellationToken) { if (box == null) { box = new VBox(); box.Accessible.SetShouldIgnore(true); Add(box); box.Show(); } var control = await contentLoader(cancellationToken); if (cancellationToken.IsCancellationRequested) { return; } if (viewControl != null) { box.Remove(viewControl); viewControl = null; } if (control != null) { viewControl = control.GetNativeWidget <Gtk.Widget> (); box.PackStart(viewControl, true, true, 0); if (bottomToolbar != null) { box.ReorderChild(bottomToolbar.Container, box.Children.Length - 1); } } if (pathDocPending != null) { ShowPathBar(pathDocPending); pathDocPending = null; } ContentInserted?.Invoke(this, EventArgs.Empty); }
void IShellDocumentViewContent.ShowPathBar(IPathedDocument pathedDocument) { this.pathedDocument = pathedDocument; }
void IShellDocumentViewContent.HidePathBar() { pathedDocument = null; }