16 #define GETTEXT_DOMAIN "wesnoth-lib"
30 #define LOG_SCOPE_HEADER get_control_type() + " [" + id() + "] " + __func__
31 #define LOG_HEADER LOG_SCOPE_HEADER + ':'
47 connect_signal<event::MOUSE_ENTER>(std::bind(
49 connect_signal<event::MOUSE_LEAVE>(std::bind(
52 connect_signal<event::LEFT_BUTTON_CLICK>(std::bind(
54 connect_signal<event::LEFT_BUTTON_DOUBLE_CLICK>(std::bind(
57 std::placeholders::_2,
58 std::placeholders::_3));
74 widget_item::const_iterator itor =
data.find(
"icon");
75 if(itor !=
data.end()) {
106 for(
auto &
canvas : canvases)
203 load_resolutions<resolution>(cfg);
224 builder_toggle_button::builder_toggle_button(
const config& cfg)
226 , icon_name_(cfg[
"icon"])
227 , retval_id_(cfg[
"return_value_id"])
228 , retval_(cfg[
"return_value"].to_int())
234 auto widget = std::make_unique<toggle_button>(*
this);
239 DBG_GUI_G <<
"Window builder: placed toggle button '" <<
id
240 <<
"' with definition '" <<
definition <<
"'.";
A config object defines a single node in a WML file, with access to child nodes.
child_itors child_range(config_key_type key)
A simple canvas which can be drawn upon.
void set_variable(const std::string &key, wfl::variant &&value)
bool fire(const ui_event event, widget &target)
Fires an event which has no extra parameters.
void set_wants_mouse_left_double_click(const bool click=true)
base class of top level items, the only item which needs to store the final canvases to draw on.
void set_retval(const int retval, const bool close_window=true)
Sets there return value of the window.
Define the common log macros for the gui toolkit.
bool fire_event(const ui_event event, const std::vector< std::pair< widget *, ui_event >> &event_chain, widget *dispatcher, widget *w, F &&... params)
Helper function for fire_event.
ui_event
The event sent to the dispatcher.
int get_retval(const std::string &retval_id, const int retval, const std::string &id)
Returns the return value for a widget.
std::string sound_toggle_button_click
std::map< std::string, t_string > widget_item
retval
Default window/dialog return values.
@ NONE
Default, unset return value.
Contains the implementation details for lexical_cast and shouldn't be used directly.
void play_UI_sound(const std::string &files)
This file contains the settings handling of the widget library.
std::vector< state_definition > state
std::string missing_mandatory_wml_tag(const std::string §ion, const std::string &tag)
Returns a standard message for a missing wml child (tag).
Add a special kind of assert to validate whether the input from WML doesn't contain any problems that...
#define VALIDATE_WML_CHILD(cfg, key, message)