protected override void OnMouseUp(MouseButtonEventArgs e) { base.OnMouseUp(e); this.OnWorksheetMouseUp(e.GetPosition(this), WPFUtility.ConvertToUIMouseButtons(e)); if (mouseCaptured) { ReleaseMouseCapture(); } }
protected override void OnMouseDown(System.Windows.Input.MouseButtonEventArgs e) { base.OnMouseDown(e); Focus(); var pos = e.GetPosition(this); double right = this.RenderSize.Width; double bottom = this.RenderSize.Height; if (this.verScrollbar.Visibility == Visibility.Visible) { right = Canvas.GetLeft(this.verScrollbar); } if (this.sheetTab.Visibility == Visibility.Visible) { bottom = Canvas.GetTop(this.sheetTab); } else if (this.horScrollbar.Visibility == Visibility.Visible) { bottom = Canvas.GetTop(this.horScrollbar); } if (pos.X < right && pos.Y < bottom) { if (e.ClickCount == 2) { this.currentWorksheet.OnMouseDoubleClick(e.GetPosition(this), WPFUtility.ConvertToUIMouseButtons(e)); } else { this.OnWorksheetMouseDown(e.GetPosition(this), WPFUtility.ConvertToUIMouseButtons(e)); if (CaptureMouse()) { mouseCaptured = true; } } } }
protected override void OnMouseWheel(MouseWheelEventArgs e) { base.OnMouseWheel(e); this.currentWorksheet.OnMouseWheel(e.GetPosition(this), e.Delta, WPFUtility.ConvertToUIMouseButtons(e)); }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); this.OnWorksheetMouseMove(e.GetPosition(this), WPFUtility.ConvertToUIMouseButtons(e)); }