Esp32-RBGridUI
Library for creating UIs for the RBController app
Loading...
Searching...
No Matches
arm.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdio.h>
4
5#include "../widgets/arm.h"
6#include "widget.h"
7
8namespace gridui {
9namespace builder {
10
13class Arm : public Widget, public BuilderMixin<Arm, gridui::Arm> {
14 static const char* name() { return "Arm"; }
15
16 friend class gridui::_GridUi;
17 using Widget::Widget;
18
19public:
20 Arm& info(std::unique_ptr<rbjson::Object> armInfo) {
21 extra().set("info", armInfo.release());
22 return *this;
23 }
24
26 addCallback("pos", cb);
27 return *this;
28 }
29
31 addCallback("grab", cb);
32 return *this;
33 }
34};
35
36};
37};
Arm & onPositionChanged(callback_t cb)
Definition arm.h:25
Arm & info(std::unique_ptr< rbjson::Object > armInfo)
Definition arm.h:20
Arm & onGrab(callback_t cb)
Definition arm.h:30
std::function< void(gridui::Arm &)> callback_t
Definition widget.h:41
void addCallback(const std::string &name, const callback_t &cb)
Definition widget.h:54
rbjson::Object & extra()
Definition widget.cpp:16
Definition arm.h:8