public virtual void DrawInRect(CDVContext context) { int x, y; GetAbsoluteLocation(out x, out y); border.X = x - ContentRect.X + ParaStyle.Margin.Left; border.Y = y - ContentRect.Y + ParaStyle.Margin.Top; border.Width = Bounds.Width - ParaStyle.Margin.Left - ParaStyle.Margin.Right; border.Height = Bounds.Height - ParaStyle.Margin.Top - ParaStyle.Margin.Bottom; if (!ParaStyle.BackgroundColor.Equals(CDVColor.Transparent)) { context.g.FillRectangle(CDVContext.GetBrush(ParaStyle.BackgroundColor), border); } if (ParaStyle.BorderWidth.GetMax() > 0) { context.g.DrawLine(CDVContext.GetPen(ParaStyle.BorderWidth.Top, ParaStyle.BorderColor), border.Left, border.Top, border.Right, border.Top); context.g.DrawLine(CDVContext.GetPen(ParaStyle.BorderWidth.Bottom, ParaStyle.BorderColor), border.Left, border.Bottom, border.Right, border.Bottom); context.g.DrawLine(CDVContext.GetPen(ParaStyle.BorderWidth.Left, ParaStyle.BorderColor), border.Left, border.Top, border.Left, border.Bottom); context.g.DrawLine(CDVContext.GetPen(ParaStyle.BorderWidth.Right, ParaStyle.BorderColor), border.Right, border.Top, border.Right, border.Bottom); } //context.g.DrawRectangle(Pens.Blue, border); }
public override void DrawInRect(CDVContext context) { if (!Visible) { return; } base.DrawInRect(context); int x, y; GetAbsoluteLocation(out x, out y); Font f = CDVContext.GetFont(TextStyle.Font, TextStyle.FontSize, TextStyle.Bold, TextStyle.Italic, TextStyle.Underline); context.g.DrawString(Text, f, CDVContext.GetBrush(TextStyle.Color), x, y); }