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. More... | |
void | hide () |
Hides the window. More... | |
Private Member Functions | |
virtual const std::string & | window_id () const =0 |
The id of the window to build. More... | |
twindow * | build_window (CVideo &video) const |
Builds the window. More... | |
virtual void | post_build (twindow &window) |
Actions to be taken directly after the window is build. More... | |
virtual void | pre_show (twindow &window) |
Actions to be taken before showing the window. More... | |
Private Attributes | |
twindow * | window_ |
The window, used in show. More... | |
Friends | |
std::string | unit_test_mark_popup_as_tested (const tpopup &dialog) |
Special helper function to get the id of the window. More... | |
twindow * | unit_test_window (const tpopup &dialog) |
Special helper function for the unit test to the the window. More... | |
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 behavior might change later.
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 66 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 57 of file popup.cpp.
References gui2::twindow::undraw(), and window_.
Referenced by gui2::tip::remove(), 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 76 of file popup.cpp.
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?
|
auto_close_time | The time in ms after which the dialog will automatically close, if 0 it doesn't close. |
Definition at line 34 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().
|
privatepure virtual |
The id of the window to build.
Implemented in gui2::tdebug_clock, and gui2::ttip.
Referenced by build_window(), and gui2::unit_test_mark_popup_as_tested().
|
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 116 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 125 of file test_gui2.cpp.
|
private |
The window, used in show.
Definition at line 85 of file popup.hpp.
Referenced by hide(), show(), and gui2::unit_test_window().