BaseWidgetValue
-
template<typename T>
class BaseWidgetValue : public BaseWidget - #include <BaseWidgetValue.h>
Base class for widget holding some value.
See also
- Template Parameters:
T – The type of value this widget holds
Subclassed by WidgetList< T >, WidgetRange< T >
Public Functions
-
inline BaseWidgetValue(const T &value, const char *format, const uint8_t cursorOffset = 0, void (*callback)(const T&) = nullptr)
-
inline const T &getValue() const
Retrieve current value.
-
inline virtual void setValue(const T &newValue)
Sets the value.
Note
You need to call
LcdMenu::refresh
after this method to see the changes.- Parameters:
newValue – The value to set.
Protected Functions
-
inline virtual uint8_t draw(char *buffer, const uint8_t start) override
Draw the widget into specified buffer.
- Parameters:
buffer – the buffer where widget will be drawn
start – the index where to start drawing in the buffer
-
virtual bool process(LcdMenu *menu, unsigned char command) override = 0
Process a command for this widget.
- Parameters:
menu – Pointer to the menu instance
command – The command to process
- Returns:
true if the command was handled, false otherwise