gigawidgets 0.3.55
A wxWidgets-style UI library for the Arduino Giga Display Shield.
 
Loading...
Searching...
No Matches
ui.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "ui/blink.hpp"
5#include "ui/body.hpp"
6#include "ui/collection.hpp"
7#include "ui/column.hpp"
8#include "ui/core/display.hpp"
9#include "ui/core/units.hpp"
10#include "ui/image.hpp"
11#include "ui/input.hpp"
12#include "ui/keyboard.hpp"
13#include "ui/panel.hpp"
14#include "ui/row.hpp"
15#include "ui/text.hpp"
16
17#include <functional>
18
19#ifndef UI_RENDER_FREQUENCY
20// Refresh at most every 50ms
21#define UI_RENDER_FREQUENCY 50
22#endif
23
24namespace ui {
25
30typedef std::function<void()> callback_t;
31
36void setRoot(Widget *const root);
37
42void render(bool block = true);
43
44#ifdef DEBUG
50void showBoundingBoxes(bool enable);
51#endif
52
64
75void setTimeout(callback_t callback, time_t timeout);
76
77} // namespace ui
The common interface for all UI objects.
Definition widget.hpp:27
uint32_t id_t
A (typically unique) identifier for widgets.
Definition id.hpp:13
void setRoot(Widget *const root)
Set the root widget for the UI to render.
void showBoundingBoxes(bool enable)
Toggle whether bounding boxes are displayed for all widgets.
void setTimeout(callback_t callback, time_t timeout)
Schedule a function to run after a delay.
std::function< void()> callback_t
A callback function that takes no arguments and returns nothing.
Definition ui.hpp:30
void render(bool block=true)
Update all UI elements and re-render any areas that need it.
Widget * getWidgetById(id_t id) noexcept
Get the first widget (root or any children) that has the given ID.