7#include "abstract_button_widget.hpp"
8#include "default_button_delegate.hpp"
10namespace hi::inline v1 {
43 template<
typename Label>
60 template<
typename Label,
typename Value,
typename... Args>
62 requires(not std::is_convertible_v<Value, weak_or_unique_ptr<delegate_type>>) :
67 make_unique_default_button_delegate<
button_type::
radio>(
std::forward<Value>(value),
std::forward<Args>(args)...))
73 void set_layout(
widget_layout const &layout) noexcept override;
74 void draw(
draw_context const &context) noexcept override;
75 [[nodiscard]]
bool accepts_keyboard_focus(keyboard_focus_group group) const noexcept override;
76 [[nodiscard]]
bool handle_event(command command) noexcept override;
86 template<typename Label>
88 super(window, parent,
std::move(delegate))
90 label_alignment = alignment::middle_left();
91 set_label(std::forward<Label>(
label));
94 void draw_menu_button(draw_context
const &context)
noexcept;
95 void draw_check_mark(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 HikoGUI shaders.
Definition draw_context.hpp:51
Definition gui_window.hpp:40
A label consisting of localizable text and an icon.
Definition label.hpp:27
A set of glyph-ids of a font which composites into a single glyph.
Definition glyph_ids.hpp:127
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 button that is part of a menu.
Definition menu_button_widget.hpp:31
menu_button_widget(gui_window &window, widget *parent, Label &&label, std::weak_ptr< delegate_type > delegate) noexcept
Construct a menu button widget.
Definition menu_button_widget.hpp:44
menu_button_widget(gui_window &window, widget *parent, Label &&label, Value &&value, Args &&...args) noexcept
Construct a menu button widget with a default button delegate.
Definition menu_button_widget.hpp:61
An interactive graphical object as part of the user-interface.
Definition widget.hpp:40
Definition widget_constraints.hpp:12
Definition widget_layout.hpp:17