Example #1
0
        private void OnDocumentMouseOver(object sender, HtmlElementEventArgs e)
        {
            var element = e.ToElement;

            if ((element != null) && (element.TagName.Equals("A")))
            {
                String href = element.GetAttribute("href"), tooltip = href;

                if (NeedLinkTooltip != null)
                {
                    var args = new NeedLinkTooltipEventArgs(href);
                    NeedLinkTooltip(this, args);

                    if (!String.IsNullOrWhiteSpace(args.tooltip))
                    {
                        tooltip = args.tooltip;
                    }
                }

                if (!tooltip.Equals(element.GetAttribute("title")))
                {
                    // Prevent setting the tooltip causing a text change notification
                    m_TextChangeTimer.Stop();

                    element.SetAttribute("title", tooltip);
                    m_PrevTextChange = InnerHtml;

                    m_TextChangeTimer.Start();
                }
            }
        }
Example #2
0
        private void OnDocumentMouseOver(object sender, HtmlElementEventArgs e)
        {
            var    element = e.ToElement;
            String href    = GetElementUrl(element);

            if (!String.IsNullOrEmpty(href))
            {
                var tooltip = href;

                if (NeedLinkTooltip != null)
                {
                    var args = new NeedLinkTooltipEventArgs(href);
                    NeedLinkTooltip(this, args);

                    if (!String.IsNullOrWhiteSpace(args.tooltip))
                    {
                        tooltip = args.tooltip;
                    }
                }

                if (IsEditable)
                {
                    // No need for tooltip if the same as the visible text
                    if (tooltip.Contains(element.InnerText))
                    {
                        tooltip = String.Empty;
                    }
                    else
                    {
                        tooltip = tooltip + "\n";
                    }

                    tooltip = tooltip + m_Trans.Translate("'CTRL + click' to follow link");
                }

                if (!tooltip.Equals(element.GetAttribute("title")))
                {
                    // Prevent setting the tooltip causing a text change notification
                    m_TextChangeTimer.Stop();

                    element.SetAttribute("title", tooltip);
                    m_PrevTextChange = InnerHtml;

                    m_TextChangeTimer.Start();
                }
            }
        }
Example #3
0
 private void OnNeedLinkTooltip(object sender, NeedLinkTooltipEventArgs e)
 {
     ContentControlWnd.ParentNotify notify = new ContentControlWnd.ParentNotify(m_HwndParent, Handle);
     e.tooltip = notify.NotifyWantLinkTooltip(e.linkUri);
 }