private void RightButtonDown(ref Message m) { if (UPlan.Frame.DockForm.NativeMethods.SendMessage(base.Handle, 0x84, 0, (uint)((int)m.LParam)) == 2) { DockPane pane = (this.VisibleNestedPanes.Count == 1) ? this.VisibleNestedPanes[0] : null; if ((pane != null) && (pane.ActiveContent != null)) { pane.ShowTabPageContextMenu(this, base.PointToClient(Control.MousePosition)); return; } } base.WndProc(ref m); }
protected override void WndProc(ref Message m) { if (m.Msg == 161) { if (!base.IsDisposed) { if (((NativeMethods.SendMessage(base.Handle, 132, 0, (uint)((int)m.LParam)) == 2) && this.DockPanel.AllowEndUserDocking) && this.AllowEndUserDocking) { base.Activate(); this.m_dockPanel.BeginDrag(this); } else { base.WndProc(ref m); } } } else if (m.Msg == 164) { if (NativeMethods.SendMessage(base.Handle, 132, 0, (uint)((int)m.LParam)) == 2) { DockPane pane = (this.VisibleNestedPanes.Count == 1) ? this.VisibleNestedPanes[0] : null; if ((pane != null) && (pane.ActiveContent != null)) { pane.ShowTabPageContextMenu(this, base.PointToClient(Control.MousePosition)); return; } } base.WndProc(ref m); } else if (m.Msg == 16) { if (this.NestedPanes.Count == 0) { base.WndProc(ref m); } else { for (int i = this.NestedPanes.Count - 1; i >= 0; i--) { DockContentCollection contents = this.NestedPanes[i].Contents; for (int j = contents.Count - 1; j >= 0; j--) { IDockContent content = contents[j]; if ((content.DockHandler.DockState == DockState.Float) && content.DockHandler.CloseButton) { if (content.DockHandler.HideOnClose) { content.DockHandler.Hide(); } else { content.DockHandler.Close(); } } } } } } else if (m.Msg == 163) { if (NativeMethods.SendMessage(base.Handle, 132, 0, (uint)((int)m.LParam)) != 2) { base.WndProc(ref m); } else { this.DockPanel.SuspendLayout(true); foreach (DockPane pane2 in this.NestedPanes) { if (pane2.DockState == DockState.Float) { pane2.RestoreToPanel(); } } this.DockPanel.ResumeLayout(true, true); } } else if (m.Msg == 1025) { if (this.NestedPanes.Count == 0) { base.Dispose(); } } else { base.WndProc(ref m); } }
protected void ShowTabPageContextMenu(Point position) { DockPane.ShowTabPageContextMenu(this, position); }
protected override void WndProc(ref Message m) { if (m.Msg == 161) { if (!base.IsDisposed) { uint num = NativeMethods.SendMessage(base.Handle, 132, 0u, (uint)(int)m.LParam); if (num == 2 && DockPanel.AllowEndUserDocking && AllowEndUserDocking) { Activate(); m_dockPanel.BeginDrag(this); } else { base.WndProc(ref m); } } } else if (m.Msg == 164) { uint num = NativeMethods.SendMessage(base.Handle, 132, 0u, (uint)(int)m.LParam); if (num == 2) { DockPane dockPane = (VisibleNestedPanes.Count == 1) ? VisibleNestedPanes[0] : null; if (dockPane != null && dockPane.ActiveContent != null) { dockPane.ShowTabPageContextMenu(this, PointToClient(Control.MousePosition)); return; } } base.WndProc(ref m); } else if (m.Msg == 16) { if (NestedPanes.Count == 0) { base.WndProc(ref m); } else { for (int num2 = NestedPanes.Count - 1; num2 >= 0; num2--) { DockContentCollection contents = NestedPanes[num2].Contents; for (int num3 = contents.Count - 1; num3 >= 0; num3--) { IDockContent dockContent = contents[num3]; if (dockContent.DockHandler.DockState == DockState.Float && dockContent.DockHandler.CloseButton) { if (dockContent.DockHandler.HideOnClose) { dockContent.DockHandler.Hide(); } else { dockContent.DockHandler.Close(); } } } } } } else if (m.Msg == 163) { uint num = NativeMethods.SendMessage(base.Handle, 132, 0u, (uint)(int)m.LParam); if (num != 2) { base.WndProc(ref m); } else { DockPanel.SuspendLayout(allWindows: true); foreach (DockPane nestedPane in NestedPanes) { if (nestedPane.DockState == DockState.Float) { nestedPane.RestoreToPanel(); } } DockPanel.ResumeLayout(performLayout: true, allWindows: true); } } else if (m.Msg == 1025) { if (NestedPanes.Count == 0) { Dispose(); } } else { base.WndProc(ref m); } }
protected override void WndProc(ref Message m) { switch (m.Msg) { case (int)Win32.Msgs.WM_NCLBUTTONDOWN: { if (IsDisposed) { return; } uint result = Win32Helper.IsRunningOnMono ? 0 : NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam); if (result == 2 && DockPanel.AllowEndUserDocking && this.AllowEndUserDocking) // HITTEST_CAPTION { Activate(); m_dockPanel.BeginDrag(this); } else { base.WndProc(ref m); } return; } case (int)Win32.Msgs.WM_NCRBUTTONDOWN: { uint result = Win32Helper.IsRunningOnMono ? Win32Helper.HitTestCaption(this) : NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam); if (result == 2) // HITTEST_CAPTION { DockPane theOnlyPane = (VisibleNestedPanes.Count == 1) ? VisibleNestedPanes[0] : null; if (theOnlyPane != null && theOnlyPane.ActiveContent != null) { theOnlyPane.ShowTabPageContextMenu(this, PointToClient(Control.MousePosition)); return; } } base.WndProc(ref m); return; } case (int)Win32.Msgs.WM_CLOSE: if (NestedPanes.Count == 0) { base.WndProc(ref m); return; } for (int i = NestedPanes.Count - 1; i >= 0; i--) { DockContentCollection contents = NestedPanes[i].Contents; for (int j = contents.Count - 1; j >= 0; j--) { IDockContent content = contents[j]; if (content.DockHandler.DockState != DockState.Float) { continue; } if (!content.DockHandler.CloseButton) { continue; } if (content.DockHandler.HideOnClose) { content.DockHandler.Hide(); } else { content.DockHandler.Close(); } } } return; case (int)Win32.Msgs.WM_NCLBUTTONDBLCLK: { uint result = !DoubleClickTitleBarToDock || Win32Helper.IsRunningOnMono ? Win32Helper.HitTestCaption(this) : NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam); if (result != 2) // HITTEST_CAPTION { base.WndProc(ref m); return; } DockPanel.SuspendLayout(true); // Restore to panel foreach (DockPane pane in NestedPanes) { if (pane.DockState != DockState.Float) { continue; } pane.RestoreToPanel(); } DockPanel.ResumeLayout(true, true); return; } case WM_CHECKDISPOSE: if (NestedPanes.Count == 0) { Dispose(); } return; } base.WndProc(ref m); }