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. More... | |
| void | set_option_list (const std::vector< twml_message_option > &option_list, int *chosen_option) |
| Sets the option list. More... | |
Public Member Functions inherited from gui2::tdialog | |
| tdialog () | |
| virtual | ~tdialog () |
| bool | show (CVideo &video, const unsigned auto_close_time=0) |
| Shows the window. More... | |
| int | get_retval () const |
| void | set_always_save_fields (const bool always_save_fields) |
| void | set_restore (const bool restore) |
Private Member Functions | |
| void | pre_show (twindow &window) |
| Inherited from tdialog. More... | |
| void | post_show (twindow &window) |
| Inherited from tdialog. More... | |
Private Attributes | |
| std::string | title_ |
| The title for the dialog. More... | |
| std::string | image_ |
| The image which is shown in the dialog. More... | |
| std::string | message_ |
| The message to show to the user. More... | |
| std::string | portrait_ |
| Filename of the portrait. More... | |
| bool | mirror_ |
| Mirror the portrait? More... | |
| bool | has_input_ |
| Do we need to show an input box? More... | |
| std::string | input_caption_ |
| The caption to show for the input text. More... | |
| std::string * | input_text_ |
| The text input. More... | |
| unsigned | input_maximum_length_ |
| The maximum length of the input text. More... | |
| std::vector< twml_message_option > | option_list_ |
| The list of options the user can choose. More... | |
| int * | chosen_option_ |
| The chosen option. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from gui2::tdialog | |
| tfield_bool * | register_bool (const std::string &id, const bool mandatory, const std::function< bool()> &callback_load_value=std::function< bool()>(), const std::function< void(const bool)> &callback_save_value=std::function< void(const bool)>(), const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>()) |
| Creates a new boolean field. More... | |
| tfield_bool * | register_bool (const std::string &id, const bool mandatory, bool &linked_variable, const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>()) |
| Creates a new boolean field. More... | |
| tfield_integer * | register_integer (const std::string &id, const bool mandatory, const std::function< int()> &callback_load_value=std::function< int()>(), const std::function< void(const int)> &callback_save_value=std::function< void(const int)>()) |
| Creates a new integer field. More... | |
| tfield_integer * | register_integer (const std::string &id, const bool mandatory, int &linked_variable) |
| Creates a new integer field. More... | |
| tfield_text * | register_text (const std::string &id, const bool mandatory, const std::function< std::string()> &callback_load_value=std::function< std::string()>(), const std::function< void(const std::string &)> &callback_save_value=std::function< void(const std::string &)>(), const bool capture_focus=false) |
| Creates a new text field. More... | |
| tfield_text * | register_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false) |
| Creates a new text field. More... | |
| tfield_label * | register_label (const std::string &id, const bool mandatory, const std::string &text, const bool use_markup=false) |
| Registers a new control as a label. More... | |
| tfield_label * | register_image (const std::string &id, const bool mandatory, const std::string &filename) |
| Registers a new control as image. More... | |
Base class for the wml generated messages.
We have a separate sub class for left and right images.
Definition at line 45 of file wml_message.hpp.
|
inline |
Definition at line 48 of file wml_message.hpp.
Inherited from tdialog.
Reimplemented from gui2::tdialog.
Definition at line 135 of file wml_message.cpp.
References chosen_option_, has_input_, input_text_, and option_list_.
Inherited from tdialog.
Reimplemented from gui2::tdialog.
Definition at line 62 of file wml_message.cpp.
References gui2::tlistbox::add_row(), gui2::tcontrol::canvas(), chosen_option_, has_input_, input_caption_, input_maximum_length_, input_text_, gui2::twidget::tvisible::invisible, message_, mirror_, option_list_, preferences::options(), portrait_, gui2::tlistbox::select_row(), gui2::tlabel::set_can_wrap(), gui2::tcontrol::set_label(), gui2::tdialog::set_restore(), 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. | |
| [in,out] | text | The initial text, after showing the final text. |
| maximum_length | The maximum length of the text. |
Definition at line 34 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< twml_message_option > & | option_list, |
| int * | chosen_option | ||
| ) |
Sets the option list.
| option_list | The list of options to display. | |
| [in,out] | chosen_option | Pointer to the index of the initially selected option; after showing, the chosen option. |
Definition at line 46 of file wml_message.cpp.
References chosen_option_, and option_list_.
|
private |
The chosen option.
Definition at line 123 of file wml_message.hpp.
Referenced by post_show(), pre_show(), and set_option_list().
|
private |
Do we need to show an input box?
Definition at line 108 of file wml_message.hpp.
Referenced by post_show(), pre_show(), and set_input().
|
private |
The image which is shown in the dialog.
This image can be an icon or portrait or any other image.
Definition at line 97 of file wml_message.hpp.
|
private |
The caption to show for the input text.
Definition at line 111 of file wml_message.hpp.
Referenced by pre_show(), and set_input().
|
private |
The maximum length of the input text.
Definition at line 117 of file wml_message.hpp.
Referenced by pre_show(), and set_input().
|
private |
The text input.
Definition at line 114 of file wml_message.hpp.
Referenced by post_show(), pre_show(), and set_input().
|
private |
The message to show to the user.
Definition at line 100 of file wml_message.hpp.
Referenced by pre_show().
|
private |
|
private |
The list of options the user can choose.
Definition at line 120 of file wml_message.hpp.
Referenced by post_show(), pre_show(), and set_option_list().
|
private |
|
private |
1.8.8