| 1 |
/* Copyright (C) 2009 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/box.h> |
| 18 |
#include <gtkmm/button.h> |
| 19 |
#include <gtkmm/enums.h> |
| 20 |
|
| 21 |
_DEFS(gtkmm,gtk) |
| 22 |
_PINCLUDE(gtkmm/private/hvbox_p.h) |
| 23 |
|
| 24 |
|
| 25 |
namespace Gtk |
| 26 |
{ |
| 27 |
|
| 28 |
/** This widget that can be used to show messages to the user without showing a dialog. |
| 29 |
* It is often temporarily shown at the top or bottom of a document. In contrast to |
| 30 |
* Dialog, which has a horizontal action area at the bottom, InfoBar has a vertical |
| 31 |
* action area at the side. |
| 32 |
* |
| 33 |
* The API is very similar to Dialog, allowing you to add buttons to the action |
| 34 |
* area with add_button(). The sensitivity of action widgets can be controlled |
| 35 |
* with set_response_sensitive(). To add widgets to the main content area, use |
| 36 |
* get_content_area() and add your widgets to the container. |
| 37 |
* |
| 38 |
* Similar to MessageDialog, the contents can by classified as error message, |
| 39 |
* warning, informational message, etc, by using set_message_type(). This |
| 40 |
* determines the background color of the message area. |
| 41 |
* |
| 42 |
* The InfoBar widget looks like |
| 43 |
* @image html infobar1.png |
| 44 |
* |
| 45 |
* @newin{2,18} |
| 46 |
* |
| 47 |
* @ingroup Widgets |
| 48 |
*/ |
| 49 |
class GTKMM_API InfoBar : public HBox //Note: The C object derives from GtkBox. |
| 50 |
{ |
| 51 |
_CLASS_GTKOBJECT(InfoBar, GtkInfoBar, GTK_INFO_BAR, Gtk::HBox, GtkHBox, , , GTKMM_API) |
| 52 |
public: |
| 53 |
|
| 54 |
_CTOR_DEFAULT |
| 55 |
_IGNORE(gtk_info_bar_new, gtk_info_bar_new_with_buttons) |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
//TODO: What types are these widgets really? |
| 60 |
_WRAP_METHOD(Widget* get_action_area(), gtk_info_bar_get_action_area) |
| 61 |
_WRAP_METHOD(const Widget* get_action_area() const, gtk_info_bar_get_action_area) |
| 62 |
|
| 63 |
_WRAP_METHOD(Widget* get_content_area(), gtk_info_bar_get_content_area) |
| 64 |
_WRAP_METHOD(const Widget* get_content_area() const, gtk_info_bar_get_content_area) |
| 65 |
|
| 66 |
_WRAP_METHOD(void add_action_widget(Widget& child, int response_id), gtk_info_bar_add_action_widget) |
| 67 |
|
| 68 |
_WRAP_METHOD(Button* add_button(const Glib::ustring& button_text, int response_id), gtk_info_bar_add_button) |
| 69 |
_WRAP_METHOD(Button* add_button(const Gtk::StockID& stock_id, int response_id), gtk_info_bar_add_button, deprecated "Use the add_button() that takes a Glib::ustring instead.") |
| 70 |
|
| 71 |
_IGNORE(gtk_info_bar_add_buttons) |
| 72 |
_WRAP_METHOD(void set_response_sensitive(int response_id, bool setting = true), gtk_info_bar_set_response_sensitive) |
| 73 |
_WRAP_METHOD(void set_default_response(int response_id), gtk_info_bar_set_default_response) |
| 74 |
|
| 75 |
_WRAP_METHOD(void response(int response_id), gtk_info_bar_response) |
| 76 |
|
| 77 |
_WRAP_METHOD(void set_message_type(MessageType message_type), gtk_info_bar_set_message_type) |
| 78 |
_WRAP_METHOD(MessageType get_message_type() const, gtk_info_bar_get_message_type) |
| 79 |
|
| 80 |
_WRAP_METHOD(void set_show_close_button(bool setting = true), gtk_info_bar_set_show_close_button) |
| 81 |
_WRAP_METHOD(bool get_show_close_button() const, gtk_info_bar_get_show_close_button) |
| 82 |
|
| 83 |
|
| 84 |
_IGNORE_SIGNAL("close") |
| 85 |
|
| 86 |
_WRAP_SIGNAL(void response(int response_id), "response") |
| 87 |
|
| 88 |
_WRAP_PROPERTY("message-type", MessageType) |
| 89 |
_WRAP_PROPERTY("show-close-button", bool) |
| 90 |
}; |
| 91 |
|
| 92 |
} // namespace Gtk |