The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
tooltip.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2011 - 2025
3 by Mark de Wever <koraq@xs4all.nl>
4 Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY.
12
13 See the COPYING file for more details.
14*/
15
16#pragma once
17
18#include <string>
19
20class t_string;
21struct point;
22struct rect;
23
24namespace gui2::dialogs::tip
25{
26/**
27 * Shows a tip.
28 *
29 * The tip is a tooltip or a helptip. One type of tip is shown at the same
30 * time, opening a second tip closes the first.
31 *
32 * @param window_id The id of the window used to show the tip.
33 * @param message The message to show in the tip.
34 * @param mouse The position of the mouse.
35 * @param source_rect The thing being hovered over to show the tip.
36 */
37void show(const std::string& window_id,
38 const t_string& message,
39 const point& mouse,
40 const rect& source_rect);
41
42/**
43 * Removes a tip.
44 *
45 * It is safe to call this function when no tip is shown.
46 * */
47void remove();
48
49} // namespace gui2::dialogs::tip
void remove()
Removes a tip.
Definition tooltip.cpp:94
void show(const std::string &window_id, const t_string &message, const point &mouse, const rect &source_rect)
Shows a tip.
Definition tooltip.cpp:64
Holds a 2D point.
Definition point.hpp:25
An abstract description of a rectangle with integer coordinates.
Definition rect.hpp:49