OWLNext 7.0
Borland's Object Windows Library for the modern age
|
TStringLookupValidator is a working example of a lookup validator; it compares the string passed from the edit control with the items in a string list.
If the passed-in string occurs in the list, TStringLookupValidator::IsValid returns true.
The constructor takes only one parameter, a pointer to a TSortedStringArray object containing the list of valid strings:
To use a different string list after constructing the string lookup validator, use member function TStringLookupValidator::NewStringList, which disposes of the old list and installs the new list.
TStringLookupValidator overrides TStringLookupValidator::Lookup and TStringLookupValidator::Error. Lookup returns true if the passed-in string is in the list. Error displays a message box indicating that the string is not in the list.