Exemple #1
0
        private void RenderHeaderText(Graphics g,
            GroupHeaderVisualStyle style, Rectangle r)
        {
            eTextFormat tf = style.GetTextFormatFlags();

            if (style.Alignment == Alignment.BottomLeft ||
                style.Alignment == Alignment.BottomCenter ||
                style.Alignment == Alignment.BottomRight)
            {
                r.Height -= 4;
            }

            if (r.Width > 0 && r.Height > 0)
            {
                if (_GroupTextMarkup != null)
                    RenderTextMarkup(g, _GroupTextMarkup, style, r);
                else
                    TextDrawing.DrawString(g, Text, style.Font, style.TextColor, r, tf);
            }
        }
Exemple #2
0
        private Size MeasureHeaderText(Graphics g,
            GroupHeaderVisualStyle style, Size constraintSize)
        {
            Size size = Size.Empty;

            string s = Text;

            if (string.IsNullOrEmpty(s) == false)
            {
                if (_GroupTextMarkup != null)
                {
                    size = GetMarkupTextSize(g,
                        _GroupTextMarkup, style, constraintSize.Width);
                }
                else
                {
                    eTextFormat tf = style.GetTextFormatFlags();

                    size = (constraintSize.IsEmpty == true)
                               ? TextHelper.MeasureText(g, s, style.Font)
                               : TextHelper.MeasureText(g, s, style.Font, constraintSize, tf);
                }
            }

            return (size);
        }