/// <summary> /// Docks the given document to the editor tab control (object editors and plugins). /// </summary> public TabPage DockDocument(ITabDocument document, bool activate) { Logger.LogDebug("WQE.net", 1, "Docking new document (activate it: " + activate + ")\n"); if (document is DockablePlugin) { (document as DockablePlugin).UpdateColors(); } if (!mainContentTabControl.HasDocument(document)) { mainContentTabControl.AddDocument(document); } if (activate) { document.Activate(); } return(mainContentTabControl.SelectedTab); }
/// <summary> /// Docks the given document to the bottom tab control (like object editors etc.). /// </summary> /// <param name="document"></param> public void DockDocument(ITabDocument document, bool activate) { if (!bottomTabControl.HasDocument(document)) { bottomTabControl.AddDocument(document); } if (activate) { document.Activate(); } if (contentSplitContainer.Panel2Collapsed) { contentSplitContainer.Panel2Collapsed = false; // Set a splitter distance or we end up at almost full display. Use a relatively small // value for panel2. The document's minheight will kick in and does the right job. contentSplitContainer.SplitterDistance = contentSplitContainer.Height - 100; } }
private void DockSideDocument(ITabDocument document, bool top, bool activate) { if (top) { if (!sideTopTabControl.HasDocument(document)) { int index = sideTopTabControl.AddDocument(document); sideTopTabControl.TabPages[index].BackColor = Color.White; } } else { if (!sideBottomTabControl.HasDocument(document)) { int index = sideBottomTabControl.AddDocument(document); sideBottomTabControl.TabPages[index].BackColor = Color.White; } } if (activate) { document.Activate(); } if (sideBottomTabControl.TabCount == 0) { sideSplitContainer.Panel2Collapsed = true; // This will implicitly expand panel1. } else { sideSplitContainer.Panel1Collapsed = false; } if (sideTopTabControl.TabCount == 0) { sideSplitContainer.Panel1Collapsed = true; // This will implicitly expand panel2. } else { sideSplitContainer.Panel2Collapsed = false; } }
private void DockSideDocument(ITabDocument document, bool top, bool activate) { if (top) { if (!sideTopTabControl.HasDocument(document)) { int index = sideTopTabControl.AddDocument(document); sideTopTabControl.TabPages[index].BackColor = Color.White; } } else { if (!sideBottomTabControl.HasDocument(document)) { int index = sideBottomTabControl.AddDocument(document); sideBottomTabControl.TabPages[index].BackColor = Color.White; } } if (activate) document.Activate(); if (sideBottomTabControl.TabCount == 0) sideSplitContainer.Panel2Collapsed = true; // This will implicitly expand panel1. else sideSplitContainer.Panel1Collapsed = false; if (sideTopTabControl.TabCount == 0) sideSplitContainer.Panel1Collapsed = true; // This will implicitly expand panel2. else sideSplitContainer.Panel2Collapsed = false; }
/// <summary> /// Docks the given document to the bottom tab control (like object editors etc.). /// </summary> /// <param name="document"></param> public void DockDocument(ITabDocument document, bool activate) { if (!bottomTabControl.HasDocument(document)) bottomTabControl.AddDocument(document); if (activate) document.Activate(); if (contentSplitContainer.Panel2Collapsed) { contentSplitContainer.Panel2Collapsed = false; // Set a splitter distance or we end up at almost full display. Use a relatively small // value for panel2. The document's min height will kick in and does the right job. contentSplitContainer.SplitterDistance = contentSplitContainer.Height - 100; } }
/// <summary> /// Docks the given document to either the own tab control (as main document) or as /// editor window to the currently active main document. /// </summary> /// <param name="document">The document to dock.</param> /// <param name="main">If true then dock that document to our own tab control, otherwise /// dock it to the currently active main document.</param> public void DockDocument(ITabDocument document, bool main, bool activate) { if (main) { int index = -1; if (!contentTabControl.HasDocument(document)) { IWorkbenchDocument wbDocument = document as IWorkbenchDocument; SetupDockLayout(document, (wbDocument != null) ? wbDocument.BackendForm : null, contentTabControl.TabCount > 0); index = contentTabControl.AddDocument(document); } if (index == 0) // Replace the title by an icon. { contentTabControl.TabPages[index].ImageIndex = 0; contentTabControl.SetCloseButtonVisibility(0, FlatTabControl.CloseButtonVisiblity.HideButton); } if (activate) { document.Activate(); AdjustGlassFrame(document.ToolbarHeight); } } else { ITabDocument host = contentTabControl.ActiveDocument; if (host is ModelDiagramForm) (host as ModelDiagramForm).DockDocument(document, activate); else if (host is ModelOverviewForm) (host as ModelOverviewForm).DockDocument(document, activate); else if (host is SqlIdeForm) (host as SqlIdeForm).DockDocument(document, activate); } // Do the color updates after everything set up as this depends on the structure. if (document is IWorkbenchDocument) (document as IWorkbenchDocument).UpdateColors(); else if (document is AppViewDockContent) (document as AppViewDockContent).UpdateColors(); }
/// <summary> /// Docks the given document to the editor tab control (object editors and plugins). /// </summary> public TabPage DockDocument(ITabDocument document, bool activate) { Logger.LogDebug("WQE.net", 1, "Docking new document (activate it: " + activate + ")\n"); if (document is DockablePlugin) (document as DockablePlugin).UpdateColors(); if (!mainContentTabControl.HasDocument(document)) mainContentTabControl.AddDocument(document); if (activate) document.Activate(); return mainContentTabControl.SelectedTab; }