OWLNext 7.0
Borland's Object Windows Library for the modern age
|
TFilterValidator is a simple validator that checks input as the user enters it.
The filter validator constructor takes one parameter, a set of valid characters:
TCharSet is defined in bitset.h.
TFilterValidator overrides IsValidInput to return true only if all characters in the current input string are contained in the set of characters passed to the constructor.
The edit control inserts characters only if IsValidInput returns true, so there is no need to override IsValid. Because the characters made it through the input filter, the complete string is valid by definition.
Descendants of TFilterValidator, such as TRangeValidator, can combine filtering of input with other checks on the completed string.