15 #define GETTEXT_DOMAIN "wesnoth-lib" 32 #define LOG_SCOPE_HEADER get_control_type() + " [" + id() + "] " + __func__ 33 #define LOG_HEADER LOG_SCOPE_HEADER + ':' 50 values_.emplace_back(
"label", this->get_label());
52 connect_signal<event::MOUSE_ENTER>(
54 connect_signal<event::MOUSE_LEAVE>(
57 connect_signal<event::LEFT_BUTTON_DOWN>(
59 connect_signal<event::LEFT_BUTTON_UP>(
61 connect_signal<event::LEFT_BUTTON_CLICK>(
66 connect_signal<event::NOTIFY_MODIFIED>(
167 selected.push_back(
values_[i][
"label"]);
170 if(selected.size() ==
values_.size()) {
174 const unsigned excess = selected.size() -
max_shown_;
176 selected.back() =
VNGETTEXT(
"multimenu^$excess other",
"$excess others", excess, {{
"excess", std::to_string(excess)}});
184 for(
unsigned i = 0;
i <
values_.size();
i++) {
208 assert(option <
values_.size());
220 assert(states.size() ==
values_.size());
242 DBG_GUI_P <<
"Parsing multimenu_button " <<
id <<
'\n';
244 load_resolutions<resolution>(cfg);
251 state.emplace_back(cfg.
child(
"state_enabled"));
252 state.emplace_back(cfg.
child(
"state_disabled"));
253 state.emplace_back(cfg.
child(
"state_pressed"));
254 state.emplace_back(cfg.
child(
"state_focused"));
262 builder_multimenu_button::builder_multimenu_button(
const config& cfg)
264 , max_shown_(cfg[
"maximum_shown"].to_unsigned(1))
267 for(
const auto& option : cfg.
child_range(
"option")) {
281 DBG_GUI_G <<
"Window builder: placed multimenu_button '" <<
id 282 <<
"' 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.
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::string format_conjunct_list(const t_string &empty, const std::vector< t_string > &elems)
Format a conjunctive list.
std::vector< state_definition > state
child_itors child_range(config_key_type key)
std::string sound_button_click
static std::string _(const char *str)
bool show(const unsigned auto_close_time=0)
Shows the window.
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)
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.
ui_event
The event send to the dispatcher.