7#include "abstract_button_widget.hpp"
8#include "default_button_delegate.hpp"
46 using callback_ptr_type =
typename delegate_type::callback_ptr_type;
55 template<
typename Label>
72 template<
typename Label,
typename Value,
typename... Args>
74 requires(not std::is_convertible_v<Value, weak_or_unique_ptr<delegate_type>>) :
79 make_unique_default_button_delegate<
button_type::
radio>(
std::forward<Value>(value),
std::forward<Args>(args)...))
87 void request_redraw() const noexcept override;
88 [[nodiscard]]
bool accepts_keyboard_focus(keyboard_focus_group group) const noexcept override;
89 [[nodiscard]]
bool handle_event(command command) noexcept override;
92 template<typename Label>
104 void draw_toolbar_tab_focus_line(draw_context context)
noexcept;
105 void draw_toolbar_tab_button(draw_context context)
noexcept;
button_type
The type of button.
Definition button_type.hpp:13
Draw context for drawing using the TTauri shaders.
Definition draw_context.hpp:29
Definition gui_window.hpp:36
A label consisting of localizable text and an icon.
Definition label.hpp:27
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
void set_label(Label const &rhs) noexcept
Set on/off/other labels of the button to the same value.
Definition abstract_button_widget.hpp:48
observable< alignment > label_alignment
The alignment of the on/off/other label.
Definition abstract_button_widget.hpp:43
Definition button_delegate.hpp:14
A graphical control element that allows the user to choose only one of a predefined set of mutually e...
Definition toolbar_tab_button_widget.hpp:42
toolbar_tab_button_widget(gui_window &window, widget *parent, Label &&label, Value &&value, Args &&...args) noexcept
Construct a toolbar tab button widget with a default button delegate.
Definition toolbar_tab_button_widget.hpp:73
toolbar_tab_button_widget(gui_window &window, widget *parent, Label &&label, std::weak_ptr< delegate_type > delegate) noexcept
Construct a toolbar tab button widget.
Definition toolbar_tab_button_widget.hpp:56
An interactive graphical object as part of the user-interface.
Definition widget.hpp:39
widget *const parent
Pointer to the parent widget.
Definition widget.hpp:48
gui_window & window
Convenient reference to the Window.
Definition widget.hpp:43