Implement wxCalendarCtrl::SetDateRange() in the native GTK version.

While GTK+ doesn't support imposing ranges for dates selection natively, we
can do it ourselves by preventing the user from selecting any date outside of
the currently valid range.

This allows to use ranges under all platforms and not only in wxCalendarCtrl
itself but in wxDatePickerCtrl as well.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-06-19 22:46:36 +00:00
parent 459c6f2a8a
commit 106f0d98f8
5 changed files with 99 additions and 20 deletions

View File

@@ -424,7 +424,9 @@ public:
/**
Sets the current date.
The @a date parameter must be valid.
The @a date parameter must be valid and in the currently valid range as
set by SetDateRange(), otherwise the current date is not changed and
the function returns @false.
*/
virtual bool SetDate(const wxDateTime& date);
@@ -476,14 +478,12 @@ public:
/**
@name Date Range Functions
The functions in this section are currently implemented in the generic
and MSW versions and do nothing in the native GTK implementation.
*/
//@{
/**
Restrict the dates shown by the control to the specified range.
Restrict the dates that can be selected in the control to the specified
range.
If either date is set, the corresponding limit will be enforced and
@true returned. If none are set, the existing restrictions are removed