15 #define GETTEXT_DOMAIN "wesnoth-lib"
77 tgrid* parent_grid =
nullptr;
79 parent_grid = find_widget<tgrid>(
grid,
id,
false,
false);
82 parent_grid = find_widget<tgrid>(content_grid,
id,
true,
false);
84 parent_grid =
dynamic_cast<tgrid*
>(parent_grid->
parent());
88 widget = parent_grid->
swap_child(
id, widget,
false);
101 for(
const auto & builder : widget_builder)
135 for(
unsigned int i = 0;
i < num_layers; ++
i) {
167 DBG_GUI_P <<
"Parsing stacked widget " <<
id <<
'\n';
169 load_resolutions<tresolution>(cfg);
196 static config dummy(
"draw");
232 tbuilder_stacked_widget::tbuilder_stacked_widget(
const config& cfg)
249 DBG_GUI_G <<
"Window builder: placed stacked widget '" <<
id
250 <<
"' with definition '" <<
definition <<
"'.\n";
child_itors child_range(const std::string &key)
Abstract base class for the generator.
virtual void select_item(const unsigned index, const bool select)=0
(De)selects an item.
const tgrid & grid() const
twindow * build(CVideo &video, const twindow_builder::tresolution *definition)
Builds a window.
virtual void layout_children() override
See twidget::layout_children.
GLuint GLuint GLsizei GLenum type
tresolution_definition_ptr config()
virtual tgrid & item(const unsigned index)=0
Gets the grid of an item.
Base class of a resolution, contains the common keys for a resolution.
A class inherited from ttext_box that displays its input as stars.
void init_control(tcontrol *control) const
std::string definition
Parameters for the control.
static UNUSEDNOWARN std::string _(const char *str)
#define VALIDATE(cond, message)
The macro to use for the validation of WML.
GLenum GLenum GLuint GLint GLint layer
virtual unsigned get_item_count() const =0
Returns the number of items.
virtual bool is_selected(const unsigned index) const =0
Returns whether the item is selected.
virtual tgrid & create_item(const int index, tbuilder_grid_const_ptr list_builder, const string_map &item_data, const std::function< void(twidget &)> &callback)=0
Creates a new item.
void init_grid(const boost::intrusive_ptr< tbuilder_grid > &grid_builder)
Initializes and builds the grid.
static size_t id
Ids for the timers.
Contains the state info for a resolution.
std::map< std::string, t_string > string_map
twidget * swap_child(const std::string &id, twidget *widget, const bool recurse, twidget *new_parent=nullptr)
Exchanges a child in the grid.
A generic container base class.
std::vector< tstate_definition > state
config & child(const std::string &key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string
Contains the implementation details for lexical_cast and shouldn't be used directly.