Esp32-RBGridUI
Library for creating UIs for the RBController app
Loading...
Searching...
No Matches
switcher.h
Go to the documentation of this file.
1#pragma once
2
3#include "widget.h"
4
5namespace gridui {
6
9class Switcher : public Widget {
10 template <typename Self, typename Finished>
12
13 using Widget::Widget;
14
15public:
16 void setFontSize(float fontSize) {
17 m_state->set("fontSize", new rbjson::Number(fontSize));
18 }
19
20 float fontSize() const {
21 return data().getDouble("fontSize");
22 }
23
24 void setColor(const std::string& color) {
25 m_state->set("color", new rbjson::String(color));
26 }
27
28 std::string color() const {
29 return data().getString("color");
30 }
31
32 int value() const {
33 return data().getInt("value");
34 }
35
36 void setMin(int min) {
37 m_state->set("min", new rbjson::Number(min));
38 }
39
40 int min() const {
41 return data().getInt("min");
42 }
43
44 void setMax(int max) {
45 m_state->set("max", new rbjson::Number(max));
46 }
47
48 int max() const {
49 return data().getInt("max");
50 }
51};
52
53};
void setMax(int max)
Definition switcher.h:44
void setColor(const std::string &color)
Definition switcher.h:24
int min() const
Definition switcher.h:40
std::string color() const
Definition switcher.h:28
void setMin(int min)
Definition switcher.h:36
void setFontSize(float fontSize)
Definition switcher.h:16
int max() const
Definition switcher.h:48
int value() const
Definition switcher.h:32
float fontSize() const
Definition switcher.h:20
bool set(const std::string &key, rbjson::Value *value)
Definition widget.cpp:25
WidgetState * m_state
Definition widget.h:214
const rbjson::Object & data() const
Definition widget.h:212
Definition arm.h:8