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();
110 [[nodiscard]] generator<widget *> children() const noexcept override;
112 void set_layout(
widget_layout const& context) noexcept override;
113 void draw(draw_context const& context) noexcept override;
114 bool handle_event(
gui_event const& event) noexcept override;
115 hitbox hitbox_test(point2i position) const noexcept override;
116 [[nodiscard]]
bool accepts_keyboard_focus(keyboard_focus_group group) const noexcept override;
117 [[nodiscard]] color focus_color() const noexcept override;
120 notifier<>::callback_token _delegate_cbt;
134 observer<gstring> _text;
138 observer<label> _error_label;
143 typename decltype(
continues)::callback_token _continues_cbt;
144 typename decltype(
text_style)::callback_token _text_style_cbt;
145 typename decltype(_text)::callback_token _text_cbt;
146 typename decltype(_error_label)::callback_token _error_label_cbt;
148 void set_attributes() noexcept {}
149 void set_attributes(text_field_widget_attribute
auto&& first, text_field_widget_attribute
auto&&...rest)
noexcept
151 if constexpr (forward_of<
decltype(first), observer<hi::alignment>>) {
153 }
else if constexpr (forward_of<
decltype(first), observer<hi::semantic_text_style>>) {
162 void revert(
bool force)
noexcept;
163 void commit(
bool force)
noexcept;
164 void draw_background_box(draw_context
const& context)
const noexcept;
#define hi_static_no_default(...)
This part of the code should not be reachable, unless a programming bug.
Definition assert.hpp:181
#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.
axis
An enumeration of the 3 axis for 3D geometry.
Definition axis.hpp:18
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
geometry/margins.hpp
Definition assert.hpp:18
A user interface event.
Definition gui_event.hpp:77
2D constraints.
Definition box_constraints.hpp:25
Definition box_shape.hpp:15
The GUI widget displays and lays out text together with an icon.
Definition label_widget.hpp:42
The scroll widget allows a content widget to be shown in less space than is required.
Definition scroll_widget.hpp:46
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
observer< bool > continues
Continues update mode.
Definition text_field_widget.hpp:72
text_field_widget(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:101
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:46
widget(widget *parent) noexcept
widget * parent
Pointer to the parent widget.
Definition widget.hpp:51
The layout of a widget.
Definition widget_layout.hpp:41
Definition text_field_widget.hpp:25
Definition text_widget.hpp:33