7#include "abstract_button_widget.hpp"
8#include "default_button_delegate.hpp"
42 using callback_ptr_type =
typename delegate_type::callback_ptr_type;
61 template<
typename Value,
typename... Args>
63 requires(not std::is_convertible_v<Value, weak_or_unique_ptr<delegate_type>>) :
67 make_unique_default_button_delegate<
button_type::
toggle>(
std::forward<Value>(value),
std::forward<Args>(args)...))
72 [[nodiscard]]
bool constrain(utc_nanoseconds display_time_point,
bool need_reconstrain)
noexcept override;
73 [[nodiscard]]
void layout(utc_nanoseconds displayTimePoint,
bool need_layout)
noexcept override;
74 void draw(
draw_context context, utc_nanoseconds display_time_point)
noexcept override;
86 void draw_check_box(
draw_context const &context)
noexcept;
button_type
The type of button.
Definition button_type.hpp:13
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 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
Definition abstract_button_widget.hpp:23
Definition button_delegate.hpp:14
A GUI widget that permits the user to make a binary choice.
Definition checkbox_widget.hpp:38
checkbox_widget(gui_window &window, widget *parent, Value &&value, Args &&...args) noexcept
Construct a checkbox widget with a default button delegate.
Definition checkbox_widget.hpp:62
checkbox_widget(gui_window &window, widget *parent, std::weak_ptr< delegate_type > delegate) noexcept
Construct a checkbox widget.
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