33 if constexpr(std::is_same_v<menu_button, T>) {
34 return w.get_value_string();
38 if constexpr(std::is_base_of_v<selectable_item, T>) {
39 return w.get_value_bool() ?
_(
"yes") :
_(
"no");
43 if constexpr(std::is_same_v<slider, T>) {
44 return w.get_value_label();
63 target = parent->
find(target_id,
false);
99 template<
typename W,
typename F>
106 [&, value_getter](
auto&&...) { target.
set_label(value_getter(source)); });
static std::string _(const char *str)
void connect_signal_notify_modified(dispatcher &dispatcher, const signal_notification &signal)
Connects a signal handler for getting a notification upon modification.
t_string get_status_label(const T &w)
auto & find_target(std::string_view target_id, widget &source)
Searches for the status target, starting with the source widget's parent.
auto & validate_target(styled_widget *target, widget &source)
Returns the dereferenced target pointer if valid, else the default target.
void bind_default_status_label(W &source)
Binds a status label using the default value getter and default target ID.
t_string missing_widget(const std::string &id)
Returns a default error message if a mandatory widget is omitted.
void bind_status_label(W &source, const F &value_getter, styled_widget *target_ptr=nullptr)
Binds a given target widget to reflect another widget's label.
Contains the implementation details for lexical_cast and shouldn't be used directly.
#define VALIDATE(cond, message)
The macro to use for the validation of WML.