public override void DrawUserHeader(IGUIContext gfx, System.Drawing.RectangleF rect, string UserName) { gfx.DrawGrayButton(rect); if (rect.Width > 4) { rect.Offset(2, 1); rect.Inflate(-2, 0); gfx.DrawString(UserName, BaseFont, SummerGUI.Theme.Brushes.Base03, rect, m_UserHeaderFormat); } }
public override void DrawDayHeader(IGUIContext gfx, System.Drawing.RectangleF rect, DateTime date) { if (date.Date.Equals(DateTime.Now.Date)) { gfx.DrawHighlightButton(rect); } else { gfx.DrawGrayButton(rect); } if (rect.Width < 2 || date == DateTime.MinValue) { return; } IGUIFont fntDay = BaseFont; string strDate; int StringWith = 0; try { strDate = date.ToString("D"); StringWith = (int)fntDay.Measure(strDate).Width; if (StringWith > rect.Width - 5) { strDate = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(date.DayOfWeek) + ", " + date.ToString("d"); StringWith = (int)fntDay.Measure(strDate).Width; if (StringWith > rect.Width - 5) { strDate = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetAbbreviatedDayName(date.DayOfWeek) + ", " + date.ToString("d"); StringWith = (int)fntDay.Measure(strDate).Width; if (StringWith > rect.Width - 5) { strDate = date.ToString("d"); StringWith = (int)fntDay.Measure(strDate).Width; if (StringWith > rect.Width - 5) { strDate = date.ToString("m"); StringWith = (int)fntDay.Measure(strDate).Width; if (StringWith > rect.Width - 3) { strDate = date.Day.ToString() + " " + System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetAbbreviatedMonthName(date.Month); StringWith = (int)fntDay.Measure(strDate).Width; if (StringWith > rect.Width - 3) { strDate = date.Day.ToString(); } } } } } } } catch (Exception) { strDate = "?"; } //gfx.DrawString (strDate, BaseFont, SummerGUI.Theme.Brushes.Base02, rect, m_DayHeaderFormat); gfx.DrawString(strDate, HeaderFont, SummerGUI.Theme.Brushes.Base01, rect, m_DayHeaderFormat); }