23 #include "ListField.h"
89 if (event == LCD_BUTTON_DOWN) {
90 if (_value >= (_itemCount - 1))
95 }
else if (event == LCD_BUTTON_UP) {
147 ListItem item = (ListItem)pgm_read_word(items);
154 if (_value >= _itemCount)
155 _value = _itemCount - 1;
180 if (_value != value) {
184 if (_value >= _itemCount)
185 _value = _itemCount - 1;
191 void ListField::printValue()
193 lcd()->setCursor(0, 1);
196 ListItem str = (ListItem)pgm_read_word(&(_items[_value]));
198 while ((ch = pgm_read_byte(str)) != 0) {
204 while (_printLen-- > len)
ListField(const String &label)
Constructs a new list field with a specific label.
Manages a single data input/output field within a Form.
int value() const
Returns the value of this list; i.e. the index within items() of the selected item.
virtual void enterField(bool reverse)
Enters the field due to form navigation.
void setItems(ListItems items)
Sets the array of items for this list.
LiquidCrystal * lcd() const
Returns the LCD that this field is being drawn on.
ListItems items() const
Returns the array of items in this list.
void enterField(bool reverse)
Enters the field due to form navigation.
void setValue(int value)
Sets the value of this list; i.e. the index within items() of the selected item.
int dispatch(int event)
Dispatches event via this field.
bool isCurrent() const
Returns true if this field is the currently-displayed field in its owning form; false otherwise...