8#include "label_widget.hpp"
9#include "overlay_widget.hpp"
10#include "scroll_widget.hpp"
12#include "menu_button_widget.hpp"
13#include "selection_delegate.hpp"
14#include "default_selection_delegate.hpp"
15#include "../observable.hpp"
16#include "../weak_or_unique_ptr.hpp"
63 template<
typename OptionList,
typename Value,
typename... Args>
65 requires(not std::is_convertible_v<Value, weak_or_unique_ptr<delegate_type>>) :
69 make_unique_default_selection_delegate(
70 std::forward<OptionList>(option_list),
71 std::forward<Value>(value),
72 std::forward<Args>(args)...))
77 void init() noexcept override;
78 void deinit() noexcept override;
79 [[nodiscard]]
bool constrain(utc_nanoseconds display_time_point,
bool need_reconstrain) noexcept override;
80 [[nodiscard]]
void layout(utc_nanoseconds display_time_point,
bool need_layout) noexcept override;
81 void draw(
draw_context context, utc_nanoseconds display_time_point) noexcept override;
82 bool handle_event(
mouse_event const &event) noexcept override;
83 bool handle_event(command command) noexcept override;
84 [[nodiscard]]
hitbox hitbox_test(
point2 position) const noexcept override;
85 [[nodiscard]]
bool accepts_keyboard_focus(keyboard_focus_group group) const noexcept override;
86 [[nodiscard]]
color focus_color() const noexcept override;
91 typename delegate_type::callback_ptr_type _delegate_callback;
92 typename decltype(unknown_label)::callback_ptr_type _unknown_label_callback;
103 bool _selecting = false;
104 bool _has_options = false;
116 void start_selecting() noexcept;
117 void stop_selecting() noexcept;
118 void repopulate_options() noexcept;
This is a RGBA floating point color.
Definition color.hpp:36
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:20
Draw context for drawing using the TTauri shaders.
Definition draw_context.hpp:28
Definition gui_window.hpp:39
Definition mouse_event.hpp:15
A value which can be observed for modifications.
Definition observable.hpp:464
Definition font_glyph_ids.hpp:80
Class that hold either a weak_ptr or a unique_ptr This class is to hold a weak_ptr,...
Definition weak_or_unique_ptr.hpp:25
The GUI widget displays and lays out text together with an icon.
Definition label_widget.hpp:32
A button that is part of a menu.
Definition menu_button_widget.hpp:31
A GUI widget which may exist anywhere on a window overlaid above any other widget.
Definition overlay_widget.hpp:34
A row/column widget lays out child widgets along a row or column.
Definition row_column_widget.hpp:37
The scroll widget allows a content widget to be shown in less space than is required.
Definition scroll_widget.hpp:43
Definition selection_delegate.hpp:15
A graphical control element that allows the user to choose only one of a predefined set of mutually e...
Definition selection_widget.hpp:37
selection_widget(gui_window &window, widget *parent, std::weak_ptr< delegate_type > delegate) noexcept
Construct a selection widget with a delegate.
selection_widget(gui_window &window, widget *parent, OptionList &&option_list, Value &&value, Args &&...args) noexcept
Construct a selection widget which will monitor an option list and a value.
Definition selection_widget.hpp:64
An interactive graphical object as part of the user-interface.
Definition widget.hpp:37
widget *const parent
Pointer to the parent widget.
Definition widget.hpp:46
gui_window & window
Convenient reference to the Window.
Definition widget.hpp:41
widget(gui_window &window, widget *parent) noexcept