|
HikoGUI
A low latency retained GUI
|
#include <hikogui/widgets/selection_delegate.hpp>
Public Types | |
| using | value_type = T |
| using | option_type = std::pair<value_type, label> |
| using | options_type = std::vector<option_type> |
Public Types inherited from hi::v1::selection_delegate | |
| using | notifier_type = notifier<> |
| using | callback_token = notifier_type::callback_token |
| using | callback_proto = notifier_type::callback_proto |
Public Member Functions | |
| default_selection_delegate (forward_of< observer< value_type > > auto &&value, forward_of< observer< options_type > > auto &&options, forward_of< observer< value_type > > auto &&off_value) noexcept | |
| Construct a default selection delegate. | |
| default_selection_delegate (forward_of< observer< value_type > > auto &&value, forward_of< observer< options_type > > auto &&options) noexcept | |
| Construct a default selection delegate. | |
| void | set_selected (selection_widget &sender, ptrdiff_t index) noexcept override |
| std::pair< std::vector< label >, ptrdiff_t > | options_and_selected (selection_widget const &sender) const noexcept override |
| Retrieve the label of an option. | |
Public Member Functions inherited from hi::v1::selection_delegate | |
| virtual void | init (selection_widget &sender) noexcept |
| virtual void | deinit (selection_widget &sender) noexcept |
| virtual void | set_selected (selection_widget &sender, ssize_t index) noexcept |
| Called when an option is selected by the user. | |
| callback_token | subscribe (forward_of< callback_proto > auto &&callback, callback_flags flags=callback_flags::synchronous) noexcept |
| Subscribe a callback for notifying the widget of a data change. | |
Data Fields | |
| observer< value_type > | value |
| observer< options_type > | options |
| observer< value_type > | off_value |
A delegate that control the state of a selection_widget.
| T | the type used as the key for which option is selected. |
|
inlinenoexcept |
Construct a default selection delegate.
| value | The observer value which represents the selected option. |
| options | An observer std::vector<std::pair<value_type,label>> of all possible options. |
| off_value | The value used when none of the available options are selected. |
|
inlinenoexcept |
Construct a default selection delegate.
| value | The observer value which represents the selected option. |
| options | An observer std::vector<std::pair<value_type,label>> of all possible options. |
|
inlineoverridevirtualnoexcept |
Retrieve the label of an option.
| sender | The widget that called this function. |
Reimplemented from hi::v1::selection_delegate.