/// <exclude /> protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { base.OnMouseLeftButtonDown(e); if (e.Handled) { return; } if (WindowControl.BeginDrag(this, this, e)) { return; } if (!DockManager.CanDrag(e)) { return; } if (e.ClickCount == 1 && WindowState != WindowState.Maximized) { DockManager.BeginDrag(this, this, e); e.Handled = true; } else if (e.ClickCount == 2) { e.Handled = DockCommands.Execute(this, DoubleClickCommand); } }
private IntPtr FilterMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { switch (msg) { case WM_CLOSE: if (FloatingWindow != null && FloatingWindow.DockControl != null) { PerformClose(); handled = true; } break; case WM_NCLBUTTONDOWN: if (wParam.ToInt32() == HTCAPTION && WindowState != WindowState.Maximized) { short x = (short)((lParam.ToInt32() & 0xFFFF)); short y = (short)((lParam.ToInt32() >> 16)); Point pt = new Point(x, y); DockManager.BeginDrag(this, this, pt); } break; case WM_NCLBUTTONDBLCLK: if (wParam.ToInt32() == HTCAPTION) { handled = DockCommands.Execute(this, DoubleClickCommand); } break; case WM_NCRBUTTONDOWN: if (wParam.ToInt32() == HTCAPTION && FloatingWindow.CountOfVisiblePanes == 1) { short x = (short)((lParam.ToInt32() & 0xFFFF)); short y = (short)((lParam.ToInt32() >> 16)); ContextMenu menu = FloatingWindow.FirstVisiblePane.SelectedItem.TabContextMenu; if (menu != null) { menu.Placement = PlacementMode.AbsolutePoint; menu.PlacementRectangle = new Rect(new Point(x, y), new Size(0, 0)); menu.PlacementTarget = this; menu.IsOpen = true; } } handled = true; break; } return(IntPtr.Zero); }
/// <exclude /> protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { base.OnMouseLeftButtonDown(e); if (e.Handled || !DockManager.CanDrag(e)) return; if (e.ClickCount == 1) { DockManager.BeginDrag(this, this, e); e.Handled = true; } else if (e.ClickCount == 2) e.Handled = DockCommands.Execute(this, DoubleClickCommand); }
/// <exclude /> protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { base.OnMouseLeftButtonDown(e); if (e.Handled) { return; } if (e.ClickCount == 1) { DockItem dockItem = DockItem; if (dockItem != null) { dockItem.Activate(); UpdateLayout(); // Fix in 2.0.4846: this can avoid unnecessary mouse move event caused by layout change } DockManager.BeginDrag(this, this, e); e.Handled = true; } else if (e.ClickCount == 2) { e.Handled = DockCommands.Execute(this, DoubleClickCommand); } }