9#include <owl/validate.rh>
121 const auto count =
static_cast<int>(Strings->
Size());
122 const auto index = Strings->
Find(
text);
123 if (index == Strings->
NPOS)
139#if OWL_PERSISTENT_STREAMS
155TLookupValidator::Streamer::Write(opstream&
os)
const
164TStringLookupValidator::Streamer::Read(ipstream&
is,
uint32 )
const
170 for (
unsigned i = 0;
i < count;
i++ ) {
173 GetObject()->Strings->Add(
temp);
182TStringLookupValidator::Streamer::Write(opstream&
os)
const
185 unsigned count = GetObject()->Strings->Size();
187 for (
unsigned i = 0;
i < count;
i++)
188 os << (*GetObject()->Strings)[
i];
Definition of class TAppDictionary.
Definition of class TApplication.
#define PRECONDITION(condition)
A streamable class, TLookupValidator compares the string typed by a user with a list of acceptable va...
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 o...
virtual bool Lookup(LPCTSTR str)
Searches for the string str in the list of valid entries and returns true if it finds str; otherwise,...
int Find(const T &t) const
Derived from TLookupValidator, TStringLookupValidator is a streamable class.
void Error(TWindow *owner)
Overrides TValidator's virtual function and displays a message box indicating that the typed string d...
int Adjust(tstring &text, int &begPos, int &endPos, int amount)
Adjusts the 'value' of the text, given a cursor position and an amount.
~TStringLookupValidator()
This destructor disposes of a list of valid strings by calling NewStringList and then disposes of the...
TStringLookupValidator(TSortedStringArray *strings)
Constructs a string-lookup object by first calling the constructor inherited from TLookupValidator an...
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.
A streamable class, TValidator defines an abstract data validation object.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
Definition of class TFrameWindow.
void ReadBaseObject(Base *base, ipstream &in)
#define IMPLEMENT_STREAMABLE1(cls, base1)
void WriteBaseObject(Base *base, opstream &out)
Object Windows Library (OWLNext Core)
TSortedObjectArray< tstring > TSortedStringArray