ItemBool

Functions

inline ItemBool<bool> *ITEM_BOOL(const char *text, const bool value, const char *textOn, const char *textOff, void (*callback)(const bool), const char *format = "%s", const uint8_t cursorOffset = 0)

Create a new item that toggles a boolean value.

This item allows the user to toggle between two states (true/false).

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

  • value – the initial boolean value

  • textOn – the text to display when the value is true

  • textOff – the text to display when the value is false

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

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

  • cursorOffset – the offset for the cursor position

inline ItemBool<Ref<bool>> *ITEM_BOOL_REF(const char *text, bool &value, const char *textOn, const char *textOff, void (*callback)(const Ref<bool>), const char *format = "%s", const uint8_t cursorOffset = 0)

Create a new item that toggles a boolean value with a reference.

This item allows the user to toggle between two states (true/false) and uses a reference to track the current value.

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

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

  • textOn – the text to display when the value is true

  • textOff – the text to display when the value is false

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

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

  • cursorOffset – the offset for the cursor position

template<typename V = bool>
class ItemBool : public ItemWidget<bool>
#include <ItemBool.h>

ItemBool class that allows a user to toggle a boolean value.

This class is a specialization of the ItemWidget class, which manages a boolean value.

Note

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

Template Parameters:

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

Public Functions

virtual ~ItemBool() = default
inline ItemBool(const char *text, V value, const char *textOn, const char *textOff, const char *format, const uint8_t cursorOffset, typename ItemWidget<V>::CallbackType callback)