Exemple #1
0
        /// <summary>
        /// Updates state for hover behavior above links.
        /// </summary>
        /// <param name="p">Mouse coordinate.</param>
        /// <returns>True if control must request a repaint.</returns>
        private bool doCheckLinkHover(Point p)
        {
            // Are we over a link area?
            LinkArea overWhat = null;

            foreach (LinkArea link in targetLinks)
            {
                foreach (Rectangle rect in link.ActiveAreas)
                {
                    if (rect.Contains(p))
                    {
                        overWhat = link;
                        break;
                    }
                }
            }
            // We're over a link
            //if (overWhat != null) Cursor = Cursors.Hand;
            if (overWhat != null)
            {
                Cursor = CustomCursor.GetHand(Scale);
            }
            // Nop, not over a link
            else
            {
                Cursor = Cursors.Arrow;
            }
            // Hover state changed: request a repaint
            if (overWhat != hoverLink)
            {
                hoverLink = overWhat;
                return(true);
            }
            return(false);
        }
Exemple #2
0
 /// <summary>
 /// Handles mouse move: switch to hand cursor if hovering over link area.
 /// </summary>
 public override bool DoMouseMove(Point p, MouseButtons button)
 {
     if (rectNotesLink.Contains(p))
     {
         Cursor = CustomCursor.GetHand(scale);
     }
     else
     {
         Cursor = Cursors.Arrow;
     }
     return(base.DoMouseMove(p, button));
 }