Esp32-RBGridUI
Library for creating UIs for the RBController app
Loading...
Searching...
No Matches
input.h
Go to the documentation of this file.
1#pragma once
2
3#include "widget.h"
4
5namespace gridui {
6
9class Input : public Widget {
10 template <typename Self, typename Finished>
12
13 using Widget::Widget;
14
15public:
16 void setText(const std::string& text) {
17 m_state->set("text", new rbjson::String(text));
18 }
19
20 std::string text() const {
21 return data().getString("text");
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 void setType(const std::string& type) {
33 m_state->set("type", new rbjson::String(type));
34 }
35
36 std::string type() const {
37 return data().getString("type");
38 }
39
40 void setDisabled(bool disabled) {
41 m_state->set("disabled", new rbjson::Bool(disabled));
42 }
43
44 bool disabled() const {
45 return data().getBool("disabled");
46 }
47};
48
49};
std::string color() const
Definition input.h:28
void setType(const std::string &type)
Definition input.h:32
bool disabled() const
Definition input.h:44
std::string text() const
Definition input.h:20
void setDisabled(bool disabled)
Definition input.h:40
void setColor(const std::string &color)
Definition input.h:24
void setText(const std::string &text)
Definition input.h:16
std::string type() const
Definition input.h:36
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