tooltips. More...
Classes | |
class | manager |
Functions | |
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) |
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.
int tooltips::add_tooltip | ( | const SDL_Rect & | origin, |
const std::string & | message, | ||
const std::string & | action | ||
) |
Definition at line 299 of file tooltips.cpp.
References clear_tooltips(), DBG_FT, id, gui2::dialogs::tip::tip, gui2::settings::tips, and tooltip.
Referenced by terrain_label::calculate_shroud(), display::draw_label(), display::draw_report(), editor::mouse_action_unit::move(), font::pango_draw_text(), and gui::widget::process_tooltip_string().
void tooltips::clear_tooltips | ( | ) |
Definition at line 241 of file tooltips.cpp.
References clear_active(), LOG_FT, and gui2::settings::tips.
Referenced by add_tooltip(), tooltips::manager::manager(), editor::mouse_action_unit::move(), display::queue_rerender(), display::refresh_report(), and tooltips::manager::~manager().
void tooltips::clear_tooltips | ( | const SDL_Rect & | r | ) |
Definition at line 248 of file tooltips.cpp.
References DBG_FT, i, and gui2::settings::tips.
bool tooltips::click | ( | int | mousex, |
int | mousey | ||
) |
Definition at line 356 of file tooltips.cpp.
References help::show_help(), gui2::dialogs::tip::tip, and gui2::settings::tips.
Referenced by gui2::event::fire_event_double_click(), events::mouse_handler_base::mouse_button_event(), events::mouse_handler::mouse_button_event(), events::mouse_handler::select_or_action(), gui2::event_executor::set_wants_mouse_left_double_click(), gui2::event_executor::set_wants_mouse_middle_double_click(), and gui2::event_executor::set_wants_mouse_right_double_click().
void tooltips::process | ( | int | mousex, |
int | mousey | ||
) |
Definition at line 340 of file tooltips.cpp.
References clear_active(), LOG_FT, select_active(), gui2::dialogs::tip::tip, and gui2::settings::tips.
Referenced by events::mouse_handler_base::mouse_motion_default(), and events::mouse_handler::touch_motion().
|
static |
Definition at line 318 of file tooltips.cpp.
References draw_manager::raise_drawable().
Referenced by select_active().
void tooltips::remove_tooltip | ( | int | id | ) |
Definition at line 289 of file tooltips.cpp.
References clear_active(), DBG_FT, id, and gui2::settings::tips.
Referenced by terrain_label::calculate_shroud(), and terrain_label::clear().
|
static |
Definition at line 327 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().
bool tooltips::update_tooltip | ( | int | id, |
const SDL_Rect & | origin, | ||
const std::string & | message | ||
) |
Definition at line 267 of file tooltips.cpp.
References DBG_FT, LOG_FT, gui2::dialogs::tip::tip, gui2::settings::tips, and tooltip.
Referenced by terrain_label::calculate_shroud().