Add Get{Min,Max,Range}() to numeric validator classes

Just provide accessors matching the existing setters.

Closes https://github.com/wxWidgets/wxWidgets/pull/1287,
https://github.com/wxWidgets/wxWidgets/pull/1288
This commit is contained in:
Vsevolod V Gromov
2019-04-10 15:31:46 +03:00
committed by Vadim Zeitlin
parent 3674bd1c1f
commit 20c7421a67
2 changed files with 40 additions and 0 deletions

View File

@@ -157,17 +157,33 @@ public:
this->DoSetMin(min);
}
ValueType GetMin() const
{
return static_cast<ValueType>(this->DoGetMin());
}
void SetMax(ValueType max)
{
this->DoSetMax(max);
}
ValueType GetMax() const
{
return static_cast<ValueType>(this->DoGetMax());
}
void SetRange(ValueType min, ValueType max)
{
SetMin(min);
SetMax(max);
}
void GetRange(ValueType& min, ValueType& max) const
{
min = GetMin();
max = GetMax();
}
virtual bool TransferToWindow() wxOVERRIDE
{
if ( m_value )
@@ -288,7 +304,9 @@ protected:
static bool FromString(const wxString& s, LongestValueType *value);
void DoSetMin(LongestValueType min) { m_min = min; }
LongestValueType DoGetMin() const { return m_min; }
void DoSetMax(LongestValueType max) { m_max = max; }
LongestValueType DoGetMax() const { return m_max; }
bool IsInRange(LongestValueType value) const
{
@@ -390,7 +408,9 @@ protected:
bool FromString(const wxString& s, LongestValueType *value) const;
void DoSetMin(LongestValueType min) { m_min = min; }
LongestValueType DoGetMin() const { return m_min; }
void DoSetMax(LongestValueType max) { m_max = max; }
LongestValueType DoGetMax() const { return m_max; }
bool IsInRange(LongestValueType value) const
{