cxWidgets 1.0
Functions
cxValidators Namespace Reference

Functions

std::string intOnKeyValidator (void *theInput, void *clearOnSpace)
 Validator for inputs that should only accept integers. This is.
 
std::string floatingPtOnKeyValidator (void *theInput, void *clearOnSpace)
 Validator for inputs that should only accept floating-point.
 
bool isValidFloatingPtNumStr (const std::string &pNumStr)
 Returns whether or not a string contains a valid floating-point.
 
bool isValidWholeNumStr (const std::string &pNumStr)
 Returns whether or not a string contains a valid whole number. A.
 

Function Documentation

◆ floatingPtOnKeyValidator()

string cxValidators::floatingPtOnKeyValidator ( void *  theInput,
void *  clearOnSpace 
)

Validator for inputs that should only accept floating-point.

numbers. This is meant to be used as an 'onKey' validator (to

validate on each keypress).

Parameters
theInputA pointer to the cxMultiLineInput to validate
clearOnSpaceA pointer to a boolean (if non-null and true, will clear the input when the spacebar is pressed).
Returns
Blank string for valid data or a warning for invalid data.

References cx::cxWindow::getLastKey(), cx::cxMultiLineInput::getValue(), cx::cxMultiLineInput::refreshValue(), and cx::cxMultiLineInput::setValue().

Referenced by floatingPtValidateOnForm(), and cx::cxMultiLineInput::onKeypress().

◆ intOnKeyValidator()

string cxValidators::intOnKeyValidator ( void *  theInput,
void *  clearOnSpace 
)

Validator for inputs that should only accept integers. This is.

meant to be used as an 'onKey' validator (to validate on each

keypress).

Parameters
theInputA pointer to a cxMultiLineInput whose input to validate
clearOnSpaceA pointer to a boolean (if non-null and true, will clear the input when the spacebar is pressed).
Returns
Blank string for valid data or a warning for invalid data.

References cx::cxWindow::getLastKey(), cx::cxMultiLineInput::getValue(), cx::cxMultiLineInput::refreshValue(), and cx::cxMultiLineInput::setValue().

Referenced by integerValidateOnForm(), and cx::cxMultiLineInput::onKeypress().

◆ isValidFloatingPtNumStr()

bool cxValidators::isValidFloatingPtNumStr ( const std::string &  pNumStr)

Returns whether or not a string contains a valid floating-point.

number. A blank string is considered valid.

Parameters
pNumStrA string to test
Returns
true if the string contains a valid floating-point number, or false if not.

References isValidFloatingPtNumStr().

Referenced by isValidFloatingPtNumStr(), and test_isValidFloatingPtNumStr().

◆ isValidWholeNumStr()

bool cxValidators::isValidWholeNumStr ( const std::string &  pNumStr)

Returns whether or not a string contains a valid whole number. A.

blank string is considered valid.

Parameters
pNumStrA string to test
Returns
true if the string contains a valid whole number, or false if not.

References isValidWholeNumStr().

Referenced by isValidWholeNumStr(), and test_isValidWholeNumStr().