Public Member Functions | Private Member Functions | Private Attributes | Friends

gui2::tpopup Class Reference

The popup class shows windows that are shown non-modal. More...

#include <popup.hpp>

Inheritance diagram for gui2::tpopup:
Inheritance graph
[legend]
Collaboration diagram for gui2::tpopup:
Collaboration graph
[legend]

List of all members.

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.
twindowbuild_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

twindowwindow_
 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.
twindowunit_test_window (const tpopup &dialog)
 Special helper function for the unit test to the the window.

Detailed Description

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.


Constructor & Destructor Documentation

gui2::tpopup::tpopup (  ) 

Definition at line 25 of file popup.cpp.

gui2::tpopup::~tpopup (  )  [virtual]

Definition at line 30 of file popup.cpp.

References hide().

Here is the call graph for this function:


Member Function Documentation

twindow * gui2::tpopup::build_window ( CVideo video  )  const [private]

Builds the window.

Every dialog shows it's own kind of window, this function should return the window to show.

Parameters:
video The video which contains the surface to draw upon.
Returns:
The window to show.

Definition at line 67 of file popup.cpp.

References gui2::build(), and window_id().

Referenced by show().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void gui2::tpopup::post_build ( CVideo ,
twindow  
) [inline, private, virtual]

Actions to be taken directly after the window is build.

Parameters:
video The video which contains the surface to draw upon.
window The window just created.

Definition at line 110 of file popup.hpp.

Referenced by show().

Here is the caller graph for this function:

virtual void gui2::tpopup::pre_show ( CVideo ,
twindow  
) [inline, private, virtual]

Actions to be taken before showing the window.

Parameters:
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().

Here is the caller graph for this function:

void gui2::tpopup::show ( CVideo video,
const bool  allow_interaction = false,
const unsigned  auto_close_time = 0 
)

Shows the window.

Parameters:
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.
Note:
the timeout is a minimum time and there's no quarantee about how fast it closes after the minimum.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:


Friends And Related Function Documentation

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.

twindow* unit_test_window ( const tpopup dialog  )  [friend]

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.


Member Data Documentation

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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:22:37 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs