Inherited by IntInput.
Public Types | |
enum | { FLOAT, INT } |
Public Member Functions | |
FloatInput (int x, int y, int w, int h, const char *l=0) | |
long | lvalue () const |
int | ivalue () const |
double | fvalue () const |
You may want a ValueInput widget instead. It has up/down buttons (what is called a "Spinner" in some toolkits).
If you change when() to WHEN_ENTER_KEY the callback is only done when the user hits the up/down arrow keys or when the user types the Enter key. This may be more useful than the default setting of WHEN_CHANGED which can make the callback happen when partially-edited numbers are in the field.
The type() can either be either FloatInput::FLOAT or FloatInput::INT. Setting it to INT makes this act like the IntInput subclass.
|
Convert the string to a double using strtod() |
|
Convert the string to a long using strtol() |