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