22namespace hi {
inline namespace v1 {
24template<
typename Context>
76 observer<semantic_text_style>
text_style = semantic_text_style::label;
80 observer<alignment>
alignment = alignment::middle_flush();
113 [[nodiscard]] generator<widget *> children() const noexcept override;
116 void draw(draw_context const& context) noexcept override;
117 bool handle_event(
gui_event const& event) noexcept override;
118 hitbox hitbox_test(point3 position) const noexcept override;
119 [[nodiscard]]
bool accepts_keyboard_focus(keyboard_focus_group group) const noexcept override;
120 [[nodiscard]] color focus_color() const noexcept override;
123 notifier<>::callback_token _delegate_cbt;
135 observer<gstring> _text;
139 aarectangle _box_rectangle;
143 aarectangle _text_rectangle;
148 observer<label> _error_label;
149 aarectangle _error_label_rectangle;
153 typename decltype(
continues)::callback_token _continues_cbt;
154 typename decltype(
text_style)::callback_token _text_style_cbt;
155 typename decltype(_text)::callback_token _text_cbt;
156 typename decltype(_error_label)::callback_token _error_label_cbt;
158 void set_attributes() noexcept {}
159 void set_attributes(text_field_widget_attribute
auto&& first, text_field_widget_attribute
auto&&...rest)
noexcept
161 if constexpr (forward_of<
decltype(first), observer<hi::alignment>>) {
163 }
else if constexpr (forward_of<
decltype(first), observer<hi::semantic_text_style>>) {
166 hi_static_no_default();
172 void revert(
bool force)
noexcept;
173 void commit(
bool force)
noexcept;
174 void draw_background_box(draw_context
const& context)
const noexcept;
#define hi_forward(x)
Forward a value, based on the decltype of the value.
Definition utility.hpp:29
Functionality for labels, text and icons.
Defines delegate_field_delegate and some default text field delegates.
std::shared_ptr< text_field_delegate > make_default_text_field_delegate(auto &&value) noexcept
Create a shared pointer to a default text delegate.
Definition text_field_delegate.hpp:197
DOXYGEN BUG.
Definition algorithm.hpp:15
The HikoGUI namespace.
Definition ascii.hpp:19
A user interface event.
Definition gui_event.hpp:66
The GUI widget displays and lays out text together with an icon.
Definition label_widget.hpp:41
The scroll widget allows a content widget to be shown in less space than is required.
Definition scroll_widget.hpp:48
A delegate that controls the state of a text_field_widget.
Definition text_field_delegate.hpp:25
A single line text field.
Definition text_field_widget.hpp:62
observer< alignment > alignment
The alignment of the text.
Definition text_field_widget.hpp:80
text_field_widget(gui_window &window, widget *parent, different_from< std::shared_ptr< delegate_type > > auto &&value, text_field_widget_attribute auto &&...attributes) noexcept
Construct a text field widget.
Definition text_field_widget.hpp:103
observer< bool > continues
Continues update mode.
Definition text_field_widget.hpp:72
observer< semantic_text_style > text_style
The style of the text.
Definition text_field_widget.hpp:76
A text widget.
Definition text_widget.hpp:61
An interactive graphical object as part of the user-interface.
Definition widget.hpp:44
widget_layout const & layout() const noexcept
Get the current layout for this widget.
Definition widget.hpp:198
widget *const parent
Pointer to the parent widget.
Definition widget.hpp:53
widget(gui_window &window, widget *parent) noexcept
gui_window & window
Convenient reference to the Window.
Definition widget.hpp:48
The constraints of a widget.
Definition widget_constraints.hpp:26
The layout of a widget.
Definition widget_layout.hpp:37
Definition text_field_widget.hpp:25
Definition text_widget.hpp:33