Keep displayed month and year in sync in wxGenericCalendarCtrl.

When the date was constrained to a range in wxGenericCalendarCtrl, the display
of the month in the month combobox could get out of sync with its real value.

Ensure that the correct month is always displayed and also simplify the code
by removing the apparently unnecessarily complex logic in ChangeYear() and
ChangeMonth() functions.

Closes #11060.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-10-24 22:40:41 +00:00
parent 69060f4f0c
commit 3c9863aca7
2 changed files with 36 additions and 88 deletions

View File

@@ -202,12 +202,12 @@ private:
// is this date shown?
bool IsDateShown(const wxDateTime& date) const;
// is this date in the given range?
// is this date in the currently allowed range?
bool IsDateInRange(const wxDateTime& date) const;
// range helpers
bool ChangeYear(wxDateTime* target) const;
bool ChangeMonth(wxDateTime* target) const;
// adjust the date to the currently allowed range, return true if it was
// changed
bool AdjustDateToRange(wxDateTime *date) const;
// redraw the given date
void RefreshDate(const wxDateTime& date);