| 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/label.h> |
| 18 |
|
| 19 |
_DEFS(gtkmm,gtk) |
| 20 |
_PINCLUDE(gtkmm/private/label_p.h) |
| 21 |
|
| 22 |
|
| 23 |
namespace Gtk |
| 24 |
{ |
| 25 |
|
| 26 |
/** A label which displays an accelerator key on the right of the text. |
| 27 |
* Used for menu item labels, for instance. |
| 28 |
* |
| 29 |
* Key values are the codes which are sent whenever a key is pressed or released. |
| 30 |
* The complete list of key values can be found in the |
| 31 |
* <a href="https://gitlab.gnome.org/GNOME/gtk/tree/gtk-3-24/gdk/gdkkeysyms.h">gdk/gdkkeysyms.h</a> |
| 32 |
* header file. They are prefixed with <tt>GDK_KEY_</tt>. |
| 33 |
* |
| 34 |
* @ingroup Widgets |
| 35 |
*/ |
| 36 |
class GTKMM_API AccelLabel : public Label |
| 37 |
{ |
| 38 |
_CLASS_GTKOBJECT(AccelLabel,GtkAccelLabel,GTK_ACCEL_LABEL,Gtk::Label,GtkLabel,,,GTKMM_API) |
| 39 |
_IGNORE(gtk_accel_label_set_accel_closure) |
| 40 |
public: |
| 41 |
|
| 42 |
//The default ctor doesn't correspond to any _new function, but gtkmenuitem.cc does a simple g_object_new() with no properties. |
| 43 |
/** Default constructor to create an AccelLabel object |
| 44 |
*/ |
| 45 |
_CTOR_DEFAULT |
| 46 |
|
| 47 |
/** Constructor to create an AccelLabel object with a default label |
| 48 |
* @param label The label string. |
| 49 |
* @param mnemonic If true, characters preceded by an underscore (_) will be underlined and used as a keyboard accelerator. |
| 50 |
*/ |
| 51 |
explicit AccelLabel(const Glib::ustring& label, bool mnemonic = false); |
| 52 |
|
| 53 |
_WRAP_METHOD(void set_accel_widget(const Widget& accel_widget), gtk_accel_label_set_accel_widget) |
| 54 |
/// Forget the accel widget previously set by set_accel_widget(). |
| 55 |
void unset_accel_widget(); |
| 56 |
|
| 57 |
_WRAP_METHOD(Widget* get_accel_widget(), gtk_accel_label_get_accel_widget) |
| 58 |
_WRAP_METHOD(const Widget* get_accel_widget() const, gtk_accel_label_get_accel_widget, constversion) |
| 59 |
|
| 60 |
_WRAP_METHOD(guint get_accel_width() const, gtk_accel_label_get_accel_width) |
| 61 |
_WRAP_METHOD(bool refetch(), gtk_accel_label_refetch) |
| 62 |
|
| 63 |
_WRAP_METHOD(void set_accel(guint accelerator_key, Gdk::ModifierType accelerator_mods), gtk_accel_label_set_accel) |
| 64 |
#m4 _INITIALIZATION(`Gdk::ModifierType&', `GdkModifierType', `$3 = ($1)$4') |
| 65 |
_WRAP_METHOD(void get_accel(guint& accelerator_key, Gdk::ModifierType& accelerator_mods{>>}), gtk_accel_label_get_accel) |
| 66 |
|
| 67 |
//_WRAP_PROPERTY("accel-closure", Glib::Object) //GClosure |
| 68 |
_WRAP_PROPERTY("accel-widget", Gtk::Widget*) |
| 69 |
}; |
| 70 |
|
| 71 |
} // namespace Gtk |