Document and test wxDatePickerCtrl::SetRange() date-clamping behaviour.
Document that the current value of the control is adjusted if it doesn't lie in the newly set range and add a unit test to check for this, now that it actually passes under all platforms, after the previous commits.
This commit is contained in:
@@ -106,6 +106,13 @@ void DatePickerCtrlTestCase::Range()
|
||||
|
||||
m_datepicker->SetValue(dtStart - wxTimeSpan::Day());
|
||||
CPPUNIT_ASSERT_EQUAL( dtEnd, m_datepicker->GetValue() );
|
||||
|
||||
|
||||
// Changing the range should clamp the current value to it if necessary.
|
||||
const wxDateTime
|
||||
dtBeforeEnd = dtEnd - wxDateSpan::Day();
|
||||
m_datepicker->SetRange(dtStart, dtBeforeEnd);
|
||||
CPPUNIT_ASSERT_EQUAL( dtBeforeEnd, m_datepicker->GetValue() );
|
||||
}
|
||||
|
||||
#endif // wxUSE_DATEPICKCTRL
|
||||
|
Reference in New Issue
Block a user