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) |
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 & | rect, |
const std::string & | message, | ||
const std::string & | action, | ||
bool | use_markup, | ||
const surface & | foreground | ||
) |
Definition at line 180 of file tooltips.cpp.
References sdl::rects_overlap().
Referenced by terrain_label::calculate_shroud(), draw_label(), font::draw_text_line(), editor::mouse_action_unit::move(), gui::widget::process_tooltip_string(), and display::refresh_report().
void tooltips::clear_tooltips | ( | ) |
Definition at line 125 of file tooltips.cpp.
References clear_tooltip().
Referenced by editor::palette_manager::draw_contents(), tooltips::manager::manager(), editor::mouse_action_unit::move(), display::redraw_everything(), display::refresh_report(), tooltips::manager::~manager(), and gui::preview_pane::~preview_pane().
void tooltips::clear_tooltips | ( | const SDL_Rect & | rect | ) |
Definition at line 132 of file tooltips.cpp.
References clear_tooltip(), i, and sdl::rects_overlap().
Definition at line 216 of file tooltips.cpp.
References i, sdl::point_in_rect(), resources::screen, help::show_help(), and display::video().
Referenced by gui2::event::fire_event_double_click(), events::mouse_handler_base::left_click(), gui2::tevent_executor::set_wants_mouse_left_double_click(), gui2::tevent_executor::set_wants_mouse_middle_double_click(), and gui2::tevent_executor::set_wants_mouse_right_double_click().
Definition at line 198 of file tooltips.cpp.
References clear_tooltip(), i, and show_tooltip().
Referenced by events::mouse_handler_base::mouse_motion_default(), help::help_menu::process(), mp::create::process_event(), and mp::configure::process_event().
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.