16 #define GETTEXT_DOMAIN "wesnoth-lib" 31 #define LOG_SCOPE_HEADER get_control_type() + " [" + id() + "] " + __func__ 32 #define LOG_HEADER LOG_SCOPE_HEADER + ':' 49 values_.emplace_back(
"label", this->get_label());
51 connect_signal<event::MOUSE_ENTER>(
54 connect_signal<event::MOUSE_LEAVE>(
57 connect_signal<event::LEFT_BUTTON_DOWN>(
60 connect_signal<event::LEFT_BUTTON_UP>(
63 connect_signal<event::LEFT_BUTTON_CLICK>(
66 connect_signal<event::SDL_WHEEL_UP>(
70 connect_signal<event::SDL_WHEEL_DOWN>(
147 if(droplist.
show()) {
188 assert(selected < values.size());
203 assert(selected <
values_.size());
225 load_resolutions<resolution>(cfg);
232 state.emplace_back(cfg.
child(
"state_enabled"));
233 state.emplace_back(cfg.
child(
"state_disabled"));
234 state.emplace_back(cfg.
child(
"state_pressed"));
235 state.emplace_back(cfg.
child(
"state_focused"));
243 builder_menu_button::builder_menu_button(
const config& cfg)
247 for(
const auto& option : cfg.
child_range(
"option")) {
254 auto widget = std::make_unique<menu_button>(*this);
260 DBG_GUI_G <<
"Window builder: placed menu_button '" <<
id 261 <<
"' with definition '" <<
definition <<
"'.";
Define the common log macros for the gui toolkit.
Base class of a resolution, contains the common keys for a resolution.
Small abstract helper class.
config & child(config_key_type key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
std::vector< state_definition > state
ui_event
The event sent to the dispatcher.
child_itors child_range(config_key_type key)
std::string sound_button_click
bool show(const unsigned auto_close_time=0)
Shows the window.
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.
This file contains the settings handling of the widget library.
void mouse_capture(const bool capture=true)
void play_UI_sound(const std::string &files)
bool fire(const ui_event event, widget &target)
Fires an event which has no extra parameters.
A config object defines a single node in a WML file, with access to child nodes.
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.