Details for a tooltip related event.
Inheritance: System.EventArgs
Beispiel #1
0
        private void OnShowToolTip(object sender, ToolTipEventArgs e)
        {
            if (!IsDisposed)
            {
                // Do not show tooltips when the form we are in does not have focus
                Form topForm = FindForm();
                if ((topForm != null) && !topForm.ContainsFocus)
                {
                    return;
                }

                // Never show tooltips are design time
                if (!DesignMode)
                {
                    IContentValues sourceContent = null;
                    LabelStyle     toolTipStyle  = LabelStyle.ToolTip;

                    // Find the button spec associated with the tooltip request
                    ButtonSpec buttonSpec = _buttonManager.ButtonSpecFromView(e.Target);

                    // If the tooltip is for a button spec
                    if (buttonSpec != null)
                    {
                        // Are we allowed to show page related tooltips
                        if (AllowButtonSpecToolTips)
                        {
                            // Create a helper object to provide tooltip values
                            ButtonSpecToContent buttonSpecMapping = new ButtonSpecToContent(Redirector, buttonSpec);

                            // Is there actually anything to show for the tooltip
                            if (buttonSpecMapping.HasContent)
                            {
                                sourceContent = buttonSpecMapping;
                                toolTipStyle  = buttonSpec.ToolTipStyle;
                            }
                        }
                    }

                    if (sourceContent != null)
                    {
                        // Remove any currently showing tooltip
                        if (_visualPopupToolTip != null)
                        {
                            _visualPopupToolTip.Dispose();
                        }

                        // Create the actual tooltip popup object
                        _visualPopupToolTip = new VisualPopupToolTip(Redirector,
                                                                     sourceContent,
                                                                     Renderer,
                                                                     PaletteBackStyle.ControlToolTip,
                                                                     PaletteBorderStyle.ControlToolTip,
                                                                     CommonHelper.ContentStyleFromLabelStyle(toolTipStyle));

                        _visualPopupToolTip.Disposed += new EventHandler(OnVisualPopupToolTipDisposed);

                        // Show relative to the provided screen rectangle
                        _visualPopupToolTip.ShowCalculatingSize(RectangleToScreen(e.Target.ClientRectangle));
                    }
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// Raises the ShowTooltip event.
 /// </summary>
 /// <param name="e">A TooltipEventArgs that contains the event data.</param>
 protected virtual void OnShowToolTip(ToolTipEventArgs e)
 {
     ShowToolTip?.Invoke(this, e);
 }
        private void OnShowToolTip(object sender, ToolTipEventArgs e)
        {
            if (!IsDisposed)
            {
                // Do not show tooltips when the form we are in does not have focus
                Form topForm = _calendar.CalendarControl.FindForm();
                if ((topForm != null) && !topForm.ContainsFocus)
                    return;

                // Never show tooltips are design time
                if (!_calendar.InDesignMode)
                {
                    IContentValues sourceContent = null;
                    LabelStyle toolTipStyle = LabelStyle.ToolTip;

                    // Find the button spec associated with the tooltip request
                    ButtonSpec buttonSpec = _buttonManager.ButtonSpecFromView(e.Target);

                    // If the tooltip is for a button spec
                    if (buttonSpec != null)
                    {
                        // Are we allowed to show page related tooltips
                        if (AllowButtonSpecToolTips)
                        {
                            // Create a helper object to provide tooltip values
                            ButtonSpecToContent buttonSpecMapping = new ButtonSpecToContent(_redirector, buttonSpec);

                            // Is there actually anything to show for the tooltip
                            if (buttonSpecMapping.HasContent)
                            {
                                sourceContent = buttonSpecMapping;
                                toolTipStyle = buttonSpec.ToolTipStyle;
                            }
                        }
                    }

                    if (sourceContent != null)
                    {
                        // Remove any currently showing tooltip
                        if (_visualPopupToolTip != null)
                            _visualPopupToolTip.Dispose();

                        // Create the actual tooltip popup object
                        _visualPopupToolTip = new VisualPopupToolTip(_redirector,
                                                                     sourceContent,
                                                                     _calendar.GetRenderer(),
                                                                     PaletteBackStyle.ControlToolTip,
                                                                     PaletteBorderStyle.ControlToolTip,
                                                                     CommonHelper.ContentStyleFromLabelStyle(toolTipStyle));

                        _visualPopupToolTip.Disposed += new EventHandler(OnVisualPopupToolTipDisposed);

                        // Show relative to the provided screen rectangle
                        _visualPopupToolTip.ShowCalculatingSize(_calendar.CalendarControl.RectangleToScreen(e.Target.ClientRectangle));
                    }
                }
            }
        }
Beispiel #4
0
        private void OnStartHover(object sender, ToolTipEventArgs e)
        {
            if (!IsDisposed && (_viewBuilder != null))
            {
                // We do not provide hover support when the form does not have the focus
                Form topForm = FindForm();
                if ((topForm != null) && !topForm.ContainsFocus)
                    return;

                // Never generate hover events at design time
                if (!DesignMode)
                {
                    // Find the page associated with the hover request
                    KryptonPage hoverPage = _viewBuilder.PageFromView(e.Target);
                    if (hoverPage != null)
                    {
                        OnTabMouseHoverStart(new KryptonPageEventArgs(hoverPage, Pages.IndexOf(hoverPage)));
                        _tabHoverStarted = true;
                    }
                }
            }
        }
Beispiel #5
0
        private void OnShowToolTip(object sender, ToolTipEventArgs e)
        {
            if (!IsDisposed && (_viewBuilder != null))
            {
                // Do not show tooltips when the form we are in does not have focus
                Form topForm = FindForm();
                if ((topForm != null) && !topForm.ContainsFocus)
                    return;

                // Never show tooltips are design time
                if (!DesignMode)
                {
                    IContentValues sourceContent = null;
                    LabelStyle toolTipStyle = LabelStyle.ToolTip;

                    // Find the page associated with the tooltip request
                    KryptonPage toolTipPage = _viewBuilder.PageFromView(e.Target);

                    // If the tooltip is for a krypton page header
                    if (toolTipPage != null)
                    {
                        // Are we allowed to show page related tooltips
                        if (_toolTips.AllowPageToolTips)
                        {
                            // Create a helper object to provide tooltip values
                            PageToToolTipMapping pageMapping = new PageToToolTipMapping(toolTipPage,
                                                                                       _toolTips.MapImage,
                                                                                       _toolTips.MapText,
                                                                                       _toolTips.MapExtraText);

                            // Is there actually anything to show for the tooltip
                            if (pageMapping.HasContent)
                            {
                                sourceContent = pageMapping;
                                toolTipStyle = toolTipPage.ToolTipStyle;
                            }
                        }
                    }
                    else
                    {
                        // Find the button spec associated with the tooltip request
                        ButtonSpec buttonSpec = _viewBuilder.ButtonSpecFromView(e.Target);

                        // If the tooltip is for a button spec
                        if (buttonSpec != null)
                        {
                            // Are we allowed to show page related tooltips
                            if (_toolTips.AllowButtonSpecToolTips)
                            {
                                // Create a helper object to provide tooltip values
                                ButtonSpecToContent buttonSpecMapping = new ButtonSpecToContent(Redirector, buttonSpec);

                                // Is there actually anything to show for the tooltip
                                if (buttonSpecMapping.HasContent)
                                {
                                    sourceContent = buttonSpecMapping;
                                    toolTipStyle = buttonSpec.ToolTipStyle;
                                }
                            }
                        }
                    }

                    if (sourceContent != null)
                    {
                        // Remove any currently showing tooltip
                        if (_visualPopupToolTip != null)
                            _visualPopupToolTip.Dispose();

                        // Create the actual tooltip popup object
                        _visualPopupToolTip = new VisualPopupToolTip(Redirector,
                                                                     sourceContent,
                                                                     Renderer,
                                                                     PaletteBackStyle.ControlToolTip,
                                                                     PaletteBorderStyle.ControlToolTip,
                                                                     CommonHelper.ContentStyleFromLabelStyle(toolTipStyle));

                        _visualPopupToolTip.Disposed += new EventHandler(OnVisualPopupToolTipDisposed);

                        // Show relative to the provided screen point
                        _visualPopupToolTip.ShowCalculatingSize(e.ScreenPt);
                    }
                }
            }
        }
Beispiel #6
0
 /// <summary>
 /// Raises the ShowTooltip event.
 /// </summary>
 /// <param name="e">A TooltipEventArgs that contains the event data.</param>
 protected virtual void OnShowToolTip(ToolTipEventArgs e)
 {
     if (ShowToolTip != null)
         ShowToolTip(this, e);
 }