X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bc385ba9ebd0185d5bc3dcbf9fb3f35e3eac4d7a..cb9fb5bb00db9f4be77ec3bf9958982a3a9e17c2:/samples/calendar/calendar.cpp diff --git a/samples/calendar/calendar.cpp b/samples/calendar/calendar.cpp index 31c28a57a7..fd5162b094 100644 --- a/samples/calendar/calendar.cpp +++ b/samples/calendar/calendar.cpp @@ -67,6 +67,8 @@ public: void OnCalendar(wxCalendarEvent& event); void OnCalendarWeekDayClick(wxCalendarEvent& event); void OnCalendarChange(wxCalendarEvent& event); + void OnCalMonthChange(wxCalendarEvent& event); + void OnCalYearChange(wxCalendarEvent& event); wxCalendarCtrl *GetCal() const { return m_calendar; } @@ -148,6 +150,8 @@ END_EVENT_TABLE() BEGIN_EVENT_TABLE(MyPanel, wxPanel) EVT_CALENDAR (Calendar_CalCtrl, MyPanel::OnCalendar) + EVT_CALENDAR_MONTH (Calendar_CalCtrl, MyPanel::OnCalMonthChange) + EVT_CALENDAR_YEAR (Calendar_CalCtrl, MyPanel::OnCalYearChange) EVT_CALENDAR_SEL_CHANGED(Calendar_CalCtrl, MyPanel::OnCalendarChange) EVT_CALENDAR_WEEKDAY_CLICKED(Calendar_CalCtrl, MyPanel::OnCalendarWeekDayClick) END_EVENT_TABLE() @@ -340,6 +344,16 @@ void MyPanel::OnCalendarChange(wxCalendarEvent& event) m_date->SetLabel(s); } +void MyPanel::OnCalMonthChange(wxCalendarEvent& WXUNUSED(event)) +{ + wxLogStatus("Calendar month changed"); +} + +void MyPanel::OnCalYearChange(wxCalendarEvent& WXUNUSED(event)) +{ + wxLogStatus("Calendar year changed"); +} + void MyPanel::OnCalendarWeekDayClick(wxCalendarEvent& event) { wxLogMessage("Clicked on %s",