예제 #1
0
        /// <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);
        }
예제 #2
0
        protected override void OnSetCursor(SetCursorEventArgs e)
        {
            if (_canPan && e.HitTest == HitTest.Client)
            {
                e.Cursor = PanCursor;
            }

            base.OnSetCursor(e);
        }
예제 #3
0
        protected virtual void OnSetCursor(SetCursorEventArgs e)
        {
            var handler = SetCursor;

            if (handler != null)
            {
                handler(this, e);
            }
        }
예제 #4
0
        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;
        }