#include <hikogui/widgets/selection_delegate.hpp>
|
virtual void | init (widget_intf const &sender) |
|
virtual void | deinit (widget_intf const &sender) |
|
virtual std::optional< widget_id > | keyboard_focus_id (widget_intf const &sender) const noexcept |
| The id of the widget that will need to get keyboard focus when the pull-down menu is opened.
|
|
virtual size_t | size (widget_intf const &sender) const noexcept |
| The number of options in the pull-down menu.
|
|
bool | empty (widget_intf const &sender) const noexcept |
|
virtual std::unique_ptr< widget > | make_option_widget (widget_intf const &sender, widget_intf const &parent, size_t index) noexcept=0 |
| Create a new widget that represents the button in the selection menu.
|
|
virtual std::optional< label > | selected_label (widget_intf const &sender) const noexcept |
| Get the label of the selected option.
|
|
template<forward_of< void()> Func> |
callback< void()> | subscribe_on_value (Func &&func, callback_flags flags=callback_flags::synchronous) noexcept |
| Subscribe a callback for notifying the widget of a change in the value.
|
|
template<forward_of< void()> Func> |
callback< void()> | subscribe_on_options (Func &&func, callback_flags flags=callback_flags::synchronous) noexcept |
| Subscribe a callback for notifying the widget of a change in the options.
|
|
A delegate that controls the state of a selection_widget.
◆ keyboard_focus_id()
virtual std::optional< widget_id > hi::v1::selection_delegate::keyboard_focus_id |
( |
widget_intf const & | sender | ) |
const |
|
inlinevirtualnoexcept |
The id of the widget that will need to get keyboard focus when the pull-down menu is opened.
- Returns
- The id of the widget that needs keyboard focus.
- Return values
-
std::nullopt | There are no options. |
Reimplemented in hi::v1::default_selection_delegate< T >.
◆ make_option_widget()
Create a new widget that represents the button in the selection menu.
- Parameters
-
sender | The selection widget that uses this delegate. |
parent | The parent widget of the new widget being created. |
index | The index of the option. |
- Returns
- A new widget that represents the option at index.
Implemented in hi::v1::default_selection_delegate< T >.
◆ selected_label()
virtual std::optional< label > hi::v1::selection_delegate::selected_label |
( |
widget_intf const & | sender | ) |
const |
|
inlinevirtualnoexcept |
Get the label of the selected option.
- Returns
- The label of the selected option.
- Return values
-
std::nullopt | None of the options has been selected. |
Reimplemented in hi::v1::default_selection_delegate< T >.
◆ size()
virtual size_t hi::v1::selection_delegate::size |
( |
widget_intf const & | sender | ) |
const |
|
inlinevirtualnoexcept |
◆ subscribe_on_options()
template<forward_of< void()> Func>
callback< void()> hi::v1::selection_delegate::subscribe_on_options |
( |
Func && | func, |
|
|
callback_flags | flags = callback_flags::synchronous ) |
|
inlinenoexcept |
Subscribe a callback for notifying the widget of a change in the options.
◆ subscribe_on_value()
template<forward_of< void()> Func>
callback< void()> hi::v1::selection_delegate::subscribe_on_value |
( |
Func && | func, |
|
|
callback_flags | flags = callback_flags::synchronous ) |
|
inlinenoexcept |
Subscribe a callback for notifying the widget of a change in the value.
The documentation for this class was generated from the following file: