ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
widget.cpp
Go to the documentation of this file.
2
4
6{
7 (void)ctx;
8 for (auto const& c : children) {
9 c->layout(ctx);
10 }
11}
12
14{
15 (void)ctx;
16 (void)e;
17 return false;
18}
19
21{
22 (void)ctx;
23 (void)focused;
24}
25
27{
28 for (auto const& c : children) {
29 if (c->visible) {
30 c->draw(ctx);
31 }
32 }
33}
Shared state for the UI system.
Definition context.h:75
virtual void on_focus_changed(Context &ctx, bool focused)
Called when focus state changes.
Definition widget.cpp:20
virtual bool on_event(Context &ctx, const UIEvent &e)
Handle a UI event.
Definition widget.cpp:13
virtual void draw(Context &ctx)
Draw this widget and its children.
Definition widget.cpp:26
std::vector< std::unique_ptr< Widget > > children
Child widgets.
Definition widget.h:72
virtual void layout(Context &ctx)
Lay out this widget and its children.
Definition widget.cpp:5
UI context and focus management for the ASW UI module.
Event structure for UI interactions.
Definition event.h:21
Base widget class for the ASW UI module.