
Public Member Functions | |
| CalendarCtrl (Window parent, DateTime date, Point pos, Size size, wx.WindowStyles style, string name) | |
| CalendarCtrl (Window parent, DateTime date, Point pos, Size size, wx.WindowStyles style) | |
| CalendarCtrl (Window parent, DateTime date, Point pos, Size size) | |
| CalendarCtrl (Window parent, DateTime date, Point pos) | |
| CalendarCtrl (Window parent, DateTime date) | |
| CalendarCtrl (Window parent) | |
| CalendarCtrl (Window parent, int id, DateTime date, Point pos, Size size, wx.WindowStyles style, string name) | |
| CalendarCtrl (Window parent, int id, DateTime date, Point pos, Size size, wx.WindowStyles style) | |
| CalendarCtrl (Window parent, int id, DateTime date, Point pos, Size size) | |
| CalendarCtrl (Window parent, int id, DateTime date, Point pos) | |
| CalendarCtrl (Window parent, int id, DateTime date) | |
| CalendarCtrl (Window parent, int id) | |
| CalendarCtrl () | |
| CalendarCtrl (IntPtr wxObject) | |
| bool | Create (Window parent, int id, DateTime date, Point pos, Size size, wx.WindowStyles style, string name) |
| delegate void | DateEventHandler (CalendarCtrl sender, DateEventArgs args) |
| CalendarDateAttr | GetAttr (int day) |
| CalendarHitTestResult | HitTest (Point pos) |
| CalendarHitTestResult | HitTest (Point pos, ref DateTime date) |
| CalendarHitTestResult | HitTest (Point pos, ref DateTime date, ref DayOfWeek wd) |
| void | ResetAttr (int day) |
| void | SetAttr (int day, CalendarDateAttr attr) |
| bool | SetDateRange (DateTime lowerdate, DateTime upperdate) |
| void | SetHeaderColours (Colour colFg, Colour colBg) |
| void | SetHighlightColours (Colour colFg, Colour colBg) |
| void | SetHoliday (int day) |
| void | SetHolidayColours (Colour colFg, Colour colBg) |
Public Attributes | |
| event DateEventHandler | OnChangedDate |
Protected Member Functions | |
| override void | Dispose (bool disposing) |
Properties | |
| DateTime | Date [get, set] |
| bool | EnableHolidayDisplay [set] |
| bool | EnableMonthChange [set] |
| bool | EnableYearChange [set] |
| Colour | HeaderColourBg [get] |
| Colour | HeaderColourFg [get] |
| Colour | HighlightColourBg [get] |
| Colour | HighlightColourFg [get] |
| Colour | HolidayColourBg [get] |
| Colour | HolidayColourFg [get] |
| DateTime | LowerDateLimit [get, set] |
| Calendar | SpecialDays [get, set] |
| DateTime | UpperDateLimit [get, set] |
Events | |
| event EventListener | DayChange [add, remove] |
| event EventListener | DoubleClick [add, remove] |
| event EventListener | MonthChange [add, remove] |
| event EventListener | SelectionChange [add, remove] |
| event EventListener | WeekdayClick [add, remove] |
| event EventListener | YearChange [add, remove] |
Classes | |
| class | DateEventArgs |
For this, it displays a window containing several parts: a control at the top to pick the month and the year (either or both of them may be disabled), and a month area below them which shows all the days in the month. The user can move the current selection using the keyboard and select the date (generating EVT_CALENDAR event) by pressing "Return" or double clicking it.
It has advanced possibilities for the customization of its display. All global settings (such as colours and fonts used) can, of course, be changed. But also, the display style for each day in the month can be set independently using wx.CalendarDateAttr class.
An item without custom attributes is drawn with the default colours and font and without border, but setting custom attributes with SetAttr allows to modify its appearance. Just create a custom attribute object and set it for the day you want to be displayed specially (note that the control will take ownership of the pointer, i.e. it will delete it itself). A day may be marked as being a holiday, even if it is not recognized as one by DateTime using SetHoliday method.
As the attributes are specified for each day, they may change when the month is changed, so you will often want to update them in EVT_CALENDAR_MONTH event handler.
The calendar control in the controls.exe sample application.
| wx.CalendarCtrl.CalendarCtrl | ( | IntPtr | wxObject | ) |
| wx.CalendarCtrl.CalendarCtrl | ( | ) |
| wx.CalendarCtrl.CalendarCtrl | ( | Window | parent, | |
| int | id | |||
| ) |
| wx.CalendarCtrl.CalendarCtrl | ( | Window | parent, | |
| int | id, | |||
| DateTime | date | |||
| ) |
| wx.CalendarCtrl.CalendarCtrl | ( | Window | parent, | |
| int | id, | |||
| DateTime | date, | |||
| Point | pos | |||
| ) |
| wx.CalendarCtrl.CalendarCtrl | ( | Window | parent, | |
| int | id, | |||
| DateTime | date, | |||
| Point | pos, | |||
| Size | size | |||
| ) |
| wx.CalendarCtrl.CalendarCtrl | ( | Window | parent, | |
| int | id, | |||
| DateTime | date, | |||
| Point | pos, | |||
| Size | size, | |||
| wx.WindowStyles | style | |||
| ) |
| wx.CalendarCtrl.CalendarCtrl | ( | Window | parent, | |
| int | id, | |||
| DateTime | date, | |||
| Point | pos, | |||
| Size | size, | |||
| wx.WindowStyles | style, | |||
| string | name | |||
| ) |
| wx.CalendarCtrl.CalendarCtrl | ( | Window | parent | ) |
| wx.CalendarCtrl.CalendarCtrl | ( | Window | parent, | |
| DateTime | date | |||
| ) |
| wx.CalendarCtrl.CalendarCtrl | ( | Window | parent, | |
| DateTime | date, | |||
| Point | pos | |||
| ) |
| wx.CalendarCtrl.CalendarCtrl | ( | Window | parent, | |
| DateTime | date, | |||
| Point | pos, | |||
| Size | size | |||
| ) |
| wx.CalendarCtrl.CalendarCtrl | ( | Window | parent, | |
| DateTime | date, | |||
| Point | pos, | |||
| Size | size, | |||
| wx.WindowStyles | style | |||
| ) |
| wx.CalendarCtrl.CalendarCtrl | ( | Window | parent, | |
| DateTime | date, | |||
| Point | pos, | |||
| Size | size, | |||
| wx.WindowStyles | style, | |||
| string | name | |||
| ) |
| bool wx.CalendarCtrl.Create | ( | Window | parent, | |
| int | id, | |||
| DateTime | date, | |||
| Point | pos, | |||
| Size | size, | |||
| wx.WindowStyles | style, | |||
| string | name | |||
| ) |
| delegate void wx.CalendarCtrl.DateEventHandler | ( | CalendarCtrl | sender, | |
| DateEventArgs | args | |||
| ) |
| override void wx.CalendarCtrl.Dispose | ( | bool | disposing | ) | [protected, virtual] |
Overriden disposition. Even if we do not own the memory, we have to delete the window, since this is apparently intended by the user calling this method.
Reimplemented from wx.Window.
| CalendarDateAttr wx.CalendarCtrl.GetAttr | ( | int | day | ) |
Gets the attributes of the provided day in month (1..31).
| CalendarHitTestResult wx.CalendarCtrl.HitTest | ( | Point | pos | ) |
| CalendarHitTestResult wx.CalendarCtrl.HitTest | ( | Point | pos, | |
| ref DateTime | date | |||
| ) |
| CalendarHitTestResult wx.CalendarCtrl.HitTest | ( | Point | pos, | |
| ref DateTime | date, | |||
| ref DayOfWeek | wd | |||
| ) |
| void wx.CalendarCtrl.ResetAttr | ( | int | day | ) |
Resets the attributes of the designated day in month (1..31) to be a holiday.
| void wx.CalendarCtrl.SetAttr | ( | int | day, | |
| CalendarDateAttr | attr | |||
| ) |
Sets the attributes of the provided day in month (1..31).
| bool wx.CalendarCtrl.SetDateRange | ( | DateTime | lowerdate, | |
| DateTime | upperdate | |||
| ) |
| void wx.CalendarCtrl.SetHoliday | ( | int | day | ) |
Declares the designated day in month (1..31) to be a holiday.
| event DateEventHandler wx.CalendarCtrl.OnChangedDate |
This will be called on setting Date.
DateTime wx.CalendarCtrl.Date [get, set] |
Get or set the currently selected date. You may use OnSetDate to be informed of changing this value,
bool wx.CalendarCtrl.EnableHolidayDisplay [set] |
bool wx.CalendarCtrl.EnableMonthChange [set] |
bool wx.CalendarCtrl.EnableYearChange [set] |
Colour wx.CalendarCtrl.HeaderColourBg [get] |
Colour wx.CalendarCtrl.HeaderColourFg [get] |
Colour wx.CalendarCtrl.HighlightColourBg [get] |
Colour wx.CalendarCtrl.HighlightColourFg [get] |
Colour wx.CalendarCtrl.HolidayColourBg [get] |
Colour wx.CalendarCtrl.HolidayColourFg [get] |
DateTime wx.CalendarCtrl.LowerDateLimit [get, set] |
Calendar wx.CalendarCtrl.SpecialDays [get, set] |
Returns the current definition of special days and holidays if present. Assigning a new calendar to this control will immediately highlight the specified special days like holidays etc. So, fill the Calendar first and then assign it to the control.
DateTime wx.CalendarCtrl.UpperDateLimit [get, set] |
event EventListener wx.CalendarCtrl.DayChange [add, remove] |
event EventListener wx.CalendarCtrl.DoubleClick [add, remove] |
event EventListener wx.CalendarCtrl.MonthChange [add, remove] |
event EventListener wx.CalendarCtrl.SelectionChange [add, remove] |
event EventListener wx.CalendarCtrl.WeekdayClick [add, remove] |
event EventListener wx.CalendarCtrl.YearChange [add, remove] |