OWLNext 7.0
Borland's Object Windows Library for the modern age
|
A streamable class, TLookupValidator compares the string typed by a user with a list of acceptable values. More...
#include <owl/validate.h>
Public Member Functions | |
TLookupValidator () | |
Constructs a TLookupValidator object. | |
bool | IsValid (LPCTSTR str) |
IsValid overrides TValidator's virtual function and calls Lookup to find the string str in the list of valid input items. | |
virtual bool | Lookup (LPCTSTR str) |
Searches for the string str in the list of valid entries and returns true if it finds str; otherwise, returns false. | |
Public Member Functions inherited from owl::TValidator | |
TValidator () | |
Constructs an abstract validator object and sets Options fields to 0. | |
virtual | ~TValidator () |
Destroys an abstract validator object. | |
virtual void | Error (TWindow *owner) |
Error is an abstract function called by Valid when it detects that the user has entered invalid information. | |
virtual bool | IsValidInput (TCHAR *input, bool suppressFill) |
Checks current input against validator. | |
virtual uint | Transfer (TCHAR *text, void *buffer, TTransferDirection direction) |
Allows a validator to set and read the values of its associated edit control. | |
virtual int | Adjust (tstring &text, int &begPos, int &endPos, int amount) |
Adjusts the 'value' of the text, given a cursor position and an amount. | |
bool | Valid (LPCTSTR str, TWindow *owner=0) |
Returns true if IsValid returns true. | |
bool | Valid (const tstring &str, TWindow *owner=0) |
bool | HasOption (int option) |
Gets the Options bits. Returns true if a specified option is set. | |
void | SetOption (int option) |
Sets the bits for the Options data member. | |
void | UnsetOption (int option) |
Unsets the bits specified in the Options data member. | |
Public Member Functions inherited from owl::TStreamableBase | |
virtual | ~TStreamableBase () |
Additional Inherited Members | |
Protected Attributes inherited from owl::TValidator | |
uint16 | Options |
A bitmap member used to control options for various descendants of TValidator. | |
A streamable class, TLookupValidator compares the string typed by a user with a list of acceptable values.
TLookupValidator is an abstract validator type from which you can derive useful lookup validators. You will never create an instance of TLookupValidator. When you create a lookup validator type, you need to specify a list of valid items and override the Lookup method to return true only if the user input matches an item in that list. One example of a working descendant of TLookupValidator is TStringLookupValidator.
Definition at line 269 of file validate.h.
owl::TLookupValidator::TLookupValidator | ( | ) |
Constructs a TLookupValidator object.
Definition at line 25 of file lookval.cpp.
IsValid overrides TValidator's virtual function and calls Lookup to find the string str in the list of valid input items.
IsValid returns true if Lookup returns true, meaning Lookup found str in its list; otherwise, it returns false.
Reimplemented from owl::TValidator.
Definition at line 35 of file lookval.cpp.
References Lookup().
Searches for the string str in the list of valid entries and returns true if it finds str; otherwise, returns false.
TLookupValidator's Lookup is an abstract method that always returns false. Descendant lookup validator types must override Lookup to perform a search based on the actual list of acceptable items.
Reimplemented in owl::TStringLookupValidator.
Definition at line 48 of file lookval.cpp.