16 #define GETTEXT_DOMAIN "wesnoth-lib"
37 const int selected_row
38 = find_widget<listbox>(
this,
"core_list",
false)
42 = find_widget<multi_page>(
this,
"core_details",
false);
50 listbox& list = find_widget<listbox>(&
window,
"core_list",
false);
58 = find_widget<multi_page>(&
window,
"core_details",
false);
60 for(
const auto & core :
cores_)
66 list_item[
"label"] = core[
"image"];
67 list_item_item.emplace(
"image", list_item);
69 list_item[
"label"] = core[
"name"];
70 list_item_item.emplace(
"name", list_item);
79 detail_item[
"label"] = core[
"description"];
80 detail_item[
"use_markup"] =
"true";
81 detail_page.emplace(
"description", detail_item);
This shows the dialog which allows the user to choose which core to play.
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
const std::vector< config > & cores_
Contains the config objects for all cores.
int choice_
The chosen core.
void core_selected()
Called when another core is selected.
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
grid & add_row(const widget_item &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
bool select_row(const unsigned row, const bool select=true)
Selects a row.
A multi page is a control that contains several 'pages' of which only one is visible.
grid & add_page(const widget_item &item)
Adds single page to the grid.
void select_page(const unsigned page, const bool select=true)
Selects a page.
base class of top level items, the only item which needs to store the final canvases to draw on.
void keyboard_capture(widget *widget)
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
void connect_signal_notify_modified(dispatcher &dispatcher, const signal_notification &signal)
Connects a signal handler for getting a notification upon modification.
std::map< std::string, widget_item > widget_data
std::map< std::string, t_string > widget_item
This file contains the settings handling of the widget library.