Base class for the wml generated messages. More...
#include <wml_message.hpp>


Public Member Functions | |
| twml_message_ (const std::string &title, const std::string &message, const std::string &portrait, const bool mirror) | |
| void | set_input (const std::string &caption, std::string *text, const unsigned maximum_length) |
| Sets the input text variables. | |
| void | set_option_list (const std::vector< std::string > &option_list, int *chosen_option) |
Private Member Functions | |
| void | pre_show (CVideo &video, twindow &window) |
| Inherited from tdialog. | |
| void | post_show (twindow &window) |
| Inherited from tdialog. | |
Private Attributes | |
| std::string | title_ |
| The title for the dialog. | |
| std::string | image_ |
| The image which is shown in the dialog. | |
| std::string | message_ |
| The message to show to the user. | |
| std::string | portrait_ |
| Filename of the portrait. | |
| bool | mirror_ |
| Mirror the portrait? | |
| bool | has_input_ |
| Do we need to show an input box? | |
| std::string | input_caption_ |
| The caption to show for the input text. | |
| std::string * | input_text_ |
| The text input. | |
| unsigned | input_maximum_length_ |
| The maximum length of the input text. | |
| std::vector< std::string > | option_list_ |
| The list of options the user can choose. | |
| int * | chosen_option_ |
| The chosen option. | |
Base class for the wml generated messages.
We have a separate sub class for left and right images.
Definition at line 28 of file wml_message.hpp.
| gui2::twml_message_::twml_message_ | ( | const std::string & | title, | |
| const std::string & | message, | |||
| const std::string & | portrait, | |||
| const bool | mirror | |||
| ) | [inline] |
Definition at line 32 of file wml_message.hpp.
| void gui2::twml_message_::post_show | ( | twindow & | window | ) | [private, virtual] |
Inherited from tdialog.
Reimplemented from gui2::tdialog.
Definition at line 146 of file wml_message.cpp.
References chosen_option_, has_input_, input_text_, and option_list_.
Inherited from tdialog.
Especially the fiddling in the internals of the listbox is ugly. There needs to be a clean interface to set whether a widget has a markup and what kind of markup. These fixes will be post 1.6.
Reimplemented from gui2::tdialog.
Definition at line 62 of file wml_message.cpp.
References gui2::tlistbox::add_row(), gui2::tcontrol::canvas(), chosen_option_, gui2::tlegacy_menu_item::description(), has_input_, gui2::tlegacy_menu_item::icon(), input_caption_, input_maximum_length_, input_text_, gui2::twidget::INVISIBLE, gui2::tlegacy_menu_item::is_default(), gui2::tlegacy_menu_item::label(), message_, mirror_, option_list_, portrait_, gui2::tlistbox::select_row(), gui2::tlabel::set_can_wrap(), gui2::tcontrol::set_label(), gui2::tcontrol::set_use_markup(), gui2::twidget::set_visible(), and title_.

| void gui2::twml_message_::set_input | ( | const std::string & | caption, | |
| std::string * | text, | |||
| const unsigned | maximum_length | |||
| ) |
Sets the input text variables.
| caption | The caption for the label. | |
| text | The initial text, after showing the final text. | |
| maximum_length | The maximum length of the text. |
Definition at line 35 of file wml_message.cpp.
References has_input_, input_caption_, input_maximum_length_, and input_text_.
| void gui2::twml_message_::set_option_list | ( | const std::vector< std::string > & | option_list, | |
| int * | chosen_option | |||
| ) |
Definition at line 46 of file wml_message.cpp.
References chosen_option_, and option_list_.
int* gui2::twml_message_::chosen_option_ [private] |
The chosen option.
Definition at line 98 of file wml_message.hpp.
Referenced by post_show(), pre_show(), and set_option_list().
bool gui2::twml_message_::has_input_ [private] |
Do we need to show an input box?
Definition at line 83 of file wml_message.hpp.
Referenced by post_show(), pre_show(), and set_input().
std::string gui2::twml_message_::image_ [private] |
The image which is shown in the dialog.
This image can be an icon or portrait or any other image.
Definition at line 72 of file wml_message.hpp.
std::string gui2::twml_message_::input_caption_ [private] |
The caption to show for the input text.
Definition at line 86 of file wml_message.hpp.
Referenced by pre_show(), and set_input().
unsigned gui2::twml_message_::input_maximum_length_ [private] |
The maximum length of the input text.
Definition at line 92 of file wml_message.hpp.
Referenced by pre_show(), and set_input().
std::string* gui2::twml_message_::input_text_ [private] |
The text input.
Definition at line 89 of file wml_message.hpp.
Referenced by post_show(), pre_show(), and set_input().
std::string gui2::twml_message_::message_ [private] |
The message to show to the user.
Definition at line 75 of file wml_message.hpp.
Referenced by pre_show().
bool gui2::twml_message_::mirror_ [private] |
std::vector<std::string> gui2::twml_message_::option_list_ [private] |
The list of options the user can choose.
Definition at line 95 of file wml_message.hpp.
Referenced by post_show(), pre_show(), and set_option_list().
std::string gui2::twml_message_::portrait_ [private] |
std::string gui2::twml_message_::title_ [private] |
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:22:39 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |