LCDGFX LCD display driver  1.2.0
Lightweight graphics library for SSD1306, SSD1325, SSD1327, SSD1331, SSD1351, SH1106, SH1107, IL9163, ST7735, ST7789, ILI9341, PCD8544 displays over I2C/SPI

Class implements an integer spinbox widget for lcdgfx library. More...

#include <spinbox.h>

Public Member Functions

 LcdGfxSpinbox (const NanoRect &rect, int16_t minValue, int16_t maxValue, int16_t value, int16_t step=1, bool wrap=false)
 Creates a spinbox widget. More...
 
template<typename D >
void show (D &d)
 Renders the spinbox on the display: a border with a centered numeric value and "<" ">" arrows on the sides.
 
void up ()
 Increments the value (wraps or clamps depending on configuration).
 
void down ()
 Decrements the value (wraps or clamps depending on configuration).
 
void setValue (int16_t value)
 Sets the current value, clamped into [min, max].
 
int16_t value () const
 Returns the current value.
 
int16_t minValue () const
 
int16_t maxValue () const
 
bool wraps () const
 
const NanoRectgetRect () const
 

Detailed Description

Class implements an integer spinbox widget for lcdgfx library.

Up/down keys change the value by a configurable step. Optional wrap mode causes overflow above the max to roll over to the min and vice-versa. Otherwise the value is clamped at the bounds.

Definition at line 49 of file spinbox.h.

Constructor & Destructor Documentation

◆ LcdGfxSpinbox()

LcdGfxSpinbox::LcdGfxSpinbox ( const NanoRect rect,
int16_t  minValue,
int16_t  maxValue,
int16_t  value,
int16_t  step = 1,
bool  wrap = false 
)

Creates a spinbox widget.

Parameters
rectscreen area for the spinbox
minValueminimum value (inclusive)
maxValuemaximum value (inclusive)
valueinitial value (clamped into [min, max])
stepincrement / decrement size (must be >= 1)
wrapif true, up/down wrap around the bounds; otherwise they clamp

The documentation for this class was generated from the following file: