The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Functions
tooltips Namespace Reference

tooltips. More...

Classes

struct  manager
 

Functions

void clear_tooltips ()
 
void clear_tooltips (const SDL_Rect &rect)
 
bool update_tooltip (int id, const SDL_Rect &rect, const std::string &message, const std::string &action, bool use_markup)
 
bool update_tooltip (int id, const SDL_Rect &rect, const std::string &message, const std::string &action, bool use_markup, const surface &foreground)
 
void remove_tooltip (int id)
 
int add_tooltip (const SDL_Rect &rect, const std::string &message, const std::string &action, bool use_markup, const surface &foreground)
 
void process (int mousex, int mousey)
 
bool click (int mousex, int mousey)
 

Detailed Description

tooltips.

This module can be used to register tooltips, which will be shown provided process() is called every time mouse motion events are received from the events system. If tooltips::draw_text() is used instead of font::draw_text(), the text will also be registered as a tooltip.

Function Documentation

int tooltips::add_tooltip ( const SDL_Rect &  rect,
const std::string message,
const std::string action,
bool  use_markup,
const surface foreground 
)
void tooltips::clear_tooltips ( )
void tooltips::clear_tooltips ( const SDL_Rect &  rect)

Definition at line 132 of file tooltips.cpp.

References clear_tooltip(), i, and sdl::rects_overlap().

bool tooltips::click ( int  mousex,
int  mousey 
)
void tooltips::process ( int  mousex,
int  mousey 
)
void tooltips::remove_tooltip ( int  id)

Definition at line 174 of file tooltips.cpp.

References clear_tooltip().

Referenced by terrain_label::calculate_shroud(), and terrain_label::clear().

bool tooltips::update_tooltip ( int  id,
const SDL_Rect &  rect,
const std::string message,
const std::string action,
bool  use_markup 
)

Definition at line 149 of file tooltips.cpp.

Referenced by terrain_label::calculate_shroud().

bool tooltips::update_tooltip ( int  id,
const SDL_Rect &  rect,
const std::string message,
const std::string action,
bool  use_markup,
const surface foreground 
)

Definition at line 161 of file tooltips.cpp.