Manages focus navigation for UI widgets.
More...
#include <context.h>
Manages focus navigation for UI widgets.
Definition at line 21 of file context.h.
◆ dfs()
| void asw::ui::FocusManager::dfs |
( |
Widget & | w | ) |
|
|
private |
◆ focus_dir()
| void asw::ui::FocusManager::focus_dir |
( |
Context & | ctx, |
|
|
int | dx, |
|
|
int | dy ) |
Move focus in a direction based on widget positions.
- Parameters
-
| ctx | The UI context. |
| dx | Horizontal direction (-1, 0, or 1). |
| dy | Vertical direction (-1, 0, or 1). |
Definition at line 82 of file context.cpp.
◆ focus_next()
| void asw::ui::FocusManager::focus_next |
( |
Context & | ctx | ) |
|
Move focus to the next focusable widget.
- Parameters
-
Definition at line 36 of file context.cpp.
◆ focus_prev()
| void asw::ui::FocusManager::focus_prev |
( |
Context & | ctx | ) |
|
Move focus to the previous focusable widget.
- Parameters
-
Definition at line 58 of file context.cpp.
◆ focused()
| Widget * asw::ui::FocusManager::focused |
( |
| ) |
const |
|
inline |
Get the currently focused widget.
- Returns
- Pointer to the focused widget, or nullptr.
Definition at line 34 of file context.h.
◆ rebuild()
| void asw::ui::FocusManager::rebuild |
( |
Context & | ctx, |
|
|
Widget & | root ) |
Rebuild the focusable widget list from the widget tree.
- Parameters
-
| ctx | The UI context. |
| root | The root widget to traverse. |
Definition at line 6 of file context.cpp.
◆ set_focus()
| void asw::ui::FocusManager::set_focus |
( |
Context & | ctx, |
|
|
Widget * | w ) |
Set focus to a specific widget.
- Parameters
-
| ctx | The UI context. |
| w | The widget to focus. |
Definition at line 22 of file context.cpp.
◆ focusables_
| std::vector<Widget*> asw::ui::FocusManager::focusables_ |
|
private |
◆ focused_
| Widget* asw::ui::FocusManager::focused_ = nullptr |
|
private |
The documentation for this class was generated from the following files: