41 result =
dynamic_cast<T*
>(
w);
43 }
while(
w && !result);
70 const std::string&
id,
71 const bool must_be_active,
72 const bool must_exist)
74 T* result =
dynamic_cast<T*
>(
widget->
find(
id, must_be_active));
97 const std::string&
id,
98 const bool must_be_active)
100 return *find_widget<T>(
widget,
id, must_be_active,
true);
106 if(
auto widget = find_widget<T>(parent,
id,
false,
false)) {
T & get_parent(widget &child)
Returns the first parent of a widget with a certain type.
t_string missing_widget(const std::string &id)
Returns a default error message if a mandatory widget is omitted.
void on_widget(utils::const_clone_ptr< widget, T > parent, const std::string &id, std::function< void(T &)> func)
T * find_widget(utils::const_clone_ptr< widget, T > widget, const std::string &id, const bool must_be_active, const bool must_exist)
Gets a widget with the wanted id.
typename const_clone< D, S >::pointer const_clone_ptr
Add a special kind of assert to validate whether the input from WML doesn't contain any problems that...
#define VALIDATE(cond, message)
The macro to use for the validation of WML.