Ejemplo n.º 1
0
        private void dateTimeInput11_MonthCalendar_PaintLabel(object sender, DevComponents.Editors.DateTimeAdv.DayPaintEventArgs e)
        {
            DevComponents.Editors.DateTimeAdv.DayLabel day = sender as DevComponents.Editors.DateTimeAdv.DayLabel;
            if (day == null || day.Date == DateTime.MinValue)
            {
                return;
            }

            // Cross all weekend days and disable selection for them...
            if ((day.Date.DayOfWeek == DayOfWeek.Saturday || day.Date.DayOfWeek == DayOfWeek.Sunday) && day.Date != DateTime.Today.AddDays(1))
            {
                day.Selectable = false; // Mark label as not selectable...
                day.TrackMouse = false; // Do not track mouse movement...
                e.PaintBackground();
                e.PaintText();
                Rectangle r = day.Bounds;
                r.Inflate(-2, -2);
                SmoothingMode sm = e.Graphics.SmoothingMode;
                e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
                e.Graphics.DrawLine(Pens.Red, r.X, r.Y, r.Right, r.Bottom);
                e.Graphics.DrawLine(Pens.Red, r.Right, r.Y, r.X, r.Bottom);
                e.Graphics.SmoothingMode = sm;
                // Ensure that no part is rendered internally by control...
                e.RenderParts = DevComponents.Editors.DateTimeAdv.eDayPaintParts.None;
            }
            // Mark tomorrows day...
            else if (day != null && day.Date == DateTime.Today.AddDays(1))
            {
                e.PaintBackground();
                e.PaintText();
                SmoothingMode sm = e.Graphics.SmoothingMode;
                e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
                Rectangle r = day.Bounds;
                r.Width--;
                r.Height--;
                using (Pen pen = new Pen(Color.FromArgb(128, Color.Blue)))
                    e.Graphics.DrawEllipse(pen, r);
                e.Graphics.SmoothingMode = sm;
                // Ensure that no part is rendered internally by control...
                e.RenderParts = DevComponents.Editors.DateTimeAdv.eDayPaintParts.None;
            }
        }
Ejemplo n.º 2
0
        public override void Paint(ItemPaintArgs p)
        {
            DayPaintEventArgs e = new DayPaintEventArgs(p, this);
            OnPaintLabel(e);
            if (e.RenderParts == eDayPaintParts.None) return;
            SingleMonthCalendar month = this.Parent as SingleMonthCalendar;
            if (month != null)
            {
                month.OnPaintLabel(this, e);
            }
            if (e.RenderParts == eDayPaintParts.None) return;

            if (this.Enabled && (e.RenderParts & eDayPaintParts.Background) == eDayPaintParts.Background)
                PaintBackground(p);

            if ((e.RenderParts & eDayPaintParts.Text) == eDayPaintParts.Text)
                PaintText(p, null, Color.Empty, _TextAlign);

            if ((e.RenderParts & eDayPaintParts.Image) == eDayPaintParts.Image)
                PaintImage(p, _Image, _ImageAlign);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Raises the PaintLabel event.
 /// </summary>
 /// <param name="e">Provides event data.</param>
 protected virtual void OnPaintLabel(DayPaintEventArgs e)
 {
     if (PaintLabel != null)
         PaintLabel(this, e);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Raises the PaintLabel event.
 /// </summary>
 /// <param name="e">Provides event data.</param>
 internal void OnPaintLabel(DayLabel label, DayPaintEventArgs e)
 {
     if (PaintLabel != null)
         PaintLabel(label, e);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Raises the PaintLabel event.
 /// </summary>
 /// <param name="e">Provides event data.</param>
 protected virtual void OnPaintLabel(object label, DayPaintEventArgs e)
 {
     if (PaintLabel != null)
         PaintLabel(label, e);
 }
Ejemplo n.º 6
0
 private void MonthCalendar_PaintLabel(object sender, DayPaintEventArgs e)
 {
     OnPaintLabel(sender, e);
 }
Ejemplo n.º 7
0
 private void InternalPaintLabel(object sender, DayPaintEventArgs e)
 {
     OnPaintLabel(e._Item, e);
 }