The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
transient_message.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 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 #ifndef GUI_DIALOGS_TRANSIENT_MESSAGE_HPP_INCLUDED
16 #define GUI_DIALOGS_TRANSIENT_MESSAGE_HPP_INCLUDED
17 
18 #include "gui/dialogs/dialog.hpp"
19 
20 namespace gui2
21 {
22 
23 /** Shows a transient message. */
25 {
26 public:
27  ttransient_message(const std::string& title,
28  const bool title_use_markup,
29  const std::string& message,
30  const bool message_use_markup,
31  const std::string& image);
32 
33 private:
36 
37  /** Inherited from tdialog, implemented by REGISTER_DIALOG. */
38  virtual const std::string& window_id() const;
39 
40  /** Inherited from tdialog. */
41  virtual void pre_show(twindow& window);
42 };
43 
44 /**
45  * Shows a transient message to the user.
46  *
47  * This shows a dialog with a short message which can be dismissed with a
48  * single click.
49  *
50  * @note The message _should_ be small enough to fit on the window, the text
51  * can contain newlines and will wrap when needed.
52  *
53  * @param video The video which contains the surface to draw
54  * upon.
55  * @param title The title of the dialog.
56  * @param message The message to show in the dialog.
57  * @param image An image to show in the dialog.
58  * @param message_use_markup Use markup for the message?
59  * @param title_use_markup Use markup for the title?
60  * @param restore_background Restore the background to the state it was before
61  * the message appeared
62  */
63 void show_transient_message(CVideo& video,
64  const std::string& title,
65  const std::string& message,
66  const std::string& image = std::string(),
67  const bool message_use_markup = false,
68  const bool title_use_markup = false,
69  const bool restore_background = false);
70 
71 /**
72  * Shows a transient error message to the user.
73  *
74  * This shows a dialog with a short message which can be dismissed with a
75  * single click.
76  *
77  * @param video The video which contains the surface to draw
78  * upon.
79  * @param message The message to show in the dialog.
80  * @param image An image to show in the dialog.
81  * @param message_use_markup Use markup for the message?
82  */
84  const std::string& message,
85  const std::string& image = std::string(),
86  const bool message_use_markup = false);
87 
88 } // namespace gui2
89 
90 #endif
virtual void pre_show(twindow &window)
Inherited from tdialog.
Definition: video.hpp:58
void show_transient_error_message(CVideo &video, const std::string &message, const std::string &image, const bool message_use_markup)
Shows a transient error message to the user.
Shows a transient message.
void show_transient_message(CVideo &video, const std::string &title, const std::string &message, const std::string &image, const bool message_use_markup, const bool title_use_markup, const bool restore_background)
Shows a transient message to the user.
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition: window.hpp:62
A class inherited from ttext_box that displays its input as stars.
Definition: field-fwd.hpp:23
Abstract base class for all dialogs.
Definition: dialog.hpp:121
virtual const std::string & window_id() const
Inherited from tdialog, implemented by REGISTER_DIALOG.
ttransient_message(const std::string &title, const bool title_use_markup, const std::string &message, const bool message_use_markup, const std::string &image)
this module manages the cache of images.
Definition: image.cpp:75
GLsizei GLenum GLuint GLuint GLsizei char * message
Definition: glew.h:2499
GLsizei const GLcharARB ** string
Definition: glew.h:4503