The Battle for Wesnoth  1.19.2+dev
Classes | Functions
tooltips Namespace Reference

tooltips. More...


class  manager


void clear_tooltips ()
void clear_tooltips (const SDL_Rect &r)
bool update_tooltip (int id, const SDL_Rect &origin, const std::string &message)
void remove_tooltip (int id)
int add_tooltip (const SDL_Rect &origin, const std::string &message, const std::string &action)
static void raise_to_top ()
static void select_active (int id)
void process (int mousex, int mousey)
bool click (int mousex, int mousey)

Detailed Description


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

◆ add_tooltip()

int tooltips::add_tooltip ( const SDL_Rect &  origin,
const std::string &  message,
const std::string &  action 

◆ clear_tooltips() [1/2]

void tooltips::clear_tooltips ( )

◆ clear_tooltips() [2/2]

void tooltips::clear_tooltips ( const SDL_Rect &  r)

Definition at line 186 of file tooltips.cpp.

References DBG_FT, i, and gui2::settings::tips.

◆ click()

bool tooltips::click ( int  mousex,
int  mousey 

◆ process()

void tooltips::process ( int  mousex,
int  mousey 

◆ raise_to_top()

static void tooltips::raise_to_top ( )

Definition at line 256 of file tooltips.cpp.

References draw_manager::raise_drawable().

Referenced by select_active().

◆ remove_tooltip()

void tooltips::remove_tooltip ( int  id)

Definition at line 227 of file tooltips.cpp.

References clear_active(), DBG_FT, id, and gui2::settings::tips.

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

◆ select_active()

static void tooltips::select_active ( int  id)

Definition at line 265 of file tooltips.cpp.

References clear_active(), id, LOG_FT, raise_to_top(), gui2::dialogs::tip::tip, gui2::settings::tips, and tooltip.

Referenced by process().

◆ update_tooltip()

bool tooltips::update_tooltip ( int  id,
const SDL_Rect &  origin,
const std::string &  message