/* Copyright (C) 1998-2002 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, see .
*/
#include
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/label_p.h)
namespace Gtk
{
/** A label which displays an accelerator key on the right of the text.
* Used for menu item labels, for instance.
*
* Key values are the codes which are sent whenever a key is pressed or released.
* The complete list of key values can be found in the
* gdk/gdkkeysyms.h
* header file. They are prefixed with GDK_KEY_.
*
* @ingroup Widgets
*/
class GTKMM_API AccelLabel : public Label
{
_CLASS_GTKOBJECT(AccelLabel,GtkAccelLabel,GTK_ACCEL_LABEL,Gtk::Label,GtkLabel,,,GTKMM_API)
_IGNORE(gtk_accel_label_set_accel_closure)
public:
//The default ctor doesn't correspond to any _new function, but gtkmenuitem.cc does a simple g_object_new() with no properties.
/** Default constructor to create an AccelLabel object
*/
_CTOR_DEFAULT
/** Constructor to create an AccelLabel object with a default label
* @param label The label string.
* @param mnemonic If true, characters preceded by an underscore (_) will be underlined and used as a keyboard accelerator.
*/
explicit AccelLabel(const Glib::ustring& label, bool mnemonic = false);
_WRAP_METHOD(void set_accel_widget(const Widget& accel_widget), gtk_accel_label_set_accel_widget)
/// Forget the accel widget previously set by set_accel_widget().
void unset_accel_widget();
_WRAP_METHOD(Widget* get_accel_widget(), gtk_accel_label_get_accel_widget)
_WRAP_METHOD(const Widget* get_accel_widget() const, gtk_accel_label_get_accel_widget, constversion)
_WRAP_METHOD(guint get_accel_width() const, gtk_accel_label_get_accel_width)
_WRAP_METHOD(bool refetch(), gtk_accel_label_refetch)
_WRAP_METHOD(void set_accel(guint accelerator_key, Gdk::ModifierType accelerator_mods), gtk_accel_label_set_accel)
#m4 _INITIALIZATION(`Gdk::ModifierType&', `GdkModifierType', `$3 = ($1)$4')
_WRAP_METHOD(void get_accel(guint& accelerator_key, Gdk::ModifierType& accelerator_mods{>>}), gtk_accel_label_get_accel)
//_WRAP_PROPERTY("accel-closure", Glib::Object) //GClosure
_WRAP_PROPERTY("accel-widget", Gtk::Widget*)
};
} // namespace Gtk