ComponentFactory.Krypton.Ribbon.ViewDrawRibbonCaptionArea.DoesCurrentMouseDownEndAllTracking C# (CSharp) Method

DoesCurrentMouseDownEndAllTracking() public method

Should a mouse down at the provided point cause an end to popup tracking.
public DoesCurrentMouseDownEndAllTracking ( Point pt ) : bool
pt Point Client coordinates point.
return bool
        public bool DoesCurrentMouseDownEndAllTracking(Point pt)
        {
            // If integrated into custom chrome...
            if (UsingCustomChrome)
            {
                // Convert point to the form coordinates
                Point formPt = _kryptonForm.PointToClient(pt);
                Padding formPadding =_kryptonForm.RealWindowBorders;
                formPt.X += formPadding.Left;
                formPt.Y += formPadding.Top;

                if (ContextTitles != null)
                {
                    // Search the context title elements for a match
                    foreach (ViewBase child in ContextTitles)
                        if ((child is ViewDrawRibbonContextTitle) && child.ClientRectangle.Contains(formPt))
                            return false;
                }
            }

            return true;
        }

Usage Example

        /// <summary>
        /// Should a mouse down at the provided point cause an end to popup tracking.
        /// </summary>
        /// <param name="m">Original message.</param>
        /// <param name="pt">Client coordinates point.</param>
        /// <returns>True to end tracking; otherwise false.</returns>
        public override bool DoesCurrentMouseDownEndAllTracking(Message m, Point pt)
        {
            // Convert point to the ribbon control coordinates
            Point screenPt = PointToScreen(pt);
            Point ribbonPt = _ribbon.PointToClient(screenPt);

            // If the base class wants to end tracking and not inside the ribbon control
            return(base.DoesCurrentMouseDownEndAllTracking(m, pt) &&
                   !_ribbon.ClientRectangleWithoutComposition.Contains(ribbonPt) &&
                   _captionArea.DoesCurrentMouseDownEndAllTracking(screenPt));
        }