The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
message.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2016 by Mark de Wever <[email protected]>
3  Part of the Battle for Wesnoth Project http://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 /**
16  * @file
17  * This file contains the defintions for the @ref gui2::event::tmessage class.
18  *
19  * The class is used in the @ref gui2::event::tsignal_message_function
20  */
21 
22 #ifndef GUI_WIDGETS_AUXILIARY_EVENT_MESSAGE_HPP_INCLUDED
23 #define GUI_WIDGETS_AUXILIARY_EVENT_MESSAGE_HPP_INCLUDED
24 
25 #include "gui/widgets/helper.hpp"
26 
27 namespace gui2
28 {
29 
30 namespace event
31 {
32 
33 /**
34  * The message callbacks hold a reference to a message.
35  *
36  * The contents of the message differ per type. This class is a base with a
37  * virtual destructor, which makes it possible to use a dynamic_cast on the
38  * class received to make sure the proper message type is send.
39  *
40  * This means all messages used in the events need to be derived from this
41  * class. When a message needs no `content' it can send this class as message.
42  * This is done by:
43  * * @ref REQUEST_PLACEMENT
44  */
45 struct tmessage
46 {
47  virtual ~tmessage()
48  {
49  }
50 };
51 
52 /** The message for MESSAGE_SHOW_TOOLTIP. */
54 {
55  tmessage_show_tooltip(const std::string& message_, const tpoint& location_)
56  : message(message_), location(location_)
57  {
58  }
59 
60  /** The message to show on the tooltip. */
62 
63  /** The location where to show the tooltip. */
65 };
66 
67 /** The message for MESSAGE_SHOW_HELPTIP. */
69 {
70  tmessage_show_helptip(const std::string& message_, const tpoint& location_)
71  : message(message_), location(location_)
72  {
73  }
74 
75  /** The message to show on the helptip. */
77 
78  /** The location where to show the helptip. */
80 };
81 
82 } // namespace event
83 
84 } // namespace gui2
85 
86 #endif
tmessage_show_tooltip(const std::string &message_, const tpoint &location_)
Definition: message.hpp:55
A class inherited from ttext_box that displays its input as stars.
Definition: field-fwd.hpp:23
const std::string message
The message to show on the helptip.
Definition: message.hpp:76
const tpoint location
The location where to show the tooltip.
Definition: message.hpp:64
The message for MESSAGE_SHOW_TOOLTIP.
Definition: message.hpp:53
const std::string message
The message to show on the tooltip.
Definition: message.hpp:61
Encapsulates the map of the game.
Definition: location.hpp:38
tmessage_show_helptip(const std::string &message_, const tpoint &location_)
Definition: message.hpp:70
Holds a 2D point.
Definition: point.hpp:24
const tpoint location
The location where to show the helptip.
Definition: message.hpp:79
The message callbacks hold a reference to a message.
Definition: message.hpp:45
The message for MESSAGE_SHOW_HELPTIP.
Definition: message.hpp:68
cl_event event
Definition: glew.h:3070
GLsizei GLenum GLuint GLuint GLsizei char * message
Definition: glew.h:2499
virtual ~tmessage()
Definition: message.hpp:47
GLsizei const GLcharARB ** string
Definition: glew.h:4503