Applied patch [ 650511 ] wxCalendarCtrl - year does not change
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -68,7 +68,11 @@ class wxYearSpinCtrl : public wxSpinCtrl
|
||||
public:
|
||||
wxYearSpinCtrl(wxCalendarCtrl *cal);
|
||||
|
||||
void OnYearTextChange(wxCommandEvent& event) { m_cal->OnYearChange(event); }
|
||||
void OnYearTextChange(wxCommandEvent& event)
|
||||
{
|
||||
m_cal->SetUserChangedYear();
|
||||
m_cal->OnYearChange(event);
|
||||
}
|
||||
void OnYearChange(wxSpinEvent& event) { m_cal->OnYearChange(event); }
|
||||
|
||||
private:
|
||||
@@ -449,8 +453,6 @@ bool wxCalendarCtrl::SetDate(const wxDateTime& date)
|
||||
{
|
||||
if ( !m_userChangedYear )
|
||||
m_spinYear->SetValue(m_date.Format(_T("%Y")));
|
||||
else // don't overwrite what the user typed in
|
||||
m_userChangedYear = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,6 +470,8 @@ bool wxCalendarCtrl::SetDate(const wxDateTime& date)
|
||||
}
|
||||
}
|
||||
|
||||
m_userChangedYear = FALSE;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -1569,10 +1573,6 @@ void wxCalendarCtrl::OnYearChange(wxCommandEvent& event)
|
||||
return;
|
||||
}
|
||||
|
||||
// set the flag for SetDate(): otherwise it would overwrite the year
|
||||
// typed in by the user
|
||||
m_userChangedYear = TRUE;
|
||||
|
||||
wxDateTime::Tm tm = m_date.GetTm();
|
||||
|
||||
if ( tm.mday > wxDateTime::GetNumberOfDays(tm.mon, year) )
|
||||
|
Reference in New Issue
Block a user