Пример #1
0
        public void Draw(Graphics g, int y, int width)
        {
            var x = Margin;

            _selected = BuildOutput.MouseLocation.Y > y && BuildOutput.MouseLocation.Y < y + CellHeight;

            // Draw Background
            g.FillRectangle(DrawInfo.BorderColor, 0, y, width, Height);
            g.FillRectangle(_selected ? DrawInfo.HoverBackColor : DrawInfo.BorderColor, 0, y, width, CellHeight);

            // Draw Icon
            g.DrawImage(Icon, x, y + _imageOffset);
            x += 16 + Spacing;

            // Draw Text
            g.DrawText(DrawInfo.TextFont, DrawInfo.GetTextColor(_selected, false), x, y + _textOffset, Text);

            // Draw Expander
            if (_description.Count != 0)
            {
                //g.FillRectangle(_expandSelected ? DrawInfo.HoverBackColor : DrawInfo.BorderColor, rectangle);
                g.DrawText(DrawInfo.TextFont, DrawInfo.GetTextColor(_selected, false), width - Margin - _arrowWidth, y + _textOffset, _expanded ? ArrowCollapse : ArrowExpand);
            }

            // Draw Description
            if (_expanded)
            {
                for (int i = 0; i < _description.Count; i++)
                {
                    g.DrawText(DrawInfo.TextFont, DrawInfo.TextColor, x + Spacing, y + CellHeight + _descriptionOffset + _descSize * i, _description[i]);
                }
            }
        }
Пример #2
0
        public virtual void DrawCell(Graphics g, Rectangle rec, int separatorPos, bool selected)
        {
            _lastRec        = rec;
            _lastRec.X     += separatorPos;
            _lastRec.Width -= separatorPos - 1;

            g.DrawText(SystemFonts.Default(), DrawInfo.GetTextColor(selected, !Editable), separatorPos + 5, rec.Y + (rec.Height - Height) / 2, DisplayValue);
        }
Пример #3
0
        public virtual void Draw(Graphics g, Rectangle rec, int separatorPos, bool selected)
        {
            if (selected)
            {
                g.FillRectangle(SystemColors.Highlight, rec);
            }

            g.DrawText(SystemFonts.Default(), DrawInfo.GetTextColor(selected, false), rec.X + 5, rec.Y + (rec.Height - Height) / 2, Text);
            g.FillRectangle(DrawInfo.GetBackgroundColor(selected), separatorPos - 6, rec.Y, rec.Width, rec.Height);
            DrawCell(g, rec, separatorPos, selected);
        }
Пример #4
0
        public virtual void Draw(Graphics g, Rectangle rec, int separatorPos, bool selected)
        {
            if (selected)
            {
                g.FillRectangle(DrawInfo.HoverBackColor, rec);
            }

            g.DrawText(DrawInfo.TextFont, DrawInfo.GetTextColor(selected, false), rec.X + 5, rec.Y + (rec.Height - Height) / 2, Text);
            g.FillRectangle(DrawInfo.GetBackgroundColor(selected), separatorPos - 6, rec.Y, rec.Width, rec.Height);

            if (!SkipCellDraw)
            {
                DrawCell(g, rec, separatorPos, selected);
            }
        }