Esp32-RBGridUI
Library for creating UIs for the RBController app
Loading...
Searching...
No Matches
widgets
button.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
widget.h
"
4
5
namespace
gridui
{
6
9
class
Button
:
public
Widget
{
10
template
<
typename
Self,
typename
Finished>
11
friend
class
builder::BuilderMixin
;
12
13
using
Widget::Widget
;
14
15
public
:
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
m_state
->
getString
(
"text"
);
22
}
23
24
void
setFontSize
(
float
fontSize
) {
25
m_state
->
set
(
"fontSize"
,
new
rbjson::Number(
fontSize
));
26
}
27
28
float
fontSize
()
const
{
29
return
m_state
->
getDouble
(
"fontSize"
);
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
m_state
->
getString
(
"color"
);
38
}
39
40
void
setBackground
(
const
std::string&
background
) {
41
m_state
->
set
(
"background"
,
new
rbjson::String(
background
));
42
}
43
44
std::string
background
()
const
{
45
return
m_state
->
getString
(
"background"
);
46
}
47
48
void
setAlign
(
const
std::string&
align
) {
49
m_state
->
set
(
"align"
,
new
rbjson::String(
align
));
50
}
51
52
std::string
align
()
const
{
53
return
m_state
->
getString
(
"align"
);
54
}
55
56
void
setValign
(
const
std::string&
valign
) {
57
m_state
->
set
(
"valign"
,
new
rbjson::String(
valign
));
58
}
59
60
std::string
valign
()
const
{
61
return
m_state
->
getString
(
"valign"
);
62
}
63
64
void
setNumber
(
float
number) {
65
rbjson::Number n(number);
66
setText
(n.str());
67
}
68
69
bool
pressed
()
const
{
70
return
m_state
->
getBool
(
"pressed"
);
71
}
72
73
void
setDisabled
(
bool
disabled
) {
74
m_state
->
set
(
"disabled"
,
new
rbjson::Bool(
disabled
));
75
}
76
77
bool
disabled
()
const
{
78
return
m_state
->
getBool
(
"disabled"
);
79
}
80
};
81
82
};
gridui::Button
Definition
button.h:9
gridui::Button::setValign
void setValign(const std::string &valign)
Definition
button.h:56
gridui::Button::setColor
void setColor(const std::string &color)
Definition
button.h:32
gridui::Button::pressed
bool pressed() const
Definition
button.h:69
gridui::Button::setBackground
void setBackground(const std::string &background)
Definition
button.h:40
gridui::Button::color
std::string color() const
Definition
button.h:36
gridui::Button::setNumber
void setNumber(float number)
Definition
button.h:64
gridui::Button::align
std::string align() const
Definition
button.h:52
gridui::Button::setText
void setText(const std::string &text)
Definition
button.h:16
gridui::Button::setAlign
void setAlign(const std::string &align)
Definition
button.h:48
gridui::Button::setDisabled
void setDisabled(bool disabled)
Definition
button.h:73
gridui::Button::setFontSize
void setFontSize(float fontSize)
Definition
button.h:24
gridui::Button::background
std::string background() const
Definition
button.h:44
gridui::Button::disabled
bool disabled() const
Definition
button.h:77
gridui::Button::text
std::string text() const
Definition
button.h:20
gridui::Button::valign
std::string valign() const
Definition
button.h:60
gridui::Button::fontSize
float fontSize() const
Definition
button.h:28
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::getBool
bool getBool(const std::string &key, bool def=false) const
Definition
widget.cpp:42
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:24 for Esp32-RBGridUI by
1.9.8