Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CalendarRendererBoxEventArgs"/> class.
 /// </summary>
 /// <param name="original">The <see cref="WindowsFormsCalendar.CalendarRendererEventArgs"/> instance containing the event data.</param>
 /// <param name="bounds">The bounds.</param>
 /// <param name="text">The text.</param>
 /// <param name="flags">The flags.</param>
 public CalendarRendererBoxEventArgs(CalendarRendererEventArgs original, Rectangle bounds, string text, TextFormatFlags flags)
     : this(original)
 {
     Bounds  = bounds;
     Text    = text;
     Format |= flags;
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CalendarRendererBoxEventArgs"/> class.
 /// </summary>
 /// <param name="original">The <see cref="WindowsFormsCalendar.CalendarRendererEventArgs"/> instance containing the event data.</param>
 public CalendarRendererBoxEventArgs(CalendarRendererEventArgs original)
     : base(original)
 {
     Font      = original.Calendar.Font;
     Format   |= TextFormatFlags.Default | TextFormatFlags.WordBreak | TextFormatFlags.PreserveGraphicsClipping;// | TextFormatFlags.WordEllipsis;
     TextColor = SystemColors.ControlText;
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CalendarRendererBoxEventArgs"/> class.
 /// </summary>
 /// <param name="original">The <see cref="WindowsFormsCalendar.CalendarRendererEventArgs"/> instance containing the event data.</param>
 /// <param name="bounds">The bounds.</param>
 /// <param name="text">The text.</param>
 /// <param name="textColor">Color of the text.</param>
 public CalendarRendererBoxEventArgs(CalendarRendererEventArgs original, Rectangle bounds, string text, Color textColor)
     : this(original)
 {
     Bounds    = bounds;
     Text      = text;
     TextColor = textColor;
 }
Exemple #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CalendarRendererTimeUnitEventArgs"/> class.
        /// </summary>
        /// <param name="original">The <see cref="WindowsFormsCalendar.CalendarRendererEventArgs"/> instance containing the event data.</param>
        /// <param name="unit">The unit.</param>
        public CalendarRendererTimeUnitEventArgs(CalendarRendererEventArgs original, CalendarTimeScaleUnit unit)
            : base(original)
        {
            _unit = unit;

            this.Graphics.SmoothingMode      = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            this.Graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
            this.Graphics.InterpolationMode  = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
            this.Graphics.PixelOffsetMode    = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
        }
Exemple #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CalendarRendererItemEventArgs"/> class.
        /// </summary>
        /// <param name="original">The <see cref="WindowsFormsCalendar.CalendarRendererEventArgs"/> instance containing the event data.</param>
        /// <param name="item">The item.</param>
        public CalendarRendererItemEventArgs(CalendarRendererEventArgs original, CalendarItem item)
            : base(original)
        {
            _item = item;

            this.Graphics.SmoothingMode      = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            this.Graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
            this.Graphics.InterpolationMode  = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
            this.Graphics.PixelOffsetMode    = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
        }
        /// <summary>
        /// Copies the parameters from the specified <see cref="CalendarRendererEventArgs"/>
        /// </summary>
        /// <param name="original">The <see cref="WindowsFormsCalendar.CalendarRendererEventArgs"/> instance containing the event data.</param>
        public CalendarRendererEventArgs(CalendarRendererEventArgs original)
        {
            _calendar = original.Calendar;
            _graphics = original.Graphics;
            _clip     = original.ClipRectangle;
            _tag      = original.Tag;

            if (_graphics != null)
            {
                _graphics.SmoothingMode      = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
                _graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
                _graphics.InterpolationMode  = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
                _graphics.PixelOffsetMode    = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
            }
        }
Exemple #7
0
        /// <summary>
        /// Paints the timescale of the calendar
        /// </summary>
        /// <param name="e">Paint info</param>
        public override void OnDrawTimeScale(CalendarRendererEventArgs e)
        {
            int margin  = 5;
            int largeX1 = TimeScaleBounds.Left + margin;
            int largeX2 = TimeScaleBounds.Right - margin;
            int shortX1 = TimeScaleBounds.Left + TimeScaleBounds.Width / 2;
            int shortX2 = largeX2;
            int top     = 0;
            Pen p       = new Pen(ColorTable.TimeScaleLine);

            for (int i = 0; i < e.Calendar.Days[0].TimeUnits.Length; i++)
            {
                CalendarTimeScaleUnit unit = e.Calendar.Days[0].TimeUnits[i];

                if (!unit.Visible)
                {
                    continue;
                }

                top = unit.Bounds.Top;

                if (unit.Minutes == 0)
                {
                    e.Graphics.DrawLine(p, largeX1, top, largeX2, top);
                }
                else
                {
                    e.Graphics.DrawLine(p, shortX1, top, shortX2, top);
                }
            }

            if (e.Calendar.DaysMode == CalendarDaysMode.Expanded &&
                e.Calendar.Days != null &&
                e.Calendar.Days.Length > 0 &&
                e.Calendar.Days[0].TimeUnits != null &&
                e.Calendar.Days[0].TimeUnits.Length > 0
                )
            {
                top = e.Calendar.Days[0].BodyBounds.Top;

                //Timescale top line is full
                e.Graphics.DrawLine(p, TimeScaleBounds.Left, top, TimeScaleBounds.Right, top);
            }

            p.Dispose();

            base.OnDrawTimeScale(e);
        }
Exemple #8
0
 /// <summary>
 /// Paints the background of the calendar
 /// </summary>
 /// <param name="e">Paint info</param>
 public override void OnDrawBackground(CalendarRendererEventArgs e)
 {
     e.Graphics.Clear(ColorTable.Background);
 }
Exemple #9
0
 /// <summary>
 /// Raises the <see cref="E:DrawWeekHeaders"/> event.
 /// </summary>
 /// <param name="e">The <see cref="WindowsFormsCalendar.CalendarRendererEventArgs"/> instance containing the event data.</param>
 public override void OnDrawWeekHeaders(CalendarRendererEventArgs e)
 {
     base.OnDrawWeekHeaders(e);
 }
Exemple #10
0
 /// <summary>
 /// Creates a new <see cref="CalendarRendererDayEventArgs"/> object
 /// </summary>
 /// <param name="original">Orignal object to copy basic paramters</param>
 /// <param name="day">Day to render</param>
 public CalendarRendererDayEventArgs(CalendarRendererEventArgs original, CalendarDay day)
     : base(original)
 {
     _day = day;
 }
Exemple #11
0
        /// <summary>
        /// Initializes the Calendar
        /// </summary>
        /// <param name="e"></param>
        public override void OnInitialize(CalendarRendererEventArgs e)
        {
            base.OnInitialize(e);

            e.Calendar.Font = SystemFonts.CaptionFont;
        }
Exemple #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CalendarRendererBoxEventArgs"/> class.
 /// </summary>
 /// <param name="original">The <see cref="WindowsFormsCalendar.CalendarRendererEventArgs"/> instance containing the event data.</param>
 /// <param name="bounds">The bounds.</param>
 public CalendarRendererBoxEventArgs(CalendarRendererEventArgs original, Rectangle bounds)
     : this(original)
 {
     Bounds = bounds;
 }