What is the simplest way to add a trimming of spaces to EditString?
I tried to add a conversion. It works fine, but EditString stopped reacting to NotNull flag.
Here is the code of my converter:
struct TrimConvert : public Convert {
virtual Value Scan(const Value& text) const {
return TrimBoth(text.ToString());
}
};
Question is what I am doing wrong?
It is because NotNull is method of StringConvert, so if you replace the Convert, it is your responsibility to test for Null.
Note that in such case, using EditString has little merit, you should rather use EditField directly as used Convert is the only difference between both....