11#include <owl/validate.rh>
65 if (!
is.fail() && !
is.eof())
71 is.setstate(
is.failbit);
104 if ((range.Max > 0) !=
hasPlus)
120 WARN(range.Min > range.Max,
_T(
"TRangeValidator has a minimum value of ") << range.Min
121 <<
_T(
" that is greater than the maximum value of ") << range.Max
122 <<
_T(
"; swapped values will be used."));
123 std::sort(&range.Min, &range.Max + 1);
212 WARN(
is.fail(),
_T(
"ParseInteger_ failed"));
235 {
return e <
r.Min ?
r.Min :
e >
r.Max ?
r.Max :
e; };
240 WARN(
is.fail(),
_T(
"ParseInteger_ failed"));
248#if OWL_PERSISTENT_STREAMS
257 is >> GetObject()->Range.Min >> GetObject()->Range.Max;
265TRangeValidator::Streamer::Write(opstream&
os)
const
268 os << GetObject()->Range.Min << GetObject()->Range.Max;
Definition of class TAppDictionary.
Definition of class TApplication.
#define WARN(condition, message)
#define PRECONDITION(condition)
A streamable class, TFilterValidator checks an input field as the user types into it.
bool IsValid(LPCTSTR str)
IsValid overrides TValidator's virtuals and returns true if all characters in str are in the set of a...
Determines whether the data typed by a user falls within a designated range of integers.
void SetMax(TExtent maxValue)
Sets the maximum number the validator can accept.
bool IsValid(LPCTSTR str)
We first validate the range, because of the asynchronous manner in which SetMin and SetMax could be c...
void Error(TWindow *owner)
Overrides TValidator's virtual function and displays a message box indicating that the entered value ...
int Adjust(tstring &text, int &begPos, int &endPos, int amount)
We first validate the range, because of the asynchronous manner in which SetMin and SetMax could be c...
TRangeValidator(TExtent minValue, TExtent maxValue)
Constructs a range validator object using minValue and maxValue as the range of possible values.
void SetRange(const TRange &range)
Sets the minimum and maximum number the validator can accept.
uint Transfer(TCHAR *str, void *buffer, TTransferDirection direction)
Incorporates the three types, tdSizeData, tdGetData, and tdSetData, that a range validator can handle...
void SetMin(TExtent minValue)
Sets the minimum number the validator can accept.
uint16 Options
A bitmap member used to control options for various descendants of TValidator.
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)
@ voTransfer
Option to perform conversion & transfer.
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
@ tdSizeData
Return the size of data transferred by the class.
@ tdSetData
Set data from the buffer into the window.
@ tdGetData
Get data from the window into the buffer.
Object Windows Library (OWLNext Core)
std::istringstream tistringstream
auto to_tstring(const T &v) -> tstring