50 const std::string& title,
52 const std::string& portrait,
77 void set_input(
const std::string& caption,
79 const unsigned maximum_length);
88 void set_option_list(
const std::vector<wml_message_option>& option_list,
141 const std::string& portrait,
157 const std::string& portrait,
173 const std::string& portrait,
175 const std::string& second_portrait,
176 const bool second_mirror)
Main class to show messages to the user.
Abstract base class for all modal dialogs.
virtual const std::string & window_id() const =0
The ID of the window to build.
Base class for the wml generated messages.
std::string * input_text_
The text input.
std::string portrait_
Filename of the portrait.
std::string message_
The message to show to the user.
void set_input(const std::string &caption, std::string *text, const unsigned maximum_length)
Sets the input text variables.
bool has_input_
Do we need to show an input box?
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
unsigned input_maximum_length_
The maximum length of the input text.
bool mirror_
Mirror the portrait?
std::string image_
The image which is shown in the dialog.
int * chosen_option_
The chosen option.
std::string input_caption_
The caption to show for the input text.
void set_option_list(const std::vector< wml_message_option > &option_list, int *chosen_option)
Sets the option list.
std::string title_
The title for the dialog.
wml_message_base(const std::string &window_id, const std::string &title, const std::string &message, const std::string &portrait, const bool mirror)
std::vector< wml_message_option > option_list_
The list of options the user can choose.
virtual void pre_show(window &window) override
Shows a dialog with two portraits, one on each side.
std::string second_portrait_
virtual const std::string & window_id() const override
The ID of the window to build.
wml_message_double(const std::string &title, const std::string &message, const std::string &portrait, const bool mirror, const std::string &second_portrait, const bool second_mirror)
virtual void pre_show(window &window) override
Shows a dialog with the portrait on the left side.
virtual const std::string & window_id() const override
The ID of the window to build.
wml_message_left(const std::string &title, const std::string &message, const std::string &portrait, const bool mirror)
Helper class for message options.
std::string label() const
wml_message_option(std::string label, std::string description="", std::string image="")
std::string image() const
std::string description() const
Shows a dialog with the portrait on the right side.
virtual const std::string & window_id() const override
The ID of the window to build.
wml_message_right(const std::string &title, const std::string &message, const std::string &portrait, const bool mirror)
A label displays a text, the text can be wrapped but no scrollbars are provided.
base class of top level items, the only item which needs to store the final canvases to draw on.
int show_wml_message(const std::string &title, const std::string &message, const wml_message_portrait *left, const wml_message_portrait *right, const wml_message_options &options, const wml_message_input &input)
Helper function to show a portrait.
Functions to load and save images from/to disk.
Parameter pack for message list input options.
int chosen_option
The initially chosen option.
std::vector< wml_message_option > option_list
A list of options to select in the dialog.
Parameter pack for message portrait.
std::string portrait
Filename of the portrait.
bool mirror
Does the portrait need to be mirrored?