示例#1
0
        public override void Paint(GraphicsSettings gs, Rectangle clipRect)
        {
            Rectangle rcText;

            GetDrawRectangles(out rcText, out _buttonRectangle);
            Rectangle rc = HostBasedRectangle;

            //
            // Fill indent area if any
            if (_groupIndentWidth > 0)
            {
                Rectangle rcIndent = new Rectangle(rc.X, rc.Y, _groupIndentWidth, rc.Height);

                PaintIndentArea(gs.Graphics, rcIndent);
            }

            gs.Graphics.DrawIcon(DrawIcon, _buttonRectangle.X, _buttonRectangle.Y);

            GdiPlusEx.DrawString
                (gs.Graphics, Text, Font, (Host.FocusedSection == ListSection && IsSelected) ? SystemColors.HighlightText : ListControl.GroupSectionForeColor, rcText
                , GdiPlusEx.Alignment.Left, ListControl.GroupSectionVerticalAlignment, GdiPlusEx.TextSplitting.SingleLineEllipsis, GdiPlusEx.Ampersands.Display);

            Rectangle rcLine = rc;

            rcLine.X += _groupIndentWidth;
            PaintSeparatorLine(gs.Graphics, rcLine);
        }
示例#2
0
        public override void Paint(GraphicsSettings gs, Rectangle clipRect)
        {
            Rectangle rc = DrawRectangle;

            GdiPlusEx.TextSplitting textSplitting =
                (HeaderColumnSection.Column.WrapText) ? GdiPlusEx.TextSplitting.MultiLine : GdiPlusEx.TextSplitting.SingleLineEllipsis;

            GdiPlusEx.DrawString
                (gs.Graphics,
                DisplayItemString,
                Font,
                (Host.FocusedSection == ListSection && RowSection.IsSelected) ? SystemColors.HighlightText : Color,
                rc,
                GdiExAlignment, GdiExVerticalAlignment,
                textSplitting, GdiPlusEx.Ampersands.Display);
        }
示例#3
0
        public override void Layout(GraphicsSettings gs, Size maximumSize)
        {
            const int margin = 2;
            SizeF     size;

            if (HeaderColumnSection.Column.WrapText)
            {
                size = GdiPlusEx.MeasureString(gs.Graphics, DisplayItem.ToString(), Font, maximumSize.Width - 5);
            }
            else
            {
                size = gs.Graphics.MeasureString(DisplayItem.ToString(), Font);
            }
            if (size.Height < MinimumHeight)
            {
                size.Height = MinimumHeight;
            }
            Size = new Size(maximumSize.Width, (int)size.Height + margin * 2);
        }