File: infobar.hg

package info (click to toggle)
gtkmm3.0 3.24.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 22,680 kB
  • sloc: xml: 121,333; cpp: 8,531; sh: 4,250; makefile: 262; perl: 236
file content (93 lines) | stat: -rw-r--r-- 3,731 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/* Copyright (C) 2009 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <gtkmm/box.h>
#include <gtkmm/button.h>
#include <gtkmm/enums.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/hvbox_p.h)


namespace Gtk
{

/** This widget that can be used to show messages to the user without showing a dialog.
 * It is often temporarily shown at the top or bottom of a document. In contrast to
 * Dialog, which has a horizontal action area at the bottom, InfoBar has a vertical
 * action area at the side.
 *
 * The API is very similar to Dialog, allowing you to add buttons to the action
 * area with add_button(). The sensitivity of action widgets can be controlled
 * with set_response_sensitive(). To add widgets to the main content area, use
 * get_content_area() and add your widgets to the container.
 *
 * Similar to MessageDialog, the contents can by classified as error message,
 * warning, informational message, etc, by using set_message_type(). This
 * determines the background color of the message area.
 *
 * The InfoBar widget looks like
 * @image html infobar1.png
 *
 * @newin{2,18}
 *
 * @ingroup Widgets
 */
class InfoBar : public HBox //Note: The C object derives from GtkBox.
{
  _CLASS_GTKOBJECT(InfoBar, GtkInfoBar, GTK_INFO_BAR, Gtk::HBox, GtkHBox)
public:

  _CTOR_DEFAULT
  _IGNORE(gtk_info_bar_new, gtk_info_bar_new_with_buttons)



//TODO: What types are these widgets really?
  _WRAP_METHOD(Widget* get_action_area(), gtk_info_bar_get_action_area)
  _WRAP_METHOD(const Widget* get_action_area() const, gtk_info_bar_get_action_area)

  _WRAP_METHOD(Widget* get_content_area(), gtk_info_bar_get_content_area)
  _WRAP_METHOD(const Widget* get_content_area() const, gtk_info_bar_get_content_area)

  _WRAP_METHOD(void add_action_widget(Widget& child, int response_id), gtk_info_bar_add_action_widget)

  _WRAP_METHOD(Button* add_button(const Glib::ustring& button_text, int response_id), gtk_info_bar_add_button)
  _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.")

  _IGNORE(gtk_info_bar_add_buttons)
  _WRAP_METHOD(void set_response_sensitive(int response_id, bool setting = true), gtk_info_bar_set_response_sensitive)
  _WRAP_METHOD(void set_default_response(int response_id), gtk_info_bar_set_default_response)

  _WRAP_METHOD(void response(int response_id), gtk_info_bar_response)

  _WRAP_METHOD(void set_message_type(MessageType message_type), gtk_info_bar_set_message_type)
  _WRAP_METHOD(MessageType get_message_type() const, gtk_info_bar_get_message_type)

  _WRAP_METHOD(void set_show_close_button(bool setting = true), gtk_info_bar_set_show_close_button)
  _WRAP_METHOD(bool get_show_close_button() const, gtk_info_bar_get_show_close_button)


  _IGNORE_SIGNAL("close")

  _WRAP_SIGNAL(void response(int response_id), "response")

  _WRAP_PROPERTY("message-type", MessageType)
  _WRAP_PROPERTY("show-close-button", bool)
};

} // namespace Gtk