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
LcdGfxSlider Class Reference

Class implements a value slider widget for lcdgfx library. More...

#include <slider.h>

Public Member Functions

 LcdGfxSlider (const NanoRect &rect, int16_t minValue, int16_t maxValue, int16_t value, int16_t step=1, LcdGfxSliderOrientation orientation=LcdGfxSliderOrientation::Horizontal)
 Creates a slider widget. More...
 
template<typename D >
void show (D &d)
 Renders the slider on the display. More...
 
void up ()
 Increments value by one step (clamped to max).
 
void down ()
 Decrements value by one step (clamped to min).
 
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
 Returns the configured minimum.
 
int16_t maxValue () const
 Returns the configured maximum.
 
const NanoRectgetRect () const
 Returns the rectangle area used by the slider.
 

Detailed Description

Class implements a value slider widget for lcdgfx library.

Renders a track with a knob that represents the current value within [min, max]. Works with monochrome and color displays - drawing uses only the generic NanoDisplayOps API.

Definition at line 56 of file slider.h.

Constructor & Destructor Documentation

◆ LcdGfxSlider()

LcdGfxSlider::LcdGfxSlider ( const NanoRect rect,
int16_t  minValue,
int16_t  maxValue,
int16_t  value,
int16_t  step = 1,
LcdGfxSliderOrientation  orientation = LcdGfxSliderOrientation::Horizontal 
)

Creates a slider widget.

Parameters
rectscreen area for the slider
minValueminimum value (inclusive)
maxValuemaximum value (inclusive)
valueinitial value (clamped into [min, max])
stepincrement / decrement size for up()/down() (must be >= 1)
orientationHorizontal or Vertical

Member Function Documentation

◆ show()

template<typename D >
void LcdGfxSlider::show ( D &  d)
inline

Renders the slider on the display.

Parameters
ddisplay object (any NanoDisplayOps-derived type)

Definition at line 77 of file slider.h.


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