|
HikoGUI
A low latency retained GUI
|
#include <hikogui/widgets/text_field_delegate.hpp>
Public Types | |
| using | notifier_type = notifier<> |
| using | callback_token = notifier_type::callback_token |
| using | callback_proto = notifier_type::callback_proto |
Public Member Functions | |
| virtual void | init (widget const &sender) noexcept |
| virtual void | deinit (widget const &sender) noexcept |
| virtual std::optional< label > | validate (widget &sender, hi::text_view text) noexcept |
| Validate the text field. | |
| virtual hi::text | text (widget &sender) noexcept |
| Get the text to show in the text field. | |
| virtual void | set_text (widget &sender, hi::text_view text) noexcept |
| Set the text as entered by the user. | |
| callback_token | subscribe (forward_of< callback_proto > auto &&callback, callback_flags flags=callback_flags::synchronous) noexcept |
A delegate that controls the state of a text_field_widget.
|
inlinevirtualnoexcept |
Set the text as entered by the user.
When the user causes a text field to commit, by pressing enter, tab, or clicking outside the field and when the text was validated the widget will call this function to commit the text with the delegate.
| sender | The widget that called this function. |
| text | The text entered by the user. |
Reimplemented in hi::v1::default_text_field_delegate< T >, and hi::v1::default_text_field_delegate< T >.
Get the text to show in the text field.
When the user is not editing the text the text-field will request what to show using this function.
| sender | The widget that called this function. |
Reimplemented in hi::v1::default_text_field_delegate< T >, and hi::v1::default_text_field_delegate< T >.
|
inlinevirtualnoexcept |
Validate the text field.
| sender | The widget that called this function. |
| text | The text entered by the user into the text field. |
Reimplemented in hi::v1::default_text_field_delegate< T >, and hi::v1::default_text_field_delegate< T >.