Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        protected override void OnSetCursor(SetCursorEventArgs e)
        {
            if (_canPan && e.HitTest == HitTest.Client)
            {
                e.Cursor = PanCursor;
            }

            base.OnSetCursor(e);
        }
Ejemplo n.º 3
0
        protected virtual void OnSetCursor(SetCursorEventArgs e)
        {
            var handler = SetCursor;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Ejemplo n.º 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;
        }