HikoGUI
A low latency retained GUI
|
#include <hikogui/widgets/text_field_delegate.hpp>
Public Types | |
using | notifier_type = notifier<void()> |
Public Member Functions | |
virtual void | init (widget_intf const &sender) noexcept |
virtual void | deinit (widget_intf const &sender) noexcept |
virtual label | validate (widget_intf const &sender, gstring const &text) noexcept |
Validate the text field. | |
virtual gstring | text (widget_intf const &sender) noexcept |
Get the text to show in the text field. | |
virtual void | set_text (widget_intf const &sender, gstring const &text) noexcept |
Set the text as entered by the user. | |
template<forward_of< void()> Func> | |
callback< void()> | subscribe (Func &&func, 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 >.
|
inlinevirtualnoexcept |
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 >.