public override void DrawCellText(XmlGridView gridView, Graphics graphics, Font font, Brush brush, StringFormat format, XmlGridView.DrawInfo drawInfo, Rectangle rect) { StringFormat sf = new StringFormat(format); Font f = new Font(font, FontStyle.Bold); Brush textBrush = new SolidBrush(SystemColors.GrayText); sf.LineAlignment = StringAlignment.Center; rect.Height = drawInfo.cyChar; graphics.DrawString(Text, f, brush, rect, sf); int w = (int)graphics.MeasureString(Text, f).Width + drawInfo.cxCaps / 2; rect.X += w; rect.Width -= w; if (TableView) { graphics.DrawString(String.Format("({0})", Table.Height - 1), font, textBrush, rect, sf); } else if (!Expanded && !String.IsNullOrEmpty(Description)) { sf.Trimming = StringTrimming.EllipsisCharacter; sf.FormatFlags = StringFormatFlags.NoWrap; graphics.DrawString(Description, font, textBrush, rect, sf); } }
public virtual void DrawCellText(XmlGridView gridView, Graphics graphics, Font font, Brush brush, StringFormat sf, XmlGridView.DrawInfo drawInfo, Rectangle rect) { rect.Y += 2; //rect.Height -= 3; graphics.DrawString(Text, font, brush, rect, sf); }
public override void DrawCellText(XmlGridView gridView, Graphics graphics, Font font, Brush brush, StringFormat sf, XmlGridView.DrawInfo drawInfo, Rectangle rect) { rect.X += drawInfo.cxChar; rect.Width -= drawInfo.cxChar; base.DrawCellText(gridView, graphics, font, brush, sf, drawInfo, rect); }
public override void DrawCellText(XmlGridView gridView, Graphics graphics, Font font, Brush brush, StringFormat sf, XmlGridView.DrawInfo drawInfo, Rectangle rect) { if (gridView.AutoHeightCells) { sf.FormatFlags = sf.FormatFlags & ~StringFormatFlags.NoWrap; } base.DrawCellText(gridView, graphics, font, brush, sf, drawInfo, rect); }
public override void DrawCellText(XmlGridView gridView, Graphics graphics, Font font, Brush brush, StringFormat sf, XmlGridView.DrawInfo drawInfo, Rectangle rect) { if (Node.NodeType != XmlNodeType.Attribute && Node.NodeType != XmlNodeType.Element) { font = new Font(font, FontStyle.Italic); } base.DrawCellText(gridView, graphics, font, brush, sf, drawInfo, rect); }
public virtual int GetTextWidth(XmlGridView gridView, Graphics graphics, Font font, XmlGridView.DrawInfo drawInfo) { SizeF sizeF = graphics.MeasureString(Text, font); if (ImageIndex != -1) { sizeF.Width += drawInfo.cxImage; } return((int)sizeF.Width); }
public override int GetTextHeight(XmlGridView gridView, Graphics graphics, Font font, XmlGridView.DrawInfo drawInfo, int Width) { if (String.IsNullOrEmpty(Text)) { return(drawInfo.cyChar); } else { StringFormat sf = GetStringFormat(); sf.FormatFlags = 0; SizeF sz = graphics.MeasureString(Text, font, Width, sf); int height = Math.Max((int)sz.Height, drawInfo.cyChar); if (height > drawInfo.cyChar) { height += 4; } return(height); } }
//public override Size MeasureText(XmlGridView gridView, Graphics graphics, Font font, XmlGridView.DrawInfo drawInfo, int Width) //{ // Size sz = base.MeasureText(gridView, graphics, font, drawInfo, Width); // sz.Width += drawInfo.cxChar; // return sz; //} public override int GetTextWidth(XmlGridView gridView, Graphics graphics, Font font, XmlGridView.DrawInfo drawInfo) { return(base.GetTextWidth(gridView, graphics, font, drawInfo) + drawInfo.cxChar); }
public virtual int GetTextHeight(XmlGridView gridView, Graphics graphics, Font font, XmlGridView.DrawInfo drawInfo, int Width) { return(drawInfo.cyChar); }