implement EnableMonthChange() by restricting the dates range to the current month (this is not ideal as the UI of the control doesn't change, but better than nothing)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53005 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-04-04 14:24:02 +00:00
parent aa7ee888f3
commit 7ec5c42e94

View File

@ -189,9 +189,22 @@ bool wxCalendarCtrl::GetDateRange(wxDateTime *dt1, wxDateTime *dt2) const
bool wxCalendarCtrl::EnableMonthChange(bool enable)
{
wxFAIL_MSG( "not implemented" );
if ( !wxCalendarCtrlBase::EnableMonthChange(enable) )
return false;
return false;
wxDateTime dtStart, dtEnd;
if ( !enable )
{
dtStart = GetDate();
dtStart.SetDay(1);
dtEnd = dtStart.GetLastMonthDay();
}
//else: leave them invalid to remove the restriction
SetDateRange(dtStart, dtEnd);
return true;
}
void wxCalendarCtrl::Mark(size_t day, bool mark)