OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TStringLookupValidator Class Reference

Derived from TLookupValidator, TStringLookupValidator is a streamable class. More...

#include <owl/validate.h>

Inheritance diagram for owl::TStringLookupValidator:
owl::TLookupValidator owl::TValidator owl::TStreamableBase

Public Member Functions

 TStringLookupValidator (TSortedStringArray *strings)
 Constructs a string-lookup object by first calling the constructor inherited from TLookupValidator and then setting Strings to strings.
 
 ~TStringLookupValidator ()
 This destructor disposes of a list of valid strings by calling NewStringList and then disposes of the string-lookup validator object by calling the Destructor inherited from TLookupValidator.
 
void Error (TWindow *owner)
 Overrides TValidator's virtual function and displays a message box indicating that the typed string does not match an entry in the string list.
 
int Adjust (tstring &text, int &begPos, int &endPos, int amount)
 Adjusts the 'value' of the text, given a cursor position and an amount.
 
bool Lookup (LPCTSTR str)
 Overrides TLookupValidator's virtual function.
 
void NewStringList (TSortedStringArray *strings)
 Sets the list of valid input string for the string-lookup validator.
 
- Public Member Functions inherited from owl::TLookupValidator
 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.
 
- 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 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.
 
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 ()
 

Protected Member Functions

const TSortedStringArrayGetStrings () const
 Returns the set of valid strings used by the validator.
 
void SetStrings (TSortedStringArray *strings)
 Sets the valid strings used by the validator.
 

Additional Inherited Members

- Protected Attributes inherited from owl::TValidator
uint16 Options
 A bitmap member used to control options for various descendants of TValidator.
 

Detailed Description

Derived from TLookupValidator, TStringLookupValidator is a streamable class.

A TStringLookupValidator object verifies the data in its associated edit control by searching through a collection of valid strings. You can use string-lookup validators when your edit control needs to accept only members of a certain set of strings.

Definition at line 295 of file validate.h.

Constructor & Destructor Documentation

◆ TStringLookupValidator()

owl::TStringLookupValidator::TStringLookupValidator ( TSortedStringArray * strings)

Constructs a string-lookup object by first calling the constructor inherited from TLookupValidator and then setting Strings to strings.

Definition at line 60 of file lookval.cpp.

◆ ~TStringLookupValidator()

owl::TStringLookupValidator::~TStringLookupValidator ( )

This destructor disposes of a list of valid strings by calling NewStringList and then disposes of the string-lookup validator object by calling the Destructor inherited from TLookupValidator.

Definition at line 72 of file lookval.cpp.

Member Function Documentation

◆ Adjust()

int owl::TStringLookupValidator::Adjust ( tstring & text,
int & begPos,
int & endPos,
int amount )
virtual

Adjusts the 'value' of the text, given a cursor position and an amount.

Returns the actual amount adjusted.

Reimplemented from owl::TValidator.

Definition at line 116 of file lookval.cpp.

References owl::TMSortedObjectArray< T, A >::Find(), owl::TArrayBase::NPOS, and owl::TArrayBase::Size().

◆ Error()

void owl::TStringLookupValidator::Error ( TWindow * owner)
virtual

Overrides TValidator's virtual function and displays a message box indicating that the typed string does not match an entry in the string list.

Reimplemented from owl::TValidator.

Definition at line 82 of file lookval.cpp.

References PRECONDITION.

◆ GetStrings()

const TSortedStringArray * owl::TStringLookupValidator::GetStrings ( ) const
inlineprotected

Returns the set of valid strings used by the validator.

Definition at line 447 of file validate.h.

◆ Lookup()

bool owl::TStringLookupValidator::Lookup ( LPCTSTR str)
virtual

Overrides TLookupValidator's virtual function.

Returns true if the string passed in str matches any of the strings. Uses the search method of the string collection to determine if str is present.

Reimplemented from owl::TLookupValidator.

Definition at line 94 of file lookval.cpp.

References owl::TMSortedObjectArray< T, A >::Find(), and owl::TArrayBase::NPOS.

◆ NewStringList()

void owl::TStringLookupValidator::NewStringList ( TSortedStringArray * strings)

Sets the list of valid input string for the string-lookup validator.

Disposes of any existing string list and then sets Strings to strings.

Definition at line 106 of file lookval.cpp.

◆ SetStrings()

void owl::TStringLookupValidator::SetStrings ( TSortedStringArray * strings)
inlineprotected

Sets the valid strings used by the validator.

Definition at line 455 of file validate.h.


The documentation for this class was generated from the following files: