23 #include "BoolField.h"
96 , _trueLabel(trueLabel)
97 , _falseLabel(falseLabel)
105 if (event == LCD_BUTTON_UP || event == LCD_BUTTON_DOWN) {
133 if (value != _value) {
180 void BoolField::printValue()
183 lcd()->setCursor(0, 1);
185 lcd()->print(_trueLabel);
186 len = _trueLabel.length();
187 while (len++ < _printLen)
189 _printLen = _trueLabel.length();
191 lcd()->print(_falseLabel);
192 len = _falseLabel.length();
193 while (len++ < _printLen)
195 _printLen = _falseLabel.length();
BoolField(const String &label)
Constructs a new boolean field with a specific label.
void setValue(bool value)
Sets the current value of this field to value.
const String & trueLabel() const
Returns the string that is displayed when value() is true.
Manages a single data input/output field within a Form.
virtual void enterField(bool reverse)
Enters the field due to form navigation.
void setTrueLabel(const String &trueLabel)
Sets the string that is displayed when value() is true to trueLabel.
LiquidCrystal * lcd() const
Returns the LCD that this field is being drawn on.
void setFalseLabel(const String &falseLabel)
Sets the string that is displayed when value() is false to falseLabel.
int dispatch(int event)
Dispatches event via this field.
void enterField(bool reverse)
Enters the field due to form navigation.
const String & falseLabel() const
Returns the string that is displayed when value() is false.
bool value() const
Returns the current value of this field, true or false.
bool isCurrent() const
Returns true if this field is the currently-displayed field in its owning form; false otherwise...