Add wxIntegerValidatorctor ctor taking minimum and maximum value
Using this ctor is more convenient than using the default ctor and then calling SetMin() and SetMax(). Document the new ctor and add tests showing that minimum and maximum values are actually respected. Closes https://github.com/wxWidgets/wxWidgets/pull/2610
This commit is contained in:
committed by
Vadim Zeitlin
parent
a2389fc512
commit
0fc936ca41
@@ -347,6 +347,19 @@ public:
|
||||
this->SetMax(std::numeric_limits<ValueType>::max());
|
||||
}
|
||||
|
||||
// Ctor for an integer validator.
|
||||
//
|
||||
// Sets the range to the specified interval [min, max].
|
||||
wxIntegerValidator(ValueType *value,
|
||||
ValueType min,
|
||||
ValueType max,
|
||||
int style = wxNUM_VAL_DEFAULT)
|
||||
: Base(value, style)
|
||||
{
|
||||
this->SetMin(min);
|
||||
this->SetMax(max);
|
||||
}
|
||||
|
||||
virtual wxObject *Clone() const wxOVERRIDE { return new wxIntegerValidator(*this); }
|
||||
|
||||
virtual bool IsInRange(LongestValueType value) const wxOVERRIDE
|
||||
|
||||
Reference in New Issue
Block a user