Esp32-RBGridUI
Library for creating UIs for the RBController app
Loading...
Searching...
No Matches
checkbox.h
Go to the documentation of this file.
1#pragma once
2
3#include "widget.h"
4
5namespace gridui {
6
9class Checkbox : 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 setChecked(bool checked) {
25 m_state->set("checked", new rbjson::Bool(checked));
26 }
27
28 bool checked() const {
29 return data().getBool("checked");
30 }
31
32 void setColor(const std::string& color) {
33 m_state->set("color", new rbjson::String(color));
34 }
35
36 std::string color() const {
37 return data().getString("color");
38 }
39
40 void setText(const std::string& text) {
41 m_state->set("text", new rbjson::String(text));
42 }
43
44 std::string text() const {
45 return data().getString("text");
46 }
47};
48
49};
void setFontSize(float fontSize)
Definition checkbox.h:16
void setColor(const std::string &color)
Definition checkbox.h:32
std::string color() const
Definition checkbox.h:36
void setChecked(bool checked)
Definition checkbox.h:24
float fontSize() const
Definition checkbox.h:20
void setText(const std::string &text)
Definition checkbox.h:40
bool checked() const
Definition checkbox.h:28
std::string text() const
Definition checkbox.h:44
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