ComponentFactory.Krypton.Ribbon.CalculatedValues.KeyTipRectToPoint C# (CSharp) Method

KeyTipRectToPoint() public method

Find the correct screen point for a key tip given a rectangle and its group line.
public KeyTipRectToPoint ( Rectangle viewRect, int groupLine ) : Point
viewRect System.Drawing.Rectangle Screen rectangle of the view element.
groupLine int Group line the view is positioned on.
return Point
        public Point KeyTipRectToPoint(Rectangle viewRect, int groupLine)
        {
            Point screenPt;

            switch (groupLine)
            {
                case 1:
                    screenPt = new Point(viewRect.Left + KEYTIP_HOFFSET, viewRect.Top);
                    break;
                case 2:
                    screenPt = new Point(viewRect.Left + KEYTIP_HOFFSET, (viewRect.Top + viewRect.Height / 2) + KEYTIP_VOFFSET_LINE2);
                    break;
                case 3:
                    screenPt = new Point(viewRect.Left + KEYTIP_HOFFSET, viewRect.Bottom);
                    break;
                case 4:
                    screenPt = new Point(viewRect.Left + KEYTIP_HOFFSET, viewRect.Top - KEYTIP_VOFFSET_LINE4);
                    break;
                case 5:
                    screenPt = new Point(viewRect.Left + KEYTIP_HOFFSET, viewRect.Bottom + KEYTIP_VOFFSET_LINE5);
                    break;
                default:
                    // Should never happen!
                    Debug.Assert(false);
                    screenPt = new Point(viewRect.X, viewRect.Y);
                    break;
            }

            return screenPt;
        }