#if FRAMEWORK20 using System; using System.Text; using System.Drawing; using DevComponents.DotNetBar; namespace DevComponents.Editors.DateTimeAdv { /// /// Provides data for DayLabel painting events. /// public class DayPaintEventArgs : EventArgs { /// /// Gets the graphics canvas for rendering. /// public readonly Graphics Graphics; /// /// Gets or sets which parts of the item will be drawn by the system. You can set this to None to completely disable system rendering. /// public eDayPaintParts RenderParts = eDayPaintParts.All; internal DayLabel _Item = null; internal ItemPaintArgs _ItemPaintArgs = null; /// /// Initializes a new instance of the DayPaintEventArgs class. /// /// Reference to Graphics canvas. /// Reference to item being rendered. public DayPaintEventArgs(ItemPaintArgs p, DayLabel item) { Graphics = p.Graphics; _ItemPaintArgs = p; _Item = item; } /// /// Renders the background of the item. /// public void PaintBackground() { _Item.PaintBackground(_ItemPaintArgs); } /// /// Renders the item text. /// public void PaintText() { _Item.PaintText(_ItemPaintArgs, null, Color.Empty, _Item.TextAlign); } /// /// Renders the item text. /// public void PaintText(Color textColor) { _Item.PaintText(_ItemPaintArgs, null, textColor, _Item.TextAlign); } /// /// Renders the item text. /// public void PaintText(Color textColor, eLabelPartAlignment textAlign) { _Item.PaintText(_ItemPaintArgs, null, textColor, textAlign); } /// /// Renders the item text. /// public void PaintText(Color textColor, Font textFont) { _Item.PaintText(_ItemPaintArgs, textFont, textColor, _Item.TextAlign); } /// /// Renders the item text. /// public void PaintText(Color textColor, Font textFont, eLabelPartAlignment textAlign) { _Item.PaintText(_ItemPaintArgs, textFont, textColor, textAlign); } /// /// Renders items image. /// public void PaintImage() { _Item.PaintImage(_ItemPaintArgs, _Item.Image, _Item.ImageAlign); } /// /// Renders items image. /// public void PaintImage(eLabelPartAlignment imageAlign) { _Item.PaintImage(_ItemPaintArgs, _Item.Image, imageAlign); } } /// /// Defines delegate for DayLabel painting events. /// /// Source of the event. /// Provides event data. public delegate void DayPaintEventHandler(object sender, DayPaintEventArgs e); /// /// Specifies the parts of DayLabel control. Members of this enum are intended to be used as flags (combined). /// [Flags()] public enum eDayPaintParts { /// /// Specifies no part. /// None = 0, /// /// Specifies the label background. /// Background = 1, /// /// Specifies the label text. /// Text = 2, /// /// Specifies the label image. /// Image = 4, /// /// Specifies all parts. /// All = Background | Text | Image } } #endif