Exemplo n.º 1
0
        private static ButtonState ConvertToButtonState(HeaderItemState state)
        {
            if (state == HeaderItemState.Pressed)
            {
                return(ButtonState.Pushed);
            }

            return(ButtonState.Normal);
        }
Exemplo n.º 2
0
 public static void DrawHeader(Graphics g, Rectangle bounds, HeaderItemState state)
 {
     if (RenderWithVisualStyles)
     {
         InitializeRenderer((int)state);
         visualStyleRenderer.DrawBackground(g, bounds);
     }
     else
     {
         ControlPaint.DrawButton(g, bounds, ConvertToButtonState(state));
     }
 }
Exemplo n.º 3
0
 public static void DrawHeader(Graphics g, Rectangle bounds, HeaderItemState state)
 {
     if (RenderWithVisualStyles)
     {
         InitializeRenderer((int)state);
         visualStyleRenderer.DrawBackground(g, bounds);
     }
     else
     {
         ControlPaint.DrawButton(g, bounds, ConvertToButtonState(state));
     }
 }
Exemplo n.º 4
0
        public static void DrawHeader(Graphics g, Rectangle bounds, string headerText, Font font, TextFormatFlags flags, Image image, Rectangle imageBounds, HeaderItemState state)
        {
            Color text;

            if (RenderWithVisualStyles)
            {
                InitializeRenderer((int)state);
                visualStyleRenderer.DrawBackground(g, bounds);
                visualStyleRenderer.DrawImage(g, imageBounds, image);
                text = visualStyleRenderer.GetColor(ColorProperty.TextColor);
            }
            else
            {
                ControlPaint.DrawButton(g, bounds, ConvertToButtonState(state));
                g.DrawImage(image, imageBounds);
                text = SystemColors.ControlText;
            }

            TextRenderer.DrawText(g, headerText, font, Rectangle.Inflate(bounds, -3, -3), text, flags);
        }
Exemplo n.º 5
0
 public static void DrawHeader(Graphics g, Rectangle bounds, string headerText, Font font, Image image, Rectangle imageBounds, HeaderItemState state)
 {
     DrawHeader(g, bounds, headerText, font, TextFormatFlags.SingleLine | TextFormatFlags.VerticalCenter | TextFormatFlags.Left | TextFormatFlags.NoPrefix | TextFormatFlags.EndEllipsis, image, imageBounds, state);
 }
Exemplo n.º 6
0
 public static void DrawHeader(Graphics g, Rectangle bounds, string headerText, Font font, HeaderItemState state)
 {
     DrawHeader(g, bounds, headerText, font, TextFormatFlags.SingleLine | TextFormatFlags.VerticalCenter | TextFormatFlags.Left | TextFormatFlags.NoPrefix | TextFormatFlags.EndEllipsis, state);
 }
Exemplo n.º 7
0
        private static ButtonState ConvertToButtonState(HeaderItemState state)
        {
            if (state == HeaderItemState.Pressed)
            {
                return ButtonState.Pushed;
            }

            return ButtonState.Normal;
        }
Exemplo n.º 8
0
        public static void DrawHeader(Graphics g, Rectangle bounds, string headerText, Font font, TextFormatFlags flags, Image image, Rectangle imageBounds, HeaderItemState state)
        {
            Color text;
            if (RenderWithVisualStyles)
            {
                InitializeRenderer((int)state);
                visualStyleRenderer.DrawBackground(g, bounds);
                visualStyleRenderer.DrawImage(g, imageBounds, image);
                text = visualStyleRenderer.GetColor(ColorProperty.TextColor);
            }
            else
            {
                ControlPaint.DrawButton(g, bounds, ConvertToButtonState(state));
                g.DrawImage(image, imageBounds);
                text = SystemColors.ControlText;
            }

            TextRenderer.DrawText(g, headerText, font, Rectangle.Inflate(bounds, -3, -3), text, flags);
        }