16 #define GETTEXT_DOMAIN "wesnoth-lib"
30 #define LOG_SCOPE_HEADER get_control_type() + " [" + id() + "] " + __func__
31 #define LOG_HEADER LOG_SCOPE_HEADER + ':'
46 connect_signal<event::LEFT_BUTTON_DOWN>(
53 return find_widget<text_box>(
"_text",
false,
true);
59 if (edit_area !=
nullptr) {
60 edit_area->
set_value(std::to_string(val));
72 if (edit_area !=
nullptr) {
79 }
catch(std::invalid_argument
const& ) {
82 }
catch(std::out_of_range
const& ) {
92 repeating_button* btn_prev = find_widget<repeating_button>(
"_prev",
false,
true);
93 repeating_button* btn_next = find_widget<repeating_button>(
"_next",
false,
true);
133 load_resolutions<resolution>(cfg);
144 grid = std::make_shared<builder_grid>(child);
152 builder_spinner::builder_spinner(
const config& cfg)
159 auto widget = std::make_unique<spinner>(*
this);
164 widget->init_grid(*conf->grid);
167 DBG_GUI_G <<
"Window builder: placed spinner '" <<
id
168 <<
"' with definition '" <<
definition <<
"'.";
A config object defines a single node in a WML file, with access to child nodes.
A generic container base class.
bool invalid_
If the entered data is invalid.
state_t state_
Current state of the widget.
void set_value(const int val)
void signal_handler_left_button_down(const event::ui_event event)
virtual bool get_active() const override
See styled_widget::get_active.
text_box * get_internal_text_box()
bool can_wrap() const override
See widget::can_wrap.
virtual void set_self_active(const bool active) override
See container_base::set_self_active.
virtual unsigned get_state() const override
See styled_widget::get_state.
std::string get_value() const
virtual void set_value(const std::string &text)
The set_value is virtual for the password_box class.
A widget that allows the user to input text in single line.
void keyboard_capture(widget *widget)
Define the common log macros for the gui toolkit.
ui_event
The event sent to the dispatcher.
Contains the implementation details for lexical_cast and shouldn't be used directly.
virtual std::unique_ptr< widget > build() const override
std::vector< state_definition > state
resolution(const config &cfg)
spinner_definition(const config &cfg)
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)