16 #define GETTEXT_DOMAIN "wesnoth-lib" 29 #define LOG_SCOPE_HEADER get_control_type() + " [" + id() + "] " + __func__ 30 #define LOG_HEADER LOG_SCOPE_HEADER + ':' 46 connect_signal<event::MOUSE_ENTER>(std::bind(
48 connect_signal<event::MOUSE_LEAVE>(std::bind(
51 connect_signal<event::LEFT_BUTTON_CLICK>(std::bind(
53 connect_signal<event::LEFT_BUTTON_DOUBLE_CLICK>(std::bind(
56 std::placeholders::_2,
57 std::placeholders::_3));
73 widget_item::const_iterator itor = data.find(
"icon");
74 if(itor != data.end()) {
105 for(
auto &
canvas : canvases)
202 load_resolutions<resolution>(cfg);
212 state.emplace_back(
c.child(
"enabled"));
213 state.emplace_back(
c.child(
"disabled"));
214 state.emplace_back(
c.child(
"focused"));
223 builder_toggle_button::builder_toggle_button(
const config& cfg)
225 , icon_name_(cfg[
"icon"])
226 , retval_id_(cfg[
"return_value_id"])
227 , retval_(cfg[
"return_value"])
233 auto widget = std::make_unique<toggle_button>(*this);
238 DBG_GUI_G <<
"Window builder: placed toggle button '" <<
id 239 <<
"' with definition '" <<
definition <<
"'.";
Define the common log macros for the gui toolkit.
Base class of a resolution, contains the common keys for a resolution.
std::vector< state_definition > state
ui_event
The event sent to the dispatcher.
void set_variable(const std::string &key, wfl::variant &&value)
child_itors child_range(config_key_type key)
int get_retval(const std::string &retval_id, const int retval, const std::string &id)
Returns the return value for a widget.
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.
std::map< std::string, t_string > widget_item
This file contains the settings handling of the widget library.
void set_wants_mouse_left_double_click(const bool click=true)
A simple canvas which can be drawn upon.
Default, unset return value.
void set_retval(const int retval, const bool close_window=true)
Sets there return value of the window.
void play_UI_sound(const std::string &files)
bool fire(const ui_event event, widget &target)
Fires an event which has no extra parameters.
retval
Default window/dialog return values.
A config object defines a single node in a WML file, with access to child nodes.
std::string sound_toggle_button_click
base class of top level items, the only item which needs to store the final canvases to draw on...
Contains the implementation details for lexical_cast and shouldn't be used directly.