| 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/box.h> |
| 18 |
|
| 19 |
_DEFS(gtkmm,gtk) |
| 20 |
_PINCLUDE(gtkmm/private/hvbox_p.h) |
| 21 |
|
| 22 |
namespace Gtk |
| 23 |
{ |
| 24 |
|
| 25 |
/** Text status indicator |
| 26 |
* This widget is used to display status information. |
| 27 |
* Messages are pushed and poped onto a message stack. |
| 28 |
* When text is pushed it replaces the old contents. |
| 29 |
* The old text is restored when popped. |
| 30 |
* |
| 31 |
* It derives from Gtk::HBox so that additional information can be added |
| 32 |
* easily. |
| 33 |
* |
| 34 |
* The Statusbar widget looks like this: |
| 35 |
* @image html statusbar1.png |
| 36 |
* |
| 37 |
* @ingroup Widgets |
| 38 |
*/ |
| 39 |
class GTKMM_API Statusbar : public HBox //Note: The C object derives from GtkBox. |
| 40 |
{ |
| 41 |
_CLASS_GTKOBJECT(Statusbar,GtkStatusbar,GTK_STATUSBAR,Gtk::HBox,GtkHBox,,,GTKMM_API) |
| 42 |
_IGNORE(gtk_statusbar_push) |
| 43 |
public: |
| 44 |
_CTOR_DEFAULT |
| 45 |
|
| 46 |
_WRAP_METHOD(guint get_context_id(const Glib::ustring& context_description), gtk_statusbar_get_context_id) |
| 47 |
|
| 48 |
//TODO: Remove the default 0 context_id values in all these methods? |
| 49 |
|
| 50 |
/** Pushes a new message onto a statusbar's stack. |
| 51 |
* @param text The message to add to the statusbar. |
| 52 |
* @param context_id The message's context id, as returned by get_context_id() |
| 53 |
*/ |
| 54 |
guint push(const Glib::ustring& text, guint context_id = 0); |
| 55 |
|
| 56 |
_WRAP_METHOD(void pop(guint context_id = 0), gtk_statusbar_pop) |
| 57 |
|
| 58 |
/** Forces the removal of a message from a statusbar's stack. |
| 59 |
* The exact context_id and message_id must be specified. |
| 60 |
* @param message_id A message identifier, as returned by push(). |
| 61 |
* @param context_id A context identifier. |
| 62 |
*/ |
| 63 |
void remove_message(guint message_id, guint context_id = 0); |
| 64 |
_IGNORE(gtk_statusbar_remove) |
| 65 |
|
| 66 |
_WRAP_METHOD(void remove_all_messages(guint context_id = 0), gtk_statusbar_remove_all) |
| 67 |
|
| 68 |
//This actually returns a GtkFrame, though the documentation describes it as "box". |
| 69 |
//I'm not generally happy about API that returns an unknown type. murrayc. |
| 70 |
_WRAP_METHOD(Gtk::Widget* get_message_area(), gtk_statusbar_get_message_area) |
| 71 |
_WRAP_METHOD(const Gtk::Widget* get_message_area() const, gtk_statusbar_get_message_area, constversion) |
| 72 |
|
| 73 |
#m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING) |
| 74 |
_WRAP_SIGNAL(void text_pushed(guint context_id, const Glib::ustring& text), "text_pushed") |
| 75 |
_WRAP_SIGNAL(void text_popped(guint context_id, const Glib::ustring& text), "text_popped") |
| 76 |
}; |
| 77 |
|
| 78 |
} //namespace Gtk |