wxHexValidator extended with leading zeros support

Version set to 1.2
This commit is contained in:
Simon Rozman
2016-05-23 14:05:37 +02:00
parent 28f244cf2f
commit cdefd74f3f
5 changed files with 31 additions and 20 deletions

View File

@@ -23,17 +23,17 @@
///
/// wxExtend Version
///
#define wxEXTEND_VERSION 0x01010000
#define wxEXTEND_VERSION 0x01020000
#define wxEXTEND_VERSION_MAJ 1
#define wxEXTEND_VERSION_MIN 1
#define wxEXTEND_VERSION_MIN 2
#define wxEXTEND_VERSION_REV 0
#define wxEXTEND_VERSION_BUILD 0
#define wxEXTEND_VERSION_STR "1.1"
#define wxEXTEND_VERSION_STR "1.2"
#define wxEXTEND_BUILD_YEAR_STR "2016"
#define wxExtendVersion "11"
#define wxExtendVersion "12"
#if !defined(RC_INVOKED) && !defined(MIDL_PASS)

View File

@@ -51,8 +51,14 @@ protected:
#endif
wxString ToString(LongestValueType value) const;
protected:
void DoSetWidth(unsigned int width) { m_width = width; }
private:
virtual bool IsCharOk(const wxString& val, int pos, wxChar ch) const;
private:
unsigned int m_width; ///< Preferred width of the string - zero padding (<=1 disables padding)
};
@@ -65,8 +71,9 @@ class wxHexValidator : public wxPrivate::wxNumValidator<wxHexValidatorBase, T>
public:
typedef wxPrivate::wxNumValidator<wxHexValidatorBase, T> Base;
wxHexValidator(ValueType *value = NULL, int style = wxNUM_VAL_DEFAULT) : Base(value, style)
wxHexValidator(ValueType *value = NULL, int style = wxNUM_VAL_DEFAULT, unsigned int width = 0) : Base(value, style)
{
this->DoSetWidth(width);
this->DoSetMin(std::numeric_limits<ValueType>::min());
this->DoSetMax(std::numeric_limits<ValueType>::max());
}