private void InitGroupByStyles(DefaultVisualStyles visualStyle, ColorFactory factory)
        {
            GroupByVisualStyle style = new GroupByVisualStyle();

            style.Alignment = Alignment.MiddleCenter;
            style.GroupBoxConnectorColor = factory.GetColor(0x313131); // Panel border color
            style.GroupBoxBorderColor = factory.GetColor(0x313131);

            style.InsertMarkerBorderColor = factory.GetColor(0x313131);
            style.InsertMarkerBackground = new Background(factory.GetColor(Color.Red));

            style.RowHeaderStyle.Background = new Background(factory.GetColor(0x6A6A6A), factory.GetColor(0x595959), BackFillType.ForwardDiagonal);
            style.RowHeaderStyle.BorderHighlightColor = GetBorderHighlight(factory);

            style.TextColor = factory.GetColor(0x363636); // Col text color
            style.GroupBoxBackground = new Background(factory.GetColor(0x6A6A6A));  // col background
            visualStyle.GroupByStyles[StyleType.Default] = style;

            style = new GroupByVisualStyle();
            style.GroupBoxBackground = new Background(factory.GetColor(0xFFDF6B), factory.GetColor(0xFFFCE6));  // col background
            visualStyle.GroupByStyles[StyleType.MouseOver] = style;

            style = new GroupByVisualStyle();
            style.GroupBoxBackground = GetDefaultSelectedColumnBackground(factory);  // col background
            visualStyle.GroupByStyles[StyleType.Selected] = style;

            style = new GroupByVisualStyle();
            style.GroupBoxBackground = GetSelectedColumnMouseOverBackground(factory);  // col background
            visualStyle.GroupByStyles[StyleType.SelectedMouseOver] = style;
        }
Ejemplo n.º 2
0
        private void InitGroupByStyles(DefaultVisualStyles visualStyle, ColorFactory factory)
        {
            GroupByVisualStyle style = new GroupByVisualStyle();
            MetroPartColors metroColors = _MetroPartColors;

            style.Alignment = Alignment.MiddleCenter;
            style.GroupBoxConnectorColor = factory.GetColor(metroColors.BaseColorDark); // Panel border color
            style.GroupBoxBorderColor = factory.GetColor(metroColors.BaseColorDark);

            style.InsertMarkerBorderColor = factory.GetColor(metroColors.BaseColorDark);
            style.InsertMarkerBackground = GetSelectedColumnMouseOverBackground();

            style.RowHeaderStyle.Background = new Background(factory.GetColor(metroColors.CanvasColorLighterShade));
            style.RowHeaderStyle.BorderHighlightColor = GetBorderHighlight();

            style.TextColor = factory.GetColor(0x363636); // Col text color
            style.GroupBoxBackground = new Background(factory.GetColor(metroColors.CanvasColorLighterShade));  // col background
            visualStyle.GroupByStyles[StyleType.Default] = style;

            style = new GroupByVisualStyle();
            style.GroupBoxBackground = new Background(factory.GetColor(metroColors.CanvasColorLightShade));  // col background
            visualStyle.GroupByStyles[StyleType.MouseOver] = style;

            style = new GroupByVisualStyle();
            style.GroupBoxBackground = GetDefaultSelectedColumnBackground(factory);  // col background
            visualStyle.GroupByStyles[StyleType.Selected] = style;

            style = new GroupByVisualStyle();
            style.GroupBoxBackground = GetSelectedColumnMouseOverBackground();  // col background
            visualStyle.GroupByStyles[StyleType.SelectedMouseOver] = style;
        }
Ejemplo n.º 3
0
        private void RenderRoundedBox(Graphics g, GroupByVisualStyle style,
            ColumnHeaderVisualStyle cstyle, GridPanelVisualStyle pstyle,
            GridGroupBox leftBox, GridGroupBox box, int radius)
        {
            Rectangle r = box.Bounds;

            using (GraphicsPath path = GetRoundedPath(r, radius))
            {
                SmoothingMode sm = g.SmoothingMode;
                g.SmoothingMode = SmoothingMode.AntiAlias;

                if (_UseColumnHeaderColors == true)
                {
                    using (Brush br = cstyle.Background.GetBrush(r))
                        g.FillPath(br, path);

                    using (Pen pen = new Pen(pstyle.HeaderLineColor))
                        g.DrawPath(pen, path);
                }
                else
                {
                    using (Brush br = style.GroupBoxBackground.GetBrush(r))
                        g.FillPath(br, path);

                    using (Pen pen = new Pen(style.GroupBoxBorderColor))
                        g.DrawPath(pen, path);
                }

                if (leftBox != null)
                {
                    Region oldClip = g.Clip;
                    Region newClip = new Region(Bounds);

                    newClip.Exclude(path);

                    g.SetClip(newClip, CombineMode.Intersect);

                    try
                    {
                        if (SuperGrid.DoPreRenderGroupBoxConnectorEvent(g, this, leftBox, box) == false)
                        {
                            RenderBoxConnector(g, style, leftBox.Bounds, box.Bounds, true);

                            SuperGrid.DoPostRenderGroupBoxConnectorEvent(g, this, leftBox, box);
                        }
                    }
                    finally
                    {
                        g.Clip = oldClip;
                    }
                }

                g.SmoothingMode = sm;
            }
        }
Ejemplo n.º 4
0
        private void RenderText(Graphics g, GridColumn column,
            GroupByVisualStyle style, ColumnHeaderVisualStyle cstyle, Rectangle bounds)
        {
            string s = column.GetHeaderText();

            if (s != null)
            {
                if (column.HeaderTextMarkup != null)
                {
                    RenderTextMarkup(g, column.HeaderTextMarkup, cstyle, bounds);
                }
                else
                {
                    if (_UseColumnHeaderColors == true)
                    {
                        eTextFormat tf = cstyle.GetTextFormatFlags();

                        TextDrawing.DrawString(g, s,
                            cstyle.Font, cstyle.TextColor, bounds, tf);
                    }
                    else
                    {
                        eTextFormat tf = style.GetTextFormatFlags();

                        TextDrawing.DrawString(g, s,
                            cstyle.Font, style.GroupBoxTextColor, bounds, tf);
                    }
                }
            }
        }
Ejemplo n.º 5
0
        private void RenderBoxConnector(Graphics g,
            GroupByVisualStyle style, Rectangle l, Rectangle r, bool extend)
        {
            using (Pen pen = new Pen(style.GroupBoxConnectorColor))
            {
                if (GroupBoxLayout == GroupBoxLayout.Hierarchical)
                {
                    Point pt1 = new Point(l.X + l.Width / 2, l.Bottom + 1);
                    Point pt2 = new Point(pt1.X, l.Bottom + (r.Bottom - l.Bottom) / 2);
                    Point pt3 = new Point(r.X + (extend ? 10 : -1), pt2.Y);

                    g.DrawLines(pen, new Point[] { pt1, pt2, pt3 });
                }
                else
                {
                    Point pt1 = new Point(l.Right + 1, l.Y + l.Height / 2 + 1);
                    Point pt2 = new Point(r.X - 1, pt1.Y);

                    g.DrawLine(pen, pt1, pt2);
                }
            }
        }
Ejemplo n.º 6
0
        private void RenderRectBox(Graphics g, GroupByVisualStyle style,
            ColumnHeaderVisualStyle cstyle, GridPanelVisualStyle pstyle,
            GridGroupBox leftBox, GridGroupBox box)
        {
            Rectangle r = box.Bounds;

            if (_UseColumnHeaderColors == true)
            {
                using (Brush br = cstyle.Background.GetBrush(r))
                    g.FillRectangle(br, r);

                using (Pen pen = new Pen(pstyle.HeaderLineColor))
                    g.DrawRectangle(pen, r);
            }
            else
            {
                using (Brush br = style.GroupBoxBackground.GetBrush(r))
                    g.FillRectangle(br, r);

                using (Pen pen = new Pen(style.GroupBoxBorderColor))
                    g.DrawRectangle(pen, r);
            }

            if (leftBox != null)
            {
                if (SuperGrid.DoPreRenderGroupBoxConnectorEvent(g, this, leftBox, box) == false)
                {
                    RenderBoxConnector(g, style, leftBox.Bounds, r, false);

                    SuperGrid.DoPostRenderGroupBoxConnectorEvent(g, this, leftBox, box);
                }
            }
        }