internal void SetStatus(NestedPaneCollection nestedPanes, DockPane previousPane, DockAlignment alignment, double proportion) { m_nestedPanes = nestedPanes; m_previousPane = previousPane; m_alignment = alignment; m_proportion = proportion; }
internal DockWindow(DockPanel dockPanel, DockState dockState) { m_nestedPanes = new NestedPaneCollection(this); m_dockPanel = dockPanel; m_dockState = dockState; Visible = false; SuspendLayout(); if (DockState == DockState.DockLeft || DockState == DockState.DockRight || DockState == DockState.DockTop || DockState == DockState.DockBottom) { m_splitter = new SplitterControl(); Controls.Add(m_splitter); } if (DockState == DockState.DockLeft) { Dock = DockStyle.Left; m_splitter.Dock = DockStyle.Right; } else if (DockState == DockState.DockRight) { Dock = DockStyle.Right; m_splitter.Dock = DockStyle.Left; } else if (DockState == DockState.DockTop) { Dock = DockStyle.Top; m_splitter.Dock = DockStyle.Bottom; } else if (DockState == DockState.DockBottom) { Dock = DockStyle.Bottom; m_splitter.Dock = DockStyle.Top; } else if (DockState == DockState.Document) { Dock = DockStyle.Fill; } ResumeLayout(); }
private void InternalConstruct(DockPanel dockPanel, DockPane pane, bool boundsSpecified, Rectangle bounds) { if (dockPanel == null) throw(new ArgumentNullException(Strings.FloatWindow_Constructor_NullDockPanel)); m_nestedPanes = new NestedPaneCollection(this); FormBorderStyle = FormBorderStyle.SizableToolWindow; ShowInTaskbar = false; if (dockPanel.RightToLeft != RightToLeft) RightToLeft = dockPanel.RightToLeft; if (RightToLeftLayout != dockPanel.RightToLeftLayout) RightToLeftLayout = dockPanel.RightToLeftLayout; SuspendLayout(); if (boundsSpecified) { Bounds = bounds; StartPosition = FormStartPosition.Manual; } else { StartPosition = FormStartPosition.WindowsDefaultLocation; Size = dockPanel.DefaultFloatWindowSize; } m_dockPanel = dockPanel; Owner = DockPanel.FindForm(); DockPanel.AddFloatWindow(this); if (pane != null) pane.FloatWindow = this; ResumeLayout(); }
private static void MergeNestedPanes(VisibleNestedPaneCollection nestedPanesFrom, NestedPaneCollection nestedPanesTo, DockPane prevPane, DockAlignment alignment, double proportion) { if (nestedPanesFrom.Count == 0) return; int count = nestedPanesFrom.Count; DockPane[] panes = new DockPane[count]; DockPane[] prevPanes = new DockPane[count]; DockAlignment[] alignments = new DockAlignment[count]; double[] proportions = new double[count]; for (int i = 0; i < count; i++) { panes[i] = nestedPanesFrom[i]; prevPanes[i] = nestedPanesFrom[i].NestedDockingStatus.PreviousPane; alignments[i] = nestedPanesFrom[i].NestedDockingStatus.Alignment; proportions[i] = nestedPanesFrom[i].NestedDockingStatus.Proportion; } DockPane pane = panes[0].DockTo(nestedPanesTo.Container, prevPane, alignment, proportion); panes[0].DockState = nestedPanesTo.DockState; for (int i = 1; i < count; i++) { for (int j = i; j < count; j++) { if (prevPanes[j] == panes[i - 1]) prevPanes[j] = pane; } pane = panes[i].DockTo(nestedPanesTo.Container, prevPanes[i], alignments[i], proportions[i]); panes[i].DockState = nestedPanesTo.DockState; } }
private void InternalConstruct(DockPanel dockPanel, DockPane pane, bool boundsSpecified, Rectangle bounds) { if (dockPanel == null) throw (new ArgumentNullException(Strings.FloatWindow_Constructor_NullDockPanel)); this.m_nestedPanes = new NestedPaneCollection(this); FormBorderStyle = FormBorderStyle.SizableToolWindow; ShowInTaskbar = false; if (dockPanel.RightToLeft != RightToLeft) RightToLeft = dockPanel.RightToLeft; if (RightToLeftLayout != dockPanel.RightToLeftLayout) RightToLeftLayout = dockPanel.RightToLeftLayout; SuspendLayout(); if (!boundsSpecified) { Bounds = bounds; StartPosition = FormStartPosition.Manual; } else { StartPosition = FormStartPosition.WindowsDefaultLocation; } if (pane != null) pane.FloatWindow = this; this.m_dockPanel = dockPanel; Owner = this.DockPanel.FindForm(); Size = bounds.Size; // Suspend child controls from resizing every pixel ResizeBegin += (s, e) => SuspendLayout(); ResizeEnd += (s, e) => ResumeLayout(true); this.DockPanel.AddFloatWindow(this); ResumeLayout(); }