|
HikoGUI
A low latency retained GUI
|
#include <ttauri/widgets/default_button_delegate.hpp>
Public Types | |
| using | value_type = T |
Public Types inherited from tt::button_delegate | |
| using | callback_ptr_type = std::shared_ptr<std::function<void()>> |
Public Member Functions | |
| template<typename Value , typename OnValue , typename OffValue > | |
| default_button_delegate (Value &&value, OnValue &&on_value, OffValue &&off_value) noexcept | |
| Construct a delegate. | |
| template<typename Value , typename OnValue > requires (can_make_defaults or button_type == button_type::radio) | |
| default_button_delegate (Value &&value, OnValue &&on_value) noexcept | |
| Construct a delegate. | |
| template<typename Value > requires (can_make_defaults) | |
| default_button_delegate (Value &&value) noexcept | |
| Construct a delegate. | |
Public Member Functions inherited from tt::button_delegate | |
| virtual void | init (abstract_button_widget &sender) noexcept |
| virtual void | deinit (abstract_button_widget &sender) noexcept |
| template<typename Callback > requires (std::is_invocable_v<Callback>) | |
| callback_ptr_type | subscribe (abstract_button_widget &sender, Callback &&callback) noexcept |
| Subscribe a callback for notifying the widget of a data change. | |
Static Public Attributes | |
| static constexpr button_type | button_type = ButtonType |
| static constexpr bool | can_make_defaults |
A default button delegate.
The default button delegate manages the state of a button widget using observable values.
| ButtonType | The type of button this delegate manages, either a button_type::radio or button_type::toggle. |
| T | The type of the observable value. |
|
inlinenoexcept |
Construct a delegate.
| value | A value or observable-value used as a representation of the state. |
| on_value | The value or observable-value that mean 'on'. |
| off_value | The value or observable-value that mean 'off'. |
|
inlinenoexcept |
Construct a delegate.
| value | A value or observable-value used as a representation of the state. |
| on_value | The value or observable-value that mean 'on'. |
|
inlinenoexcept |
Construct a delegate.
| value | A value or observable-value used as a representation of the state. |
|
staticconstexpr |