6#include "widget_layout.hpp"
7#include "widget_id.hpp"
8#include "keyboard_focus_group.hpp"
9#include "../layout/module.hpp"
10#include "../GFX/GFX.hpp"
11#include "../telemetry/telemetry.hpp"
12#include "../macros.hpp"
14namespace hi {
inline namespace v1 {
162 keyboard_focus_group group,
163 keyboard_focus_direction direction)
const noexcept = 0;
165 [[
nodiscard]]
virtual widget_id find_first_widget(keyboard_focus_group group)
const noexcept = 0;
167 [[
nodiscard]]
virtual widget_id find_last_widget(keyboard_focus_group group)
const noexcept = 0;
178 while (to_bool(w = w->parent)) {
179 chain.push_back(w->id);
204 hi_assert_not_null(start);
206 if (start->id ==
id) {
222 throw not_found_error(
"get widget by id");
@ rectangle
The gui_event has rectangle data.
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
Class which represents an axis-aligned rectangle.
Definition aarectangle.hpp:29
A rectangle / parallelogram in 3D space.
Definition rectangle.hpp:21
Draw context for drawing using the HikoGUI shaders.
Definition draw_context.hpp:208
A user interface event.
Definition gui_event.hpp:75
Definition widget_intf.hpp:17
virtual gui_window * window() const noexcept=0
Get the window that the widget is owned by.
std::vector< widget_id > parent_chain() const noexcept
Get a list of parents of a given widget.
Definition widget_intf.hpp:172
virtual bool handle_event_recursive(gui_event const &event, std::vector< widget_id > const &reject_list=std::vector< widget_id >{}) noexcept=0
Handle command recursive.
widget_id id
The numeric identifier of a widget.
Definition widget_intf.hpp:23
virtual void request_redraw() const noexcept=0
Request the widget to be redrawn on the next frame.
void scroll_to_show() noexcept
Scroll to show the important part of the widget.
Definition widget_intf.hpp:196
widget_intf * parent
Pointer to the parent widget.
Definition widget_intf.hpp:28
virtual bool process_event(gui_event const &event) const noexcept=0
Send a event to the window.
virtual bool accepts_keyboard_focus(keyboard_focus_group group) const noexcept=0
Check if the widget will accept keyboard focus.
virtual box_constraints update_constraints() noexcept=0
Update the constraints of the widget.
virtual widget_id find_next_widget(widget_id current_keyboard_widget, keyboard_focus_group group, keyboard_focus_direction direction) const noexcept=0
Find the next widget that handles keyboard focus.
virtual void set_layout(widget_layout const &context) noexcept=0
Update the internal layout of the widget.
virtual void scroll_to_show(hi::aarectangle rectangle) noexcept=0
Scroll to show the given rectangle on the window.
virtual bool handle_event(gui_event const &event) noexcept=0
Handle command.
virtual hitbox hitbox_test(point2 position) const noexcept=0
Find the widget that is under the mouse cursor.
virtual widget_layout const & layout() const noexcept=0
Get the current layout for this widget.
virtual generator< widget_intf & > children(bool include_invisible) noexcept=0
Get a list of child widgets.
virtual void draw(draw_context const &context) noexcept=0
Draw the widget.
virtual void set_window(gui_window *window) noexcept=0
Set the window for this tree of widgets.
The layout of a widget.
Definition widget_layout.hpp:38
2D constraints.
Definition box_constraints.hpp:25