The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
gui2::ttip Class Reference

The tips of day structure. More...

#include <tips.hpp>

Inheritance diagram for gui2::ttip:
Inheritance graph

Public Member Functions

const t_stringtext () const
 
const t_stringsource () const
 
 ttip ()
 
void set_window_id (const std::string &window_id)
 
void set_message (const t_string &message)
 
void set_mouse (const tpoint &mouse)
 
- Public Member Functions inherited from gui2::tpopup
 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

 ttip (const t_string &text, const t_string &source, const std::string &unit_filter)
 
virtual const std::stringwindow_id () const
 Inherited from tpopup. More...
 
void pre_show (twindow &window)
 Inherited from tpopup. More...
 

Private Attributes

t_string text_
 The text of the tip. More...
 
t_string source_
 The source of the tip. More...
 
std::vector< std::stringunit_filter_
 List of units to filter the tip upon. More...
 
std::string window_id_
 The id of the window to use to show the tip. More...
 
t_string message_
 The message to show. More...
 
tpoint mouse_
 The position of the mouse. More...
 

Friends

std::vector< ttiptips::load (const config &)
 
std::vector< ttiptips::shuffle (const std::vector< ttip > &tips)
 

Detailed Description

The tips of day structure.

Class to show the tips.

At the moment two kinds of tips are known:

Definition at line 55 of file tips.hpp.

Constructor & Destructor Documentation

gui2::ttip::ttip ( const t_string text,
const t_string source,
const std::string unit_filter 
)
private

Definition at line 26 of file tips.cpp.

gui2::ttip::ttip ( )
inline

Definition at line 71 of file tip.cpp.

Member Function Documentation

void gui2::ttip::pre_show ( twindow window)
privatevirtual

Inherited from tpopup.

Reimplemented from gui2::tpopup.

Definition at line 107 of file tip.cpp.

References message_, mouse_, gui2::set_label(), gui2::tpoint::x, and gui2::tpoint::y.

void gui2::ttip::set_message ( const t_string message)
inline

Definition at line 80 of file tip.cpp.

References message_.

void gui2::ttip::set_mouse ( const tpoint mouse)
inline

Definition at line 85 of file tip.cpp.

References mouse_.

void gui2::ttip::set_window_id ( const std::string window_id)
inline

Definition at line 75 of file tip.cpp.

References window_id(), and window_id_.

const t_string& gui2::ttip::source ( ) const
inline

Definition at line 62 of file tips.hpp.

References source_.

Referenced by gui2::ttitle_screen::pre_show().

const t_string& gui2::ttip::text ( ) const
inline

Definition at line 58 of file tips.hpp.

References text_.

Referenced by gui2::ttitle_screen::pre_show().

const std::string & gui2::ttip::window_id ( ) const
privatevirtual

Inherited from tpopup.

Implements gui2::tpopup.

Definition at line 115 of file tip.cpp.

References window_id_.

Referenced by set_window_id().

Friends And Related Function Documentation

std::vector<ttip> tips::load ( const config )
friend
std::vector<ttip> tips::shuffle ( const std::vector< ttip > &  tips)
friend

Member Data Documentation

t_string gui2::ttip::message_
private

The message to show.

Definition at line 95 of file tip.cpp.

Referenced by pre_show(), and set_message().

tpoint gui2::ttip::mouse_
private

The position of the mouse.

Definition at line 98 of file tip.cpp.

Referenced by pre_show(), and set_mouse().

t_string gui2::ttip::source_
private

The source of the tip.

Definition at line 78 of file tips.hpp.

Referenced by source().

t_string gui2::ttip::text_
private

The text of the tip.

Definition at line 75 of file tips.hpp.

Referenced by text().

std::vector<std::string> gui2::ttip::unit_filter_
private

List of units to filter the tip upon.

If the list is empty the tip is shown. Else the unit must have encountered at least one of the units in the list.

Definition at line 87 of file tips.hpp.

Referenced by gui2::tips::shuffle().

std::string gui2::ttip::window_id_
private

The id of the window to use to show the tip.

Definition at line 92 of file tip.cpp.

Referenced by set_window_id(), and window_id().


The documentation for this class was generated from the following files: