Esp32-RBGridUI
Library for creating UIs for the RBController app
Loading...
Searching...
No Matches
widgets
switcher.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
widget.h
"
4
5
namespace
gridui
{
6
9
class
Switcher
:
public
Widget
{
10
template
<
typename
Self,
typename
Finished>
11
friend
class
builder::BuilderMixin
;
12
13
using
Widget::Widget
;
14
15
public
:
16
void
setFontSize
(
float
fontSize
) {
17
m_state
->
set
(
"fontSize"
,
new
rbjson::Number(
fontSize
));
18
}
19
20
float
fontSize
()
const
{
21
return
m_state
->
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
m_state
->
getString
(
"color"
);
30
}
31
32
int
value
()
const
{
33
return
m_state
->
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
m_state
->
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
m_state
->
getInt
(
"max"
);
50
}
51
};
52
53
};
gridui::Switcher
Definition
switcher.h:9
gridui::Switcher::setMax
void setMax(int max)
Definition
switcher.h:44
gridui::Switcher::setColor
void setColor(const std::string &color)
Definition
switcher.h:24
gridui::Switcher::min
int min() const
Definition
switcher.h:40
gridui::Switcher::color
std::string color() const
Definition
switcher.h:28
gridui::Switcher::setMin
void setMin(int min)
Definition
switcher.h:36
gridui::Switcher::setFontSize
void setFontSize(float fontSize)
Definition
switcher.h:16
gridui::Switcher::max
int max() const
Definition
switcher.h:48
gridui::Switcher::value
int value() const
Definition
switcher.h:32
gridui::Switcher::fontSize
float fontSize() const
Definition
switcher.h:20
gridui::WidgetState::set
bool set(const std::string &key, rbjson::Value *value)
Definition
widget.cpp:47
gridui::WidgetState::getString
std::string getString(const std::string &key, std::string def="") const
Definition
widget.cpp:27
gridui::WidgetState::getInt
int64_t getInt(const std::string &key, int64_t def=0) const
Definition
widget.cpp:32
gridui::WidgetState::getDouble
double getDouble(const std::string &key, double def=0.0) const
Definition
widget.cpp:37
gridui::Widget
Definition
widget.h:189
gridui::Widget::m_state
WidgetState * m_state
Definition
widget.h:275
gridui::Widget::Widget
Widget()
Definition
widget.h:191
gridui::builder::BuilderMixin
Definition
widget.h:33
gridui
Definition
arm.h:8
widget.h
Generated on Sun Jan 19 2025 14:54:25 for Esp32-RBGridUI by
1.9.8