11#include "../observer/observer.hpp"
12#include "../utility/utility.hpp"
13#include "../concurrency/concurrency.hpp"
14#include "../dispatch/dispatch.hpp"
15#include "../GUI/GUI.hpp"
16#include "../macros.hpp"
20hi_export_module(hikogui.widgets.button_delegate);
22hi_export
namespace hi {
44 return widget_value::off;
49 template<forward_of<
void()> Func>
52 return _notifier.subscribe(std::forward<Func>(
func), flags);
56 notifier<
void()> _notifier;
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
The HikoGUI namespace.
Definition recursive_iterator.hpp:15
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:378
Definition callback.hpp:77
Definition widget_intf.hpp:24
A button delegate controls the state of a button widget.
Definition button_delegate.hpp:28
virtual void activate(widget_intf const &sender) noexcept
Called when the button is pressed by the user.
Definition button_delegate.hpp:38
virtual widget_value state(widget_intf const &sender) const noexcept
Used by the widget to check the state of the button.
Definition button_delegate.hpp:42
callback< void()> subscribe(Func &&func, callback_flags flags=callback_flags::synchronous) noexcept
Subscribe a callback for notifying the widget of a data change.
Definition button_delegate.hpp:50