15 #define GETTEXT_DOMAIN "wesnoth-lib" 28 #define LOG_SCOPE_HEADER get_control_type() + " [" + id() + "] " + __func__ 29 #define LOG_HEADER LOG_SCOPE_HEADER + ':' 45 connect_signal<event::MOUSE_ENTER>(std::bind(
47 connect_signal<event::MOUSE_LEAVE>(std::bind(
50 connect_signal<event::LEFT_BUTTON_CLICK>(std::bind(
52 connect_signal<event::LEFT_BUTTON_DOUBLE_CLICK>(std::bind(
55 std::placeholders::_2,
56 std::placeholders::_3));
61 std::div_t res = std::div(this->
config()->state.size(),
COUNT);
72 string_map::const_iterator itor = data.find(
"icon");
73 if(itor != data.end()) {
104 for(
auto &
canvas : canvases)
199 DBG_GUI_P <<
"Parsing toggle button " <<
id <<
'\n';
201 load_resolutions<resolution>(cfg);
211 state.emplace_back(
c.child(
"enabled"));
212 state.emplace_back(
c.child(
"disabled"));
213 state.emplace_back(
c.child(
"focused"));
222 builder_toggle_button::builder_toggle_button(
const config& cfg)
224 , icon_name_(cfg[
"icon"])
225 , retval_id_(cfg[
"return_value_id"])
226 , retval_(cfg[
"return_value"])
237 DBG_GUI_G <<
"Window builder: placed toggle button '" <<
id 238 <<
"' with definition '" <<
definition <<
"'.\n";
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
void set_variable(const std::string &key, const 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.
Sent by a widget to notify others its contents or state are modified.
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.
bool fire_event(const ui_event event, std::vector< std::pair< widget *, ui_event >> &event_chain, widget *dispatcher, widget *w, F &&... params)
Helper function for fire_event.
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.
ui_event
The event send to the dispatcher.