FarsiLibrary.Win.FATabStrip.OnCalcTabPage C# (CSharp) Method

OnCalcTabPage() private method

private OnCalcTabPage ( Graphics g, FATabStripItem currentItem ) : void
g System.Drawing.Graphics
currentItem FATabStripItem
return void
        private void OnCalcTabPage(Graphics g, FATabStripItem currentItem)
        {
            Font currentFont = Font;
            if (currentItem == SelectedItem)
                currentFont = new Font(Font, FontStyle.Bold);

            SizeF textSize = g.MeasureString(currentItem.Title, SystemFonts.DefaultFont, new SizeF(200, 10), sf);
            textSize.Width += 15;

            if (RightToLeft == RightToLeft.No)
            {
                RectangleF buttonRect = new RectangleF(DEF_START_POS - 9, 1, textSize.Width, 18);
                currentItem.StripRect = buttonRect;
                DEF_START_POS += (int) textSize.Width;
            }
            else
            {
                RectangleF buttonRect = new RectangleF(DEF_START_POS - textSize.Width + 1, 3, textSize.Width - 1, 17);
                currentItem.StripRect = buttonRect;
                DEF_START_POS -= (int) textSize.Width;
            }
        }