-// -*- C++ -*-
/* input_validators.C
* A collection of input filtering and validating functions for use in
* XForms dialogs. Mainly meant for filtering input boxes although may
{
#endif
+int fl_int_filter(FL_OBJECT * ob,
+ char const *, char const *, int c)
+{
+ if (c == 0 /* final test before handing contents to app */
+ || strchr("0123456789+-", c)) {
+ if (isStrInt(fl_get_input(ob)))
+ return FL_VALID;
+ }
+ return FL_INVALID|FL_RINGBELL;
+}
+
+
int fl_unsigned_int_filter(FL_OBJECT * /*ob*/,
- char const * /*not_used*/,
- char const * /*unused*/,
- int c)
+ char const *, char const *, int c)
{
if (c == 0 /* final test before handing contents to app */
|| strchr("0123456789", c)) {
}
+int fl_float_filter(FL_OBJECT * ob,
+ char const *, char const *, int c)
+{
+ if (c == 0 /* final test before handing contents to app */
+ || strchr("0123456789.+-", c)) {
+ if (isStrDbl(fl_get_input(ob)))
+ return FL_VALID;
+ }
+ return FL_INVALID|FL_RINGBELL;
+}
+
+
int fl_unsigned_float_filter(FL_OBJECT * ob,
char const * /*not_used*/,
char const * /*unused*/,
|| strchr("0123456789.", c)) {
if (isStrDbl(fl_get_input(ob)))
return FL_VALID;
- else
- return FL_INVALID|FL_RINGBELL;
}
return FL_INVALID|FL_RINGBELL;
}
piece = strip(piece) ;
piece = frontStrip(piece) ;
if (!stringOnlyContains (piece, "0123456789-")) {
- WriteAlert(_("ERROR! Unable to print!"),
+ Alert::alert(_("ERROR! Unable to print!"),
_("Check 'range of pages'!"));
return;
}