ItemRange

Functions

template<typename T>
inline ItemRange<T, T> *ITEM_RANGE(const char *text, const T value, const T step, const T min, const T max, void (*callback)(const T), const char *format = "%s", const uint8_t cursorOffset = 0, const bool cycle = false)

Create a new item that displays a range of values.

This item allows the user to select a value from a range of options.

Template Parameters:

T – the type of the values in the range

Parameters:
  • text – the text to display for the item

  • value – the initial value to display

  • step – the step size for incrementing/decrementing the value (use negative value to invert the range)

  • min – the minimum value in the range

  • max – the maximum value in the range

  • callback – the callback function to call when the value changes

  • format – the format string to use when displaying the values

  • cursorOffset – the offset for the cursor position

  • cycle – whether to cycle through the range when reaching the end

template<typename T>
inline ItemRange<T, Ref<T>> *ITEM_RANGE_REF(const char *text, T &value, const T step, const T min, const T max, void (*callback)(const Ref<T>), const char *format = "%s", const uint8_t cursorOffset = 0, const bool cycle = false)

Create a new item that displays a range of values.

This item allows the user to select a value from a range of options.

Template Parameters:

T – the type of the values in the range

Parameters:
  • text – the text to display for the item

  • value – the reference value to display (this value is passed by reference, so it can be updated externally)

  • step – the step size for incrementing/decrementing the value (use negative value to invert the range)

  • min – the minimum value in the range

  • max – the maximum value in the range

  • callback – the callback function to call when the value changes

  • format – the format string to use when displaying the values

  • cursorOffset – the offset for the cursor position

  • cycle – whether to cycle through the range when reaching the end

template<typename T, typename V = T>
class ItemRange : public ItemWidget<T>
#include <ItemRange.h>

ItemRange class that allows a user to select a value from a range.

This class is a specialization of the ItemWidget class, which manages a value within a specified range.

Note

This is just a wrapper around the ItemWidget class. The same functionality can be achieved by using the ItemWidget class directly with a WidgetRange as the widget.

Template Parameters:
  • T – the type of the values in the list

  • V – the type of the stored value, which should be fully compatible with T

Public Functions

virtual ~ItemRange() = default
inline ItemRange(const char *text, const V value, const T step, const T min, const T max, const char *format, const uint8_t cursorOffset, const bool cycle, typename ItemWidget<V>::CallbackType callback)