| 1 |
/* Copyright (C) 1998-2002 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
#include <gtkmm/dialog.h> |
| 18 |
#include <gtkmm/enums.h> |
| 19 |
|
| 20 |
_DEFS(gtkmm,gtk) |
| 21 |
_PINCLUDE(gtkmm/private/dialog_p.h) |
| 22 |
|
| 23 |
namespace Gtk |
| 24 |
{ |
| 25 |
|
| 26 |
_CC_INCLUDE(gtk/gtk.h) |
| 27 |
_WRAP_ENUM(ButtonsType, GtkButtonsType, decl_prefix GTKMM_API) |
| 28 |
|
| 29 |
|
| 30 |
/** Convenient message window. |
| 31 |
* |
| 32 |
* Gtk::MessageDialog presents a dialog with an image representing the type |
| 33 |
* of message (Error, Question, etc.) alongside some message text. It's |
| 34 |
* simply a convenience widget; you could construct the equivalent of |
| 35 |
* Gtk::MessageDialog from Gtk::Dialog without too much effort, but |
| 36 |
* Gtk::MessageDialog saves typing. |
| 37 |
* |
| 38 |
* A MessageDialog looks like this: |
| 39 |
* @image html messagedialog1.png |
| 40 |
* |
| 41 |
* @ingroup Dialogs |
| 42 |
*/ |
| 43 |
class GTKMM_API MessageDialog : public Dialog |
| 44 |
{ |
| 45 |
_CLASS_GTKOBJECT(MessageDialog, GtkMessageDialog, GTK_MESSAGE_DIALOG, Gtk::Dialog, GtkDialog, , , GTKMM_API) |
| 46 |
_UNMANAGEABLE |
| 47 |
public: |
| 48 |
explicit MessageDialog(const Glib::ustring& message, bool use_markup = false, MessageType type = MESSAGE_INFO, ButtonsType buttons = BUTTONS_OK, bool modal = false); |
| 49 |
MessageDialog(Gtk::Window& parent, const Glib::ustring& message, bool use_markup = false, MessageType type = MESSAGE_INFO, ButtonsType buttons = BUTTONS_OK, bool modal = false); |
| 50 |
_IGNORE(gtk_message_dialog_new, gtk_message_dialog_new_with_markup) |
| 51 |
|
| 52 |
_WRAP_METHOD(void set_image(Widget& image), gtk_message_dialog_set_image, deprecated "Use Dialog to create dialogs with images.") |
| 53 |
_WRAP_METHOD(Widget* get_image(), gtk_message_dialog_get_image, deprecated "Use Dialog for dialogs with images.") |
| 54 |
_WRAP_METHOD(const Widget* get_image() const, gtk_message_dialog_get_image, constversion, deprecated "Use Dialog for dialogs with images.") |
| 55 |
|
| 56 |
_IGNORE(gtk_message_dialog_set_markup) |
| 57 |
|
| 58 |
/** Sets the primary text of the message dialog. |
| 59 |
* |
| 60 |
* @param message The message. |
| 61 |
* @param use_markup Whether @a message contains pango markup. |
| 62 |
*/ |
| 63 |
void set_message(const Glib::ustring& message, bool use_markup = false); |
| 64 |
_IGNORE() |
| 65 |
|
| 66 |
/** Sets the secondary text of the message dialog. |
| 67 |
* Note that setting a secondary text makes the primary text become bold, unless you have provided explicit markup. |
| 68 |
* |
| 69 |
* @newin{2,6} |
| 70 |
* |
| 71 |
* @param text The message. |
| 72 |
* @param use_markup Whether @a message contains pango markup. |
| 73 |
*/ |
| 74 |
void set_secondary_text(const Glib::ustring& text, bool use_markup = false); |
| 75 |
_IGNORE(gtk_message_dialog_format_secondary_text, gtk_message_dialog_format_secondary_markup) |
| 76 |
|
| 77 |
_WRAP_METHOD(Box* get_message_area(), gtk_message_dialog_get_message_area) |
| 78 |
_WRAP_METHOD(const Box* get_message_area() const, gtk_message_dialog_get_message_area, constversion) |
| 79 |
|
| 80 |
_WRAP_PROPERTY("message-type", MessageType) |
| 81 |
//Not wrapped because it is write-only and construct: _WRAP_PROPERTY("buttons", ButtonsType) |
| 82 |
_WRAP_PROPERTY("text", Glib::ustring) |
| 83 |
_WRAP_PROPERTY("use-markup", bool) |
| 84 |
_WRAP_PROPERTY("secondary-text", Glib::ustring) |
| 85 |
_WRAP_PROPERTY("secondary-use-markup", bool) |
| 86 |
_WRAP_PROPERTY("image", Widget*, deprecated "Use Dialog to create dialogs with images.") |
| 87 |
_WRAP_PROPERTY("message-area", Box*) |
| 88 |
|
| 89 |
}; |
| 90 |
|
| 91 |
} // namespace Gtk |