123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- using System;
- using System.ComponentModel;
- using System.Drawing;
- using System.Globalization;
- using System.Windows.Forms;
- using XPTable.Editors;
- using XPTable.Events;
- using XPTable.Models;
- namespace XPTable.Renderers
- {
-
-
-
- public class TextCellRenderer : CellRenderer
- {
- #region Constructor
-
-
-
-
-
- public TextCellRenderer() : base()
- {
-
- }
- #endregion
- #region Events
- #region Paint
-
-
-
-
- protected override void OnPaint(PaintCellEventArgs e)
- {
- base.OnPaint(e);
-
-
- if (e.Cell == null)
- {
- return;
- }
- string text = e.Cell.Text;
- if (text != null && text.Length != 0)
- {
- if (e.Enabled)
- {
- e.Graphics.DrawString(text, this.Font, this.ForeBrush, this.ClientRectangle, this.StringFormat);
- }
- else
- {
- e.Graphics.DrawString(text, this.Font, this.GrayTextBrush, this.ClientRectangle, this.StringFormat);
- }
- }
-
- if (e.Focused && e.Enabled)
- {
- ControlPaint.DrawFocusRectangle(e.Graphics, this.ClientRectangle);
- }
- }
- #endregion
- #endregion
- }
- }
|