14 #define GETTEXT_DOMAIN "wesnoth-lib" 40 , last_real_advancement_(real)
46 listbox& list = find_widget<listbox>(&window,
"advance_choice",
false);
50 window.keyboard_capture(&list);
53 find_widget<button>(&window,
"show_help",
false),
59 std::map<std::string, string_map> row_data;
62 std::string image_string, name = sample.
type_name();
69 if(back.has_attribute(
"image")) {
70 image_string = back[
"image"].str();
73 name = back[
"description"].str();
76 if(image_string.empty()) {
80 column[
"label"] = image_string;
81 row_data.emplace(
"advancement_image", column);
83 column[
"label"] = name;
84 row_data.emplace(
"advancement_name", column);
92 window.set_escape_disabled(
true);
97 const int selected_row
98 = find_widget<listbox>(
get_window(),
"advance_choice",
false).get_selected_row();
100 if(selected_row == -1) {
104 find_widget<unit_preview_pane>(
get_window(),
"advancement_details",
false)
105 .set_displayed_unit(*
previews_[selected_row]);
116 selected_index_ = find_widget<listbox>(&window,
"advance_choice",
false)
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
void show_help(const std::string &show_topic, int xloc, int yloc)
Open the help browser, show topic with id show_topic.
This class represents a single unit of a specific type.
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
child_itors child_range(config_key_type key)
window * get_window() const
Returns a pointer to the dialog's window.
const unit_type & type() const
This unit's type, accounting for gender and variation.
std::shared_ptr< const unit > unit_const_ptr
void connect_signal_notify_modified(dispatcher &dispatcher, const signal_notification_function &signal)
Connects a signal handler for getting a notification upon modification.
This file contains the settings handling of the widget library.
std::size_t last_real_advancement_
void connect_signal_mouse_left_click(dispatcher &dispatcher, const signal_function &signal)
Connects a signal handler for a left mouse button click.
const t_string & type_name() const
Gets the translatable name of this unit's type.
std::size_t selected_index_
grid & add_row(const string_map &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
const std::string & image() const
int get_retval() const
Returns the cached window exit code.
Dialog was closed with the OK button.
config & get_modifications()
Get the raw modifications.
base class of top level items, the only item which needs to store the final canvases to draw on...
const std::vector< unit_const_ptr > & previews_
std::string image_mods() const
Gets an IPF string containing all IPF image mods.
virtual void pre_show(window &window) override
Actions to be taken before showing the window.