Refactor code for numeric validation in numeric wxPG properties
Move template function NumericValidation() to wxNumericProperty because all data necessary to validate the value are available here: acceptable value range, SpinCtrl editor value wrapping mode, etc.
This commit is contained in:
@@ -166,10 +166,13 @@ public:
|
||||
|
||||
virtual wxVariant AddSpinStepValue(long stepScale) const = 0;
|
||||
|
||||
wxVariant GetMinVal() const { return m_minVal; }
|
||||
wxVariant GetMaxVal() const { return m_maxVal; }
|
||||
bool UseSpinMotion() const { return m_spinMotion; }
|
||||
|
||||
// Common validation code - for internal use.
|
||||
template<typename T>
|
||||
bool DoNumericValidation(T& value, wxPGValidationInfo* pValidationInfo,
|
||||
int mode, T defMin, T defMax) const;
|
||||
|
||||
protected:
|
||||
wxNumericProperty(const wxString& label, const wxString& name);
|
||||
|
||||
|
Reference in New Issue
Block a user