X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/628e155d8c70da0f962289cf1e1dea3699255707..4e2a3778386d60356dab319afa2d3f987f86d6b2:/src/common/calctrlcmn.cpp diff --git a/src/common/calctrlcmn.cpp b/src/common/calctrlcmn.cpp index 481be6e619..896ac3ba37 100644 --- a/src/common/calctrlcmn.cpp +++ b/src/common/calctrlcmn.cpp @@ -60,5 +60,23 @@ bool wxCalendarCtrlBase::EnableMonthChange(bool enable) return true; } +void wxCalendarCtrlBase::GenerateAllChangeEvents(const wxDateTime& dateOld) +{ + const wxDateTime::Tm tm1 = dateOld.GetTm(), + tm2 = GetDate().GetTm(); + + GenerateEvent(wxEVT_CALENDAR_SEL_CHANGED); + if ( tm1.year != tm2.year || tm1.mon != tm2.mon ) + GenerateEvent(wxEVT_CALENDAR_PAGE_CHANGED); + + // send also one of the deprecated events + if ( tm1.year != tm2.year ) + GenerateEvent(wxEVT_CALENDAR_YEAR_CHANGED); + else if ( tm1.mon != tm2.mon ) + GenerateEvent(wxEVT_CALENDAR_MONTH_CHANGED); + else + GenerateEvent(wxEVT_CALENDAR_DAY_CHANGED); +} + #endif // wxUSE_CALENDARCTRL