A stricter numeric text validator?
Manuel Martín
mmartin at ceyd.es
Fri Aug 17 05:21:20 PDT 2007
> wxFormatValidator is not able to check if the entered value is in a
> certain range (or I evaluated an old version).
Yes, range is supported in new version.
> Furthermore, I like to have as a valPtr a pointer to a number type
> variable and not a string. It is not difficult to convert the string
> into a number type again but it is just additional work. Alternatively
> the class should support both types, strings or number types.
If value comes from a wxTextCtrl, it comes from a string.
Converting into a number is beyond user input.
If value is read from a file, socket, etc. you must first
know how the number is stored (IIEE, string, formatted string,...)
and then convert it.
How can you avoid the additional work?
If you just need a quick check (not formmated/localized)
take a look at QCheck in forstnu.cpp from wxFormatValidator.
HTH
Manolo
More information about the wx-users
mailing list