Esp32-RBGridUI
Library for creating UIs for the RBController app
Loading...
Searching...
No Matches
widgets
led.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
widget.h
"
4
5
namespace
gridui
{
6
9
class
Led
:
public
Widget
{
10
template
<
typename
Self,
typename
Finished>
11
friend
class
builder::BuilderMixin
;
12
13
using
Widget::Widget
;
14
15
public
:
16
void
setColor
(
const
std::string&
color
) {
17
m_state
->
set
(
"color"
,
new
rbjson::String(
color
));
18
}
19
20
std::string
color
()
const
{
21
return
data
().getString(
"color"
);
22
}
23
24
void
setOn
(
bool
on
) {
25
m_state
->
set
(
"on"
,
new
rbjson::Bool(
on
));
26
}
27
28
bool
on
()
const
{
29
return
data
().getBool(
"on"
);
30
}
31
};
32
33
};
gridui::Led
Definition
led.h:9
gridui::Led::setOn
void setOn(bool on)
Definition
led.h:24
gridui::Led::on
bool on() const
Definition
led.h:28
gridui::Led::setColor
void setColor(const std::string &color)
Definition
led.h:16
gridui::Led::color
std::string color() const
Definition
led.h:20
gridui::WidgetState::set
bool set(const std::string &key, rbjson::Value *value)
Definition
widget.cpp:27
gridui::Widget
Definition
widget.h:178
gridui::Widget::m_state
WidgetState * m_state
Definition
widget.h:265
gridui::Widget::Widget
Widget()
Definition
widget.h:180
gridui::Widget::data
const rbjson::Object & data() const
Definition
widget.h:263
gridui::builder::BuilderMixin
Definition
widget.h:33
gridui
Definition
arm.h:8
widget.h
Generated on Tue Jul 9 2024 10:04:33 for Esp32-RBGridUI by
1.9.8