|
HikoGUI
A low latency retained GUI
|
Public Types | |
| using | callback_ptr_type = std::shared_ptr<std::function<void()>> |
Public Member Functions | |
| virtual void | init (text_field_widget const &sender) noexcept |
| virtual void | deinit (text_field_widget const &sender) noexcept |
| virtual callback_ptr_type | subscribe (text_field_widget &sender, callback_ptr_type const &callback_ptr) noexcept |
| template<typename Callback > requires (std::is_invocable_v<Callback>) | |
| callback_ptr_type | subscribe (text_field_widget &sender, Callback &&callback) noexcept |
| Subscribe a callback for notifying the widget of a data change. | |
| virtual void | unsubscribe (text_field_widget &sender, callback_ptr_type const &callback_ptr) noexcept |
| virtual std::optional< label > | validate (text_field_widget &sender, std::string_view text) noexcept |
| Validate the text field. | |
| virtual std::string | text (text_field_widget &sender) noexcept |
| Get the text to show in the text field. | |
| virtual void | set_text (text_field_widget &sender, std::string_view text) noexcept |
| Set the text as entered by the user. | |
|
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.
| text | The text entered by the user. |
Reimplemented in tt::default_text_field_delegate< T >, and tt::default_text_field_delegate< T >.
|
inlinenoexcept |
Subscribe a callback for notifying the widget of a data change.
|
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.
Reimplemented in tt::default_text_field_delegate< T >, and tt::default_text_field_delegate< T >.
|
inlinevirtualnoexcept |
Validate the text field.
| text | The text entered by the user into the text field. |
Reimplemented in tt::default_text_field_delegate< T >, and tt::default_text_field_delegate< T >.