#include <hikogui/widgets/selection_delegate.hpp>
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()
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()
◆ 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: