A couple of additional data-points:
The wheel isn’t much to reinvent. There’s not a lot to the wxWidgets numeric
validators. (The num validator, int validator and floating point validator
together make up only 300 lines of commented code.)
The developer has to add UNIT_BINDERs for each
Hey Jeff,
This is a better argument. I will counter by suggesting that the
OnChar() event handler can be overridden to provide the behavior we
need. I realize that it would be difficult to perform units
verification and/or numerical evaluation in the OnChar() event handler
but you can prevent
Hi Wayne,
The primary issue is that they try to do all their validation through OnChar().
As JP mentioned, this leads to problems like typing 0 to start a number. But
it also means the only way they have to guarantee a number is to allow only
digits, zero-or-one minus sign, and zero-or-one
Jeff,
I'm not opposed to this solution but I need technical information as to
why we should use one solution over another. "Brain dead" is not a
technical reason and doesn't really help me make an informed decision.
I've used validators for simple edit control validation in the past and
I looked in to wxWidget’s validators, and they’re definitely challenged.
(Brain-dead might be more accurate.)
As part of the units overhaul I’m going to propose making widespread use of the
UNIT_BINDER, which is a wrapper for a wxTextEntry/wxStaticText-tuple.
As a wrapper it’ll be easy to
5 matches
Mail list logo