16 #define GETTEXT_DOMAIN "wesnoth-lib"
34 #define LOG_SCOPE_HEADER get_control_type() + " [" + id() + "] " + __func__
35 #define LOG_HEADER LOG_SCOPE_HEADER + ':'
47 , wrap_on_(builder.wrap_on)
48 , text_alignment_(builder.text_alignment)
49 , link_aware_(builder.link_aware)
51 connect_signal<event::LEFT_BUTTON_DOWN>(
98 widget->set_use_markup(use_markup);
105 widget->set_text_alpha(alpha);
114 widget->set_link_aware(l);
173 load_resolutions<resolution>(cfg);
181 state.emplace_back(
VALIDATE_WML_CHILD(cfg,
"state_disabled",
_(
"Missing required state for scroll label control")));
183 auto child =
VALIDATE_WML_CHILD(cfg,
"grid",
_(
"No grid defined for scroll label control"));
184 grid = std::make_shared<builder_grid>(child);
192 builder_scroll_label::builder_scroll_label(
const config& cfg)
196 , wrap_on(cfg[
"wrap"].to_bool(true))
198 , link_aware(cfg[
"link_aware"].to_bool(false))
204 auto widget = std::make_unique<scroll_label>(*
this);
212 widget->init_grid(*conf->grid);
215 DBG_GUI_G <<
"Window builder: placed scroll label '" <<
id
216 <<
"' with definition '" <<
definition <<
"'.";
A config object defines a single node in a WML file, with access to child nodes.
widget * find(const std::string &id, const bool must_be_active) override
See widget::find.
A label displays text that can be wrapped but no scrollbars are provided.
void set_can_wrap(const bool wrap)
void set_link_aware(bool l)
void keyboard_capture(widget *widget)
static std::string _(const char *str)
Define the common log macros for the gui toolkit.
void point(int x, int y)
Draw a single point.
ui_event
The event sent to the dispatcher.
scrollbar_mode get_scrollbar_mode(const std::string &scrollbar_mode)
Returns the scrollbar mode flags.
PangoAlignment decode_text_alignment(const std::string &alignment)
Converts a text alignment string to a text alignment.
Contains the implementation details for lexical_cast and shouldn't be used directly.
This file contains the settings handling of the widget library.
Base class of a resolution, contains the common keys for a resolution.
std::vector< state_definition > state
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)