The popup class shows windows that are shown non-modal. More...
#include <popup.hpp>


Public Member Functions | |
| tpopup () | |
| virtual | ~tpopup () |
| void | show (CVideo &video, const bool allow_interaction=false, const unsigned auto_close_time=0) |
| Shows the window. | |
| void | hide () |
| Hides the window. | |
Private Member Functions | |
| virtual const std::string & | window_id () const =0 |
| The id of the window to build. | |
| twindow * | build_window (CVideo &video) const |
| Builds the window. | |
| virtual void | post_build (CVideo &, twindow &) |
| Actions to be taken directly after the window is build. | |
| virtual void | pre_show (CVideo &, twindow &) |
| Actions to be taken before showing the window. | |
Private Attributes | |
| twindow * | window_ |
| The window, used in show. | |
Friends | |
| std::string | unit_test_mark_popup_as_tested (const tpopup &dialog) |
| Special helper function to get the id of the window. | |
| twindow * | unit_test_window (const tpopup &dialog) |
| Special helper function for the unit test to the the window. | |
The popup class shows windows that are shown non-modal.
At the moment these windows also don't capture the mouse and keyboard so can only be used for things like tooltips. This behaviour might change later.
Definition at line 33 of file popup.hpp.
| gui2::tpopup::~tpopup | ( | ) | [virtual] |
Builds the window.
Every dialog shows it's own kind of window, this function should return the window to show.
| video | The video which contains the surface to draw upon. |
Definition at line 67 of file popup.cpp.
References gui2::build(), and window_id().
Referenced by show().


| void gui2::tpopup::hide | ( | ) |
Hides the window.
The hiding also destroys the window. It is save to call the function when the window is not shown.
Definition at line 58 of file popup.cpp.
References gui2::twindow::undraw(), and window_.
Referenced by show(), and ~tpopup().


Actions to be taken before showing the window.
| video | The video which contains the surface to draw upon. | |
| window | The window to be shown. |
Reimplemented in gui2::tdebug_clock, and gui2::ttip.
Definition at line 119 of file popup.hpp.
Referenced by show().

| void gui2::tpopup::show | ( | CVideo & | video, | |
| const bool | allow_interaction = false, |
|||
| const unsigned | auto_close_time = 0 | |||
| ) |
Shows the window.
| video | The video which contains the surface to draw upon. | |
| allow_interaction | Does the dialog allow interaction? * true a non modal window is shown * false a tooltip windw is shown | |
| auto_close_time | The time in ms after which the dialog will automatically close, if 0 it doesn't close. |
Definition at line 35 of file popup.cpp.
References build_window(), CVideo::faked(), hide(), post_build(), pre_show(), gui2::twindow::show_non_modal(), gui2::twindow::show_tooltip(), and window_.
Referenced by gui2::ttitle_screen::show_debug_clock_window().


| virtual const std::string& gui2::tpopup::window_id | ( | ) | const [private, pure virtual] |
The id of the window to build.
Implemented in gui2::tdebug_clock, and gui2::ttip.
Referenced by build_window().

| std::string unit_test_mark_popup_as_tested | ( | const tpopup & | dialog | ) | [friend] |
Special helper function to get the id of the window.
This is used in the unit tests, but these implementation details shouldn't be used in the normal code.
Definition at line 87 of file test_gui2.cpp.
Special helper function for the unit test to the the window.
This is used in the unit tests, but these implementation details shouldn't be used in the normal code.
Definition at line 96 of file test_gui2.cpp.
twindow* gui2::tpopup::window_ [private] |
The window, used in show.
Reimplemented in gui2::tdebug_clock.
Definition at line 86 of file popup.hpp.
Referenced by hide(), show(), and gui2::unit_test_mp_server_list().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:22:37 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |