92 , _stepValue(stepValue)
103 IntField::IntField(
Form &form,
const String &label,
int minValue,
int maxValue,
int stepValue,
int value,
const String &suffix)
105 , _minValue(minValue)
106 , _maxValue(maxValue)
107 , _stepValue(stepValue)
116 if (event == LCD_BUTTON_UP) {
119 }
else if (event == LCD_BUTTON_DOWN) {
200 if (value < _minValue)
202 else if (value > _maxValue)
204 if (value != _value) {
238 void IntField::printValue()
241 if (_suffix.length())
243 lcd()->setCursor(0, 1);
245 unsigned int len = str.length();
246 while (len++ < _printLen)
248 _printLen = str.length();
Manages a single data input/output field within a Form.
virtual void enterField(bool reverse)
Enters the field due to form navigation.
void setValue(int value)
Sets the current value of this field.
int dispatch(int event)
Dispatches event via this field.
LiquidCrystal * lcd() const
Returns the LCD that this field is being drawn on.
const String & suffix() const
Returns the suffix string to be displayed after the field's value.
int value() const
Returns the current value of this field.
IntField(const String &label)
Constructs a new integer field with a specific label.
void setSuffix(const String &suffix)
Sets the suffix string to be displayed after the field's value.
bool isCurrent() const
Returns true if this field is the currently-displayed field in its owning form; false otherwise...
void enterField(bool reverse)
Enters the field due to form navigation.