Esp32-RBGridUI
Library for creating UIs for the RBController app
Loading...
Searching...
No Matches
builder
joystick.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "../widgets/joystick.h"
4
#include "
widget.h
"
5
6
namespace
gridui
{
7
namespace
builder {
8
11
class
Joystick
:
public
Widget
,
public
BuilderMixin
<Joystick, gridui::Joystick> {
12
static
const
char
* name() {
return
"Joystick"
; }
13
14
friend
class
gridui::_GridUi
;
15
using
Widget::Widget
;
16
17
public
:
18
Joystick
&
color
(
const
std::string&
color
) {
19
extra
().set(
"color"
,
color
);
20
return
*
this
;
21
}
22
23
Joystick
&
keys
(
const
std::string&
keys
) {
24
extra
().set(
"keys"
,
keys
);
25
return
*
this
;
26
}
27
28
Joystick
&
text
(
const
std::string&
text
) {
29
extra
().set(
"text"
,
text
);
30
return
*
this
;
31
}
32
33
Joystick
&
keys
(
char
forward,
char
left,
char
backwards,
char
right,
char
click = 0) {
34
const
char
keys
[6] = { forward, left, backwards, right, click, 0 };
35
extra
().set(
"keys"
,
keys
);
36
return
*
this
;
37
}
38
41
Joystick
&
onClick
(
callback_t
cb) {
42
addCallback
(
"click"
, cb);
43
return
*
this
;
44
}
45
48
Joystick
&
onPositionChanged
(
callback_t
cb) {
49
addCallback
(
"pos"
, cb);
50
return
*
this
;
51
}
52
};
53
54
};
55
};
gridui::Widget::Widget
Widget()
Definition
widget.h:180
gridui::_GridUi
Definition
gridui.h:42
gridui::builder::BuilderMixin
Definition
widget.h:33
gridui::builder::BuilderMixin< Joystick, gridui::Joystick >::callback_t
std::function< void(gridui::Joystick &)> callback_t
Definition
widget.h:41
gridui::builder::BuilderMixin< Joystick, gridui::Joystick >::addCallback
void addCallback(const std::string &name, const callback_t &cb)
Definition
widget.h:54
gridui::builder::Joystick
Definition
joystick.h:11
gridui::builder::Joystick::color
Joystick & color(const std::string &color)
Definition
joystick.h:18
gridui::builder::Joystick::keys
Joystick & keys(const std::string &keys)
Definition
joystick.h:23
gridui::builder::Joystick::text
Joystick & text(const std::string &text)
Definition
joystick.h:28
gridui::builder::Joystick::keys
Joystick & keys(char forward, char left, char backwards, char right, char click=0)
Definition
joystick.h:33
gridui::builder::Widget
Definition
widget.h:74
gridui::builder::Widget::extra
rbjson::Object & extra()
Definition
widget.cpp:16
gridui::builder::Joystick::onPositionChanged
Joystick & onPositionChanged(callback_t cb)
Definition
joystick.h:48
gridui::builder::Joystick::onClick
Joystick & onClick(callback_t cb)
Definition
joystick.h:41
gridui
Definition
arm.h:8
widget.h
Generated on Mon Dec 2 2024 21:33:19 for Esp32-RBGridUI by
1.9.8