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:
@@ -189,9 +189,22 @@ bool wxCalendarCtrl::GetDateRange(wxDateTime *dt1, wxDateTime *dt2) const
|
|||||||
|
|
||||||
bool wxCalendarCtrl::EnableMonthChange(bool enable)
|
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)
|
void wxCalendarCtrl::Mark(size_t day, bool mark)
|
||||||
|
|||||||
Reference in New Issue
Block a user