/// <summary> /// Called whent he cursor changes. /// </summary> /// <param name="e">The event args.</param> protected override void OnSetCursor(SetCursorEventArgs e) { _cachedLink = null; if (_pageCacheValid) { var offset = GetScrollOffset(); var location = new Point( e.Location.X - offset.Width, e.Location.Y - offset.Height ); for (int page = _visiblePageStart; page <= _visiblePageEnd; page++) { foreach (var link in GetPageLinks(page)) { if (link.Bounds.Contains(location)) { _cachedLink = link; e.Cursor = Cursors.Hand; return; } } } } base.OnSetCursor(e); }
private void WmSetCursor(ref Message m) { var e = new SetCursorEventArgs(PointToClient(Cursor.Position)); OnSetCursor(e); Cursor.Current = e.Cursor ?? Cursor; }
protected override void OnSetCursor(SetCursorEventArgs e) { if (MousePanningEnabled && _canPan && e.HitTest == HitTest.Client) { e.Cursor = PanCursor; } base.OnSetCursor(e); }
protected virtual void OnSetCursor(SetCursorEventArgs e) { var handler = SetCursor; if (handler != null) { handler(this, e); } }
private void WmSetCursor(ref Message m) { var e = new SetCursorEventArgs( PointToClient(Cursor.Position), (HitTest)(m.LParam.ToInt32() & 0xffff) ); OnSetCursor(e); Cursor.Current = e.Cursor ?? Cursor; }
protected override void OnSetCursor(SetCursorEventArgs e) { _cachedLink = null; if (_pageCacheValid) { var bounds = GetScrollClientArea(); int maxWidth = (int)(_maxWidth * _scaleFactor) + ShadeBorder.Size.Horizontal + PageMargin.Horizontal; int leftOffset = (HScroll ? DisplayRectangle.X : (bounds.Width - maxWidth) / 2) + maxWidth / 2; var displayLocation = DisplayRectangle.Location; var location = new Point( e.Location.X, e.Location.Y - displayLocation.Y ); for (int page = _visiblePageStart; page <= _visiblePageEnd; page++) { var links = GetPageLinks(page); var pageLocation = location; var pageBounds = _pageCache[page].Bounds; pageLocation.X -= leftOffset + pageBounds.Left; pageLocation.Y -= pageBounds.Top; foreach (var link in links.Links) { if (link.Bounds.Contains(pageLocation)) { _cachedLink = link; e.Cursor = Cursors.Hand; return; } } } } base.OnSetCursor(e); }
/// <summary> /// Called whent he cursor changes. /// </summary> /// <param name="e">The event args.</param> protected override void OnSetCursor(SetCursorEventArgs e) { _cachedLink = null; if (_pageCacheValid) { var offset = GetScrollOffset(); var location = new Point( e.Location.X - offset.Width, e.Location.Y - offset.Height ); for (int page = _visiblePageStart; page <= _visiblePageEnd; page++) { foreach (var link in GetPageLinks(page)) { if (link.Bounds.Contains(location)) { _cachedLink = link; e.Cursor = Cursors.Hand; return; } } } if (_cursorMode == PdfViewerCursorMode.TextSelection) { var state = GetMouseState(e.Location); if (state.CharacterIndex >= 0) { e.Cursor = Cursors.IBeam; return; } } } base.OnSetCursor(e); }
/// <summary> /// Called whent he cursor changes. /// </summary> /// <param name="e">The event args.</param> protected override void OnSetCursor(SetCursorEventArgs e) { _cachedLink = null; if (_pageCacheValid) { var offset = GetScrollOffset(); var bounds = GetScrollClientArea(); var displayLocation = DisplayRectangle.Location; var location = new Point( e.Location.X, e.Location.Y - displayLocation.Y ); for (int page = _visiblePageStart; page <= _visiblePageEnd; page++) { var links = GetPageLinks(page); var pageLocation = location; var pageBounds = _pageCache[page].Bounds; pageLocation.X -= offset.Width + pageBounds.Left; pageLocation.Y -= pageBounds.Top; foreach (var link in links.Links) { if (link.Bounds.Contains(pageLocation)) { _cachedLink = link; e.Cursor = Cursors.Hand; return; } } } } base.OnSetCursor(e); }
protected virtual void OnSetCursor(SetCursorEventArgs e) { var handler = SetCursor; if (handler != null) handler(this, e); }
protected override void OnSetCursor(SetCursorEventArgs e) { if (_canPan && e.HitTest == HitTest.Client) e.Cursor = PanCursor; base.OnSetCursor(e); }