The Battle for Wesnoth  1.19.0-dev
tooltip.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2024
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 <SDL2/SDL_rect.h>
19 #include <string>
20 
21 class t_string;
22 struct point;
23 
24 namespace gui2
25 {
26 
27 namespace dialogs
28 {
29 
30 namespace tip
31 {
32 
33 /**
34  * Shows a tip.
35  *
36  * The tip is a tooltip or a helptip. One type of tip is shown at the same
37  * time, opening a second tip closes the first.
38  *
39  * @param window_id The id of the window used to show the tip.
40  * @param message The message to show in the tip.
41  * @param mouse The position of the mouse.
42  * @param source_rect The thing being hovered over to show the tip.
43  */
44 void show(const std::string& window_id,
45  const t_string& message,
46  const point& mouse,
47  const SDL_Rect& source_rect);
48 
49 /**
50  * Removes a tip.
51  *
52  * It is safe to call this function when no tip is shown.
53  * */
54 void remove();
55 
56 } // namespace tip
57 } // namespace dialogs
58 } // namespace gui2
Various uncategorised dialogs.
void show(const std::string &window_id, const t_string &message, const point &mouse, const SDL_Rect &source_rect)
Shows a tip.
Definition: tooltip.cpp:79
void remove()
Removes a tip.
Definition: tooltip.cpp:109
static std::unique_ptr< tooltip > tip
Definition: tooltip.cpp:77
Generic file dialog.
Holds a 2D point.
Definition: point.hpp:25