public void DrawPage(Graphics g, StiTabTitlePosition position, StiTabulatorPage page)
        {
            var rect     = new Rectangle(0, 0, page.Width - 1, page.Height - 1);
            var pageRect = ((StiTabulator)page.Parent).GetTitlePageRectangle(g, page);

            using (Pen penLight = new Pen(StiColorUtils.Light(SystemColors.Control, 30)),
                   penDark = new Pen(StiColorUtils.Dark(SystemColors.Control, 50)))
            {
                DrawDot(g, 0, 0);
                DrawDot(g, rect.Right, 0);
                DrawDot(g, rect.Right, rect.Bottom);
                DrawDot(g, 0, rect.Bottom);


                switch (position)
                {
                case StiTabTitlePosition.LeftHorizontal:
                    DrawPageLeftHorizontal(g, page, penLight, penDark, rect, pageRect);
                    break;

                case StiTabTitlePosition.TopHorizontal:
                    DrawPageTopHorizontal(g, page, penLight, penDark, rect, pageRect);
                    break;

                case StiTabTitlePosition.RightHorizontal:
                    DrawPageRightHorizontal(g, page, penLight, penDark, rect, pageRect);
                    break;
                }
            }
        }
        public void DrawPageTitle(Graphics g, StiTabTitlePosition position, StiTabulatorPage page)
        {
            var       rect = tabulator.GetTitlePageRectangle(g, page);
            Rectangle contentRect;

            if (rect.Width != 0 && rect.Height != 0)
            {
                using (Pen penLight = new Pen(StiColorUtils.Light(SystemColors.Control, 30)),
                       penDark = new Pen(StiColorUtils.Dark(SystemColors.Control, 50)))
                {
                    switch (position)
                    {
                    case StiTabTitlePosition.LeftHorizontal:
                        contentRect = new Rectangle(rect.X + 1, rect.Y + 1, rect.Width - 1, rect.Height - 1);
                        DrawPageTitleLeftHorizontal(g, penLight, penDark, page, rect, contentRect);
                        break;

                    case StiTabTitlePosition.TopHorizontal:
                        contentRect = new Rectangle(rect.X + 1, rect.Y + 1, rect.Width - 1, rect.Height - 1);
                        DrawPageTitleTopHorizontal(g, penLight, penDark, page, rect, contentRect);
                        break;

                    case StiTabTitlePosition.RightHorizontal:
                        contentRect = new Rectangle(rect.X, rect.Y + 3, rect.Width, rect.Height);
                        DrawPageTitleRightHorizontal(g, penLight, penDark, page, rect, contentRect);
                        break;
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void DrawMenuItemText(Graphics g, DrawItemEventArgs e, MenuItem item, bool rightToLeft)
        {
            Rectangle rect = e.Bounds;

            rect.Location = new Point(0, 0);
            if (!(item.Parent is MainMenu))
            {
                if (rightToLeft)
                {
                    rect = new Rectangle(rect.Left + 20, rect.Top, rect.Width - MenuBarWidth - 25, rect.Height);
                }
                else
                {
                    rect = new Rectangle(rect.Left + MenuBarWidth + 5, rect.Top, rect.Width, rect.Height);
                }

                using (var sf = new StringFormat())
                {
                    sf.Alignment = rightToLeft ? StringAlignment.Far : StringAlignment.Near;

                    sf.LineAlignment = StringAlignment.Center;
                    sf.FormatFlags  |= StringFormatFlags.NoWrap;
                    sf.HotkeyPrefix  = HotkeyPrefix.Show;

                    if (item.Enabled)
                    {
                        if (item.DefaultItem)
                        {
                            using (var defaultFont = new Font(Font, FontStyle.Bold))
                            {
                                g.DrawString(item.Text, defaultFont, SystemBrushes.ControlText, rect, sf);
                            }
                        }
                        else
                        {
                            g.DrawString(item.Text, Font, SystemBrushes.ControlText, rect, sf);
                        }
                    }
                    else
                    {
                        using (var brush = new SolidBrush(StiColorUtils.Light(SystemColors.ControlText, 150)))
                        {
                            g.DrawString(item.Text, Font, brush, rect, sf);
                        }
                    }
                }
            }
        }
Exemplo n.º 4
0
        private void DrawMenuItemShortcut(Graphics g, DrawItemEventArgs e, MenuItem item, bool rightToLeft)
        {
            var rect = e.Bounds;

            rect.Location = new Point(0, 0);
            rect.Width   -= 15;

            if (item.ShowShortcut && (!(item.Parent is MainMenu)))
            {
                using (var sf = new StringFormat())
                {
                    if (rightToLeft)
                    {
                        rect.X      += 10;
                        sf.Alignment = StringAlignment.Near;
                    }
                    else
                    {
                        sf.Alignment = StringAlignment.Far;
                    }
                    sf.LineAlignment = StringAlignment.Center;
                    string shortcutText = ConvertShortcut(item.Shortcut);

                    if (item.Enabled)
                    {
                        g.DrawString(shortcutText, Font, SystemBrushes.ControlText, rect, sf);
                    }
                    else
                    {
                        using (var brush = new SolidBrush(StiColorUtils.Light(SystemColors.ControlText, 150)))
                        {
                            g.DrawString(shortcutText, Font, brush, rect, sf);
                        }
                    }
                }
            }
        }
 protected override void OnSystemColorsChanged(EventArgs e)
 {
     base.OnSystemColorsChanged(e);
     StiColors.InitColors();
     BackColor = StiColorUtils.Light(SystemColors.Control, 10);
 }
Exemplo n.º 6
0
        public static void DrawCheckBox(Graphics g, Rectangle rect, string text, Font font,
                                        Color foreColor, Color backColor,
                                        RightToLeft rightToLeft, bool isEnabled,
                                        bool isMouseOver, bool isFocused, bool drawLine, bool isChecked, CheckState checkState,
                                        Appearance appearance)
        {
            Rectangle checkRect = Rectangle.Empty;
            Rectangle textRect  = Rectangle.Empty;

            textRect = new Rectangle(rect.X + 4, rect.Y, rect.Width - 4, rect.Height);
            if (rightToLeft == RightToLeft.No)
            {
                checkRect = new Rectangle(rect.X, rect.Y + (rect.Height - 12) / 2 - 1, 12, 12);
            }
            else
            {
                checkRect = new Rectangle(rect.Right - 15, rect.Y + (rect.Height - 12) / 2 - 1, 12, 12);
            }

            if (appearance == Appearance.Normal)
            {
                if (rightToLeft == RightToLeft.No)
                {
                    textRect.X     += 10;
                    textRect.Width -= 10;
                }
                else
                {
                    textRect.Width -= 16;
                }

                #region PaintLine
                if (drawLine)
                {
                    using (Pen penLight = new Pen(StiColorUtils.Light(SystemColors.Control, 30)),
                           penDark = new Pen(StiColorUtils.Dark(SystemColors.Control, 50)))
                    {
                        int strWidth = (int)g.MeasureString(text, font).Width;

                        int posX = strWidth + 16 + rect.X;
                        int posY = rect.Y + rect.Height / 2;

                        if (posX < rect.Right)
                        {
                            g.DrawLine(penDark, posX, posY, rect.Right, posY);
                            g.DrawLine(penLight, posX, posY + 1, rect.Right, posY + 1);
                        }
                    }
                }
                #endregion

                if (isEnabled)
                {
                    using (var brush = new LinearGradientBrush(checkRect, StiColors.ContentDark, SystemColors.ControlLightLight, 45))
                    {
                        g.FillRectangle(brush, checkRect);
                    }
                }
                else
                {
                    g.FillRectangle(SystemBrushes.Control, checkRect);
                }

                if (isEnabled && (isMouseOver || isFocused))
                {
                    g.DrawRectangle(StiPens.SelectedText, checkRect);
                }
                else
                {
                    g.DrawRectangle(SystemPens.ControlDark, checkRect);
                }

                if (isChecked || checkState == CheckState.Indeterminate)
                {
                    StiControlPaint.DrawCheck(g, checkRect.X + 6, checkRect.Y + 6, isEnabled);
                }

                if (checkState == CheckState.Indeterminate)
                {
                    using (var brush = new SolidBrush(Color.FromArgb(200, SystemColors.Control)))
                    {
                        g.FillRectangle(brush,
                                        checkRect.X + 1, checkRect.Y + 1, checkRect.Width - 2, checkRect.Height - 2);
                    }
                }

                #region Paint focus
                if (isFocused)
                {
                    Rectangle focusRect = textRect;
                    SizeF     sizeText  = g.MeasureString(text, font);
                    focusRect.Width  = (int)sizeText.Width;
                    focusRect.Y      = (focusRect.Height - ((int)sizeText.Height + 2)) / 2;
                    focusRect.Height = (int)sizeText.Height + 2;

                    if (rightToLeft == RightToLeft.Yes)
                    {
                        focusRect.X = textRect.Right - focusRect.Width;
                    }

                    ControlPaint.DrawFocusRectangle(g, focusRect);
                }
                #endregion
            }
            else
            {
                StiButton.DrawButton(g, rect, text, font, foreColor, backColor, null, -1, null, rightToLeft,
                                     false, isEnabled, isMouseOver, isChecked, false, isFocused,
                                     ContentAlignment.BottomCenter, ContentAlignment.MiddleCenter);
            }

            #region Paint string
            if (appearance == Appearance.Normal)
            {
                using (var sf = new StringFormat())
                    using (var foreBrush = new SolidBrush(foreColor))
                    {
                        sf.FormatFlags   = StringFormatFlags.NoWrap;
                        sf.LineAlignment = StringAlignment.Center;
                        sf.Trimming      = StringTrimming.EllipsisCharacter;
                        sf.HotkeyPrefix  = HotkeyPrefix.Show;

                        if (rightToLeft == RightToLeft.Yes)
                        {
                            sf.FormatFlags |= StringFormatFlags.DirectionRightToLeft;
                        }

                        if (isEnabled)
                        {
                            g.DrawString(text, font, foreBrush, textRect, sf);
                        }
                        else
                        {
                            ControlPaint.DrawStringDisabled(g, text, font, backColor,
                                                            textRect, sf);
                        }
                    }
            }
            #endregion
        }
Exemplo n.º 7
0
        public static void DrawButton(Graphics g, Rectangle rect, string text, Font font,
                                      Color foreColor, Color backColor,
                                      ImageList imageList, int imageIndex, Image image, RightToLeft rightToLeft, bool wordWrap,
                                      bool isEnabled, bool isMouseOver, bool isPressed,
                                      bool isDefault, bool isFocused, ContentAlignment imageAlign, ContentAlignment textAlign)
        {
            Rectangle btRect = new Rectangle(rect.X, rect.Y, rect.Width - 1, rect.Height - 1);

            Color controlStart = StiColorUtils.Light(backColor, 30);
            Color controlEnd   = StiColorUtils.Dark(backColor, 10);

            Color controlStartLight = StiColorUtils.Light(controlStart, 20);
            Color controlEndLight   = StiColorUtils.Light(controlEnd, 20);

            Color controlStartDark = StiColorUtils.Dark(controlStart, 20);
            Color controlEndDark   = StiColorUtils.Dark(controlEnd, 20);

            Color clBorderStart = StiColorUtils.Dark(controlStart, 20);
            Color clBorderEnd   = StiColorUtils.Dark(controlEnd, 20);

            Color clStart = controlStart;
            Color clEnd   = controlEnd;

            if (isMouseOver)
            {
                clStart = controlStartLight;
                clEnd   = controlEndLight;
            }

            if (isPressed)
            {
                clStart = controlStartDark;
                clEnd   = controlEndDark;
            }

            var grRect2 = new Rectangle(btRect.X + 1, btRect.Y + 1, btRect.Width - 1, btRect.Height - 1);

            using (var brush = new LinearGradientBrush(grRect2, clBorderStart, clBorderEnd, 90f))
            {
                g.FillRectangle(brush, grRect2);
            }

            var grRect = new Rectangle(btRect.X + 1, btRect.Y + 1, btRect.Width - 2, btRect.Height - 2);

            using (var brush = new LinearGradientBrush(grRect, clStart, clEnd, 90f))
            {
                g.FillRectangle(brush, grRect);
            }


            var oldSmoothingMode = g.SmoothingMode;

            g.SmoothingMode = SmoothingMode.AntiAlias;

            #region Paint border
            using (var pen = new Pen(StiColorUtils.Dark(SystemColors.ControlDark, 30)))
            {
                DrawRoundedRectangle(g, pen, btRect, new Size(4, 4));
                if (isDefault)
                {
                    g.DrawRectangle(pen, new Rectangle(btRect.X + 1, btRect.Y + 1, btRect.Width - 2, btRect.Height - 2));
                }
            }
            #endregion

            g.SmoothingMode = oldSmoothingMode;

            if (isFocused)
            {
                var focusRect = new Rectangle(rect.X + 4, rect.Y + 4, rect.Width - 7, rect.Height - 7);
                ControlPaint.DrawFocusRectangle(g, focusRect, SystemColors.ControlDark, SystemColors.Control);
            }

            Rectangle imageRect;
            Rectangle textRect;

            CalcRectangles(out textRect, out imageRect,
                           new Rectangle(rect.X + 4, rect.Y + 4, rect.Width - 8, rect.Height - 8),
                           g, isEnabled, imageList, imageIndex, image, text,
                           wordWrap, rightToLeft, foreColor, backColor,
                           font, imageAlign, textAlign, isPressed);

            try
            {
                DrawImage(g, isEnabled, imageRect, imageList, imageIndex, image);
            }
            catch
            {
            }

            DrawText(g, text, wordWrap, rightToLeft, isEnabled, foreColor, textRect, font,
                     textAlign, imageAlign);
        }
        protected override void OnPaint(PaintEventArgs p)
        {
            var g = p.Graphics;

            #region Content
            var contentRect = new Rectangle(0, HeaderHeight, Width, Height - HeaderHeight - PanelDistance);

            if (BackgroundImage == null)
            {
                using (var brush = new SolidBrush(BackColor))
                {
                    g.FillRectangle(brush, contentRect.Left, contentRect.Top, contentRect.Width + 1, contentRect.Height + 1);
                }
            }
            else
            {
                StiControlPaint.DrawImageBackground(p.Graphics, BackgroundImage, contentRect);
            }

            if (DrawBorder)
            {
                g.DrawRectangle(BorderPen, 0, 0, Width - 1, Height - PanelDistance);
            }
            #endregion

            #region Header
            var headerRect = GetHeaderRect();
            var image      = !Collapsed ? upBitmap : downBitmap;

            Color textColor = Color.Black;

            #region Fill rectangle
            headerRect.Width++;
            headerRect.Height++;
            if (HeaderBackgroundImage == null)
            {
                if (Selected)
                {
                    if (isMouseOver)
                    {
                        using (var brush = new LinearGradientBrush(headerRect,
                                                                   StiColorUtils.Light(SelectedHeaderStartColor, 20),
                                                                   StiColorUtils.Light(SelectedHeaderEndColor, 20), 90))
                            g.FillRectangle(brush, headerRect);
                    }
                    else
                    {
                        using (var brush = new LinearGradientBrush(headerRect,
                                                                   SelectedHeaderStartColor,
                                                                   SelectedHeaderEndColor, 90))
                            g.FillRectangle(brush, headerRect);
                    }
                    textColor = SystemColors.ActiveCaptionText;
                }
                else
                {
                    if (isMouseOver)
                    {
                        using (var brush = new LinearGradientBrush(headerRect,
                                                                   StiColorUtils.Light(HeaderStartColor, 20),
                                                                   StiColorUtils.Light(HeaderEndColor, 20), 90))
                            g.FillRectangle(brush, headerRect);
                    }
                    else
                    {
                        using (var brush = new LinearGradientBrush(headerRect, HeaderStartColor, HeaderEndColor, 90))
                            g.FillRectangle(brush, headerRect);
                    }
                }
            }
            else
            {
                StiControlPaint.DrawImageBackground(p.Graphics, HeaderBackgroundImage, headerRect);
            }
            headerRect.Width--;
            headerRect.Height--;
            #endregion

            #region Draw button image
            if (image != null)
            {
                var imageRect = new Rectangle(headerRect.Width - 18, (headerRect.Height - 16) / 2, 16, 16);

                if (textColor != Color.Black && image != null)
                {
                    image = StiImageUtils.ReplaceImageColor((Bitmap)image, textColor, Color.Black);
                }
                g.DrawImage(image, imageRect);
            }
            #endregion

            #region Draw image
            int imageWidth = 0;
            if (Image != null)
            {
                var imageRect = new Rectangle(headerRect.X + 4,
                                              (headerRect.Height - Image.Size.Height) / 2, Image.Size.Width, Image.Size.Height);

                imageWidth = imageRect.Width + 2;

                g.DrawImage(Image, imageRect);
            }
            #endregion

            #region Draw header text
            var textRect = new Rectangle(5 + imageWidth, 0, headerRect.Width - 25 - imageWidth, headerRect.Height);

            if (textRect.Width > 0)
            {
                using (var sf = new StringFormat())
                {
                    sf.LineAlignment = StringAlignment.Center;
                    if (RightToLeft == RightToLeft.Yes)
                    {
                        sf.FormatFlags |= StringFormatFlags.DirectionRightToLeft;
                    }

                    sf.FormatFlags = StringFormatFlags.NoWrap;
                    sf.Trimming    = StringTrimming.EllipsisCharacter;

                    sf.HotkeyPrefix = HotkeyPrefix.Hide;

                    if (!TitleColor.IsEmpty)
                    {
                        textColor = TitleColor;
                    }
                    using (Brush brush = new SolidBrush(textColor))
                    {
                        g.DrawString(Text, TitleFont, brush, textRect, sf);
                    }
                }
            }
            #endregion

            if (DrawBorder)
            {
                g.DrawRectangle(BorderPen, headerRect);
            }
            #endregion
        }
Exemplo n.º 9
0
        private void DrawPage(Graphics g, StiTabPage page)
        {
            if ((!page.Invisible) || DesignMode)
            {
                var rect = GetPageRectangle(g, page);

                if (rect.Width != 0 && rect.Height != 0)
                {
                    #region Calculate Path

                    var pts = new Point [] {};

                    #region Office2013
                    if (ControlStyle == StiControlStyle.Office2013Blue)
                    {
                        pts = new Point[] {
                            new Point(rect.X, rect.Y),
                            new Point(rect.X, rect.Bottom),
                            new Point(rect.Right, rect.Bottom),
                            new Point(rect.Right, rect.Y)
                        };
                    }
                    #endregion

                    #region Flat
                    else
                    {
                        if (!PositionAtBottom)
                        {
                            pts = new Point[] {
                                new Point(rect.X, rect.Y),
                                new Point(rect.X, rect.Bottom),
                                new Point(rect.Right + 5, rect.Bottom),
                                new Point(rect.Right - 5, rect.Y)
                            };
                        }
                        else
                        {
                            pts = new Point[] {
                                new Point(rect.X, rect.Y),
                                new Point(rect.X, rect.Bottom),
                                new Point(rect.Right - 5, rect.Bottom),
                                new Point(rect.Right + 5, rect.Y)
                            };
                        }
                    }
                    #endregion

                    #endregion


                    using (var path = new GraphicsPath(FillMode.Alternate))
                    {
                        path.AddPolygon(pts);

                        #region Draw page header

                        #region Office2013
                        if (ControlStyle == StiControlStyle.Office2013Blue)
                        {
                            if (SelectedTab == page)
                            {
                                using (var pathSelected = new GraphicsPath())
                                {
                                    pathSelected.AddPolygon(new[] {
                                        new Point(pts[0].X - 1, pts[0].Y - 1),
                                        new Point(pts[1].X - 1, pts[1].Y),
                                        new Point(pts[2].X + 1, pts[2].Y),
                                        new Point(pts[3].X + 1, pts[3].Y)
                                    });

                                    using (var br = new SolidBrush(Color.White))
                                    {
                                        g.FillPath(br, pathSelected);
                                    }
                                }
                            }
                            else
                            {
                                using (var br = new SolidBrush(Color.White))
                                {
                                    g.FillPath(br, path);
                                }
                            }
                        }
                        #endregion

                        #region Flat
                        else
                        {
                            if (SelectedTab == page)
                            {
                                var tabPage = GetTabPageAtPoint(this.PointToClient(Cursor.Position));
                                if (tabPage == page)
                                {
                                    using (var br = StiBrushes.GetControlLightBrush(rect, 90))
                                    {
                                        g.FillPath(br, path);
                                    }
                                }
                                else
                                {
                                    using (var br = StiBrushes.GetControlBrush(rect, 90))
                                    {
                                        g.FillPath(br, path);
                                    }
                                }
                            }
                            else
                            {
                                var tabPage = GetTabPageAtPoint(this.PointToClient(Cursor.Position));
                                if (tabPage == page)
                                {
                                    using (var br = new SolidBrush(StiColorUtils.Light(StiColors.Content, 15)))
                                    {
                                        g.FillPath(br, path);
                                    }
                                }
                                else
                                {
                                    g.FillPath(StiBrushes.Content, path);
                                }
                            }
                        }
                        #endregion

                        #endregion
                    }


                    Color textColor = ForeColor;
                    if (page != this.SelectedTab)
                    {
                        textColor = SystemColors.ControlDark;
                    }


                    #region Paint Image
                    SizeF imageSize = SizeF.Empty;
                    if (ImageList != null || page.Image != null)
                    {
                        int pageIndex = this.Controls.IndexOf(page);

                        if (ImageList != null || page.Image != null)
                        {
                            if (page.Image != null)
                            {
                                imageSize = page.Image.Size;
                            }
                            else
                            {
                                imageSize = ImageList.ImageSize;
                            }

                            Rectangle imageRect = new Rectangle(rect.X + 2,
                                                                (int)(rect.Y + (rect.Height - imageSize.Height) / 2),
                                                                (int)imageSize.Width, (int)imageSize.Height);

                            if (imageSize.Width != 0)
                            {
                                if (imageList != null && ImageList.Images.Count > pageIndex)
                                {
                                    ImageList.Draw(g, imageRect.X, imageRect.Y, imageRect.Width, imageRect.Height, pageIndex);
                                }
                                else if (page.Image != null)
                                {
                                    g.DrawImage(page.Image, imageRect.X, imageRect.Y, imageRect.Width, imageRect.Height);
                                }
                            }
                        }
                    }
                    #endregion

                    #region Paint text
                    var textRect = new Rectangle(rect.X + (int)imageSize.Width, rect.Y, rect.Width - (int)imageSize.Width, rect.Height);
                    using (var brush = new SolidBrush(textColor))
                    {
                        g.DrawString(page.Text, Font, brush, textRect, sfTabs);
                    }
                    #endregion

                    #region Draw header lines

                    #region Office2013 Style
                    if (ControlStyle == StiControlStyle.Office2013Blue)
                    {
                        using (var pen = new Pen(StiStyleOffice2013Blue.ColorLineGray))
                        {
                            if (SelectedTab == page)
                            {
                                if (!PositionAtBottom)
                                {
                                    g.DrawLine(pen, new Point(pts[0].X - 1, pts[0].Y - 1), new Point(pts[1].X - 1, pts[1].Y));
                                    g.DrawLine(pen, new Point(pts[0].X - 1, pts[0].Y - 1), new Point(pts[3].X + 1, pts[3].Y - 1));
                                    g.DrawLine(pen, new Point(pts[2].X + 1, pts[2].Y), new Point(pts[3].X + 1, pts[3].Y));
                                }
                                else
                                {
                                    g.DrawLine(pen, pts[1], pts[2]);
                                    g.DrawLine(pen, pts[2], pts[3]);
                                }
                            }
                            else
                            {
                                if (PositionAtBottom)
                                {
                                    g.DrawLine(pen, pts[0], pts[1]);
                                    g.DrawLine(pen, pts[1], pts[2]);
                                    g.DrawLine(pen, pts[2], pts[3]);
                                }
                                else
                                {
                                    g.DrawLine(pen, pts[0], pts[1]);
                                    g.DrawLine(pen, pts[0], pts[3]);
                                    g.DrawLine(pen, pts[2], pts[3]);
                                }
                            }
                        }
                    }
                    #endregion

                    #region Flat Style
                    else
                    {
                        if (SelectedTab == page)
                        {
                            g.DrawLine(SystemPens.ControlLightLight, pts[0], pts[1]);

                            if (!PositionAtBottom)
                            {
                                using (var brush = new LinearGradientBrush(
                                           new Rectangle(pts[3].X, pts[3].Y, pts[2].X - pts[3].X, pts[2].Y - pts[3].Y - 5),
                                           SystemColors.Control, SystemColors.ControlDark, 0f))

                                    using (var pen = new Pen(brush))
                                        g.DrawLine(pen, pts[2], pts[3]);

                                g.DrawLine(SystemPens.ControlLightLight, pts[0], pts[3]);
                            }
                            else
                            {
                                g.DrawLine(SystemPens.ControlDark, pts[1], pts[2]);
                                g.DrawLine(SystemPens.ControlDark, pts[2], pts[3]);
                            }
                        }
                        else
                        {
                            using (var pen = new Pen(StiColorUtils.Dark(SystemColors.Control, 40)))
                            {
                                if (PositionAtBottom)
                                {
                                    g.DrawLine(pen, pts[0], pts[1]);
                                    g.DrawLine(pen, pts[1], pts[2]);
                                    g.DrawLine(pen, pts[2], pts[3]);
                                }
                                else
                                {
                                    g.DrawLine(pen, pts[0], pts[1]);
                                    g.DrawLine(pen, pts[0], pts[3]);
                                    g.DrawLine(pen, pts[2], pts[3]);
                                }
                            }
                        }
                    }
                    #endregion

                    #endregion
                }
            }
        }