Ardour
9.0-pre0-384-ga76afae0e9
|
#include <accelgroup.h>
Public Member Functions | |
virtual | ~AccelGroup () |
GtkAccelGroup * | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkAccelGroup * | gobj () const |
Provides access to the underlying C GObject. More... | |
GtkAccelGroup * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More... | |
bool | get_is_locked () const |
Gdk::ModifierType | get_modifier_mask () const |
void | lock () |
void | unlock () |
bool | disconnect_key (guint accel_key, Gdk::ModifierType accel_mods) |
bool | activate (GQuark accel_quark, const Glib::RefPtr< Glib::Object > &acceleratable, guint accel_key, Gdk::ModifierType accel_mods) |
Glib::SignalProxy3< bool, const Glib::RefPtr< Glib::Object > &, guint, Gdk::ModifierType > | signal_accel_activate () |
Glib::SignalProxy3< void, guint, Gdk::ModifierType, GClosure * > | signal_accel_changed () |
Glib::PropertyProxy_ReadOnly< bool > | property_is_locked () const |
Glib::PropertyProxy_ReadOnly< Gdk::ModifierType > | property_modifier_mask () const |
Static Public Member Functions | |
static GType | get_type () G_GNUC_CONST |
static Glib::RefPtr< AccelGroup > | create () |
static bool | valid (guint keyval, Gdk::ModifierType modifiers) |
static void | parse (const Glib::ustring &accelerator, guint &accelerator_key, Gdk::ModifierType &accelerator_mods) |
static Glib::ustring | name (guint accelerator_key, Gdk::ModifierType accelerator_mods) |
static Glib::ustring | get_label (guint accelerator_key, Gdk::ModifierType accelerator_mods) |
static void | set_default_mod_mask (Gdk::ModifierType default_mod_mask) |
static Gdk::ModifierType | get_default_mod_mask () |
See set_default_mod_mask(). More... | |
static bool | activate (Gtk::Object &object, guint accel_key, Gdk::ModifierType accel_mods) |
Protected Member Functions | |
AccelGroup () | |
virtual void | on_accel_changed (guint keyval, Gdk::ModifierType modifier, GClosure *accel_closure) |
This is a default handler for the signal signal_accel_changed(). More... | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gtk::AccelGroup > | wrap (GtkAccelGroup *object, bool take_copy=false) |
A Gtk::AccelGroup represents a group of keyboard accelerators, typically attached to a toplevel Gtk::Window (with Gtk::Window::add_accel_group()). Usually you won't need to create a Gtk::AccelGroup directly; instead, gtkmm automatically sets up the accelerators for your menus. Note that accelerators are different from mnemonics. Accelerators are shortcuts for activating a menu item; they appear alongside the menu item for which they're a shortcut. For example "Ctrl+Q" might appear alongside the "Quit" menu item. Mnemonics are shortcuts for GUI elements such as text entries or buttons; they appear as underlined characters. See the Gtk::Label constructor. Menu items can have both accelerators and mnemonics, of course.
You can use Gtk::Window::get_accel_group() to get an accel group for that window, then use it with other widgets too.
Definition at line 63 of file accelgroup.h.
|
virtual |
|
protected |
bool Gtk::AccelGroup::activate | ( | GQuark | accel_quark, |
const Glib::RefPtr< Glib::Object > & | acceleratable, | ||
guint | accel_key, | ||
Gdk::ModifierType | accel_mods | ||
) |
Finds the first accelerator in accel_group that matches accel_key and accel_mods, and activates it.
accel_quark | The quark for the accelerator name. |
acceleratable | The Object, usually a Gtk::Window, on which to activate the accelerator. |
accel_key | Accelerator keyval from a key event. |
accel_mods | Keyboard state mask from a key event. |
true
if an accelerator was activated and handled this keypress.
|
static |
Finds the first accelerator in any Gtk::AccelGroup attached to object that matches accel_key and accel_mods, and activates that accelerator.
object | The Object, usually a Gtk::Window, on which to activate the accelerator. |
accel_key | Accelerator keyval from a key event. |
accel_mods | Keyboard state mask from a key event. |
true
if an accelerator was activated and handled this keypress.
|
static |
Creates a new Gtk::AccelGroup object.
bool Gtk::AccelGroup::disconnect_key | ( | guint | accel_key, |
Gdk::ModifierType | accel_mods | ||
) |
Removes an accelerator previously installed through connect().
accel_key | Key value of the accelerator. |
accel_mods | Modifier combination of the accelerator. |
true
if there was an accelerator which could be removed, false
otherwise.
|
static |
bool Gtk::AccelGroup::get_is_locked | ( | ) | const |
|
static |
Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.
accelerator_key | Accelerator keyval. |
accelerator_mods | Accelerator modifier mask. |
Gdk::ModifierType Gtk::AccelGroup::get_modifier_mask | ( | ) | const |
Gets a Gdk::ModifierType representing the mask for this accel_group. For example, Gdk::CONTROL_MASK, Gdk::SHIFT_MASK, etc.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
Definition at line 102 of file accelgroup.h.
|
inline |
Provides access to the underlying C GObject.
Definition at line 105 of file accelgroup.h.
GtkAccelGroup* Gtk::AccelGroup::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
void Gtk::AccelGroup::lock | ( | ) |
Locks the given accelerator group.
Locking an acelerator group prevents the accelerators contained within it to be changed during runtime. Refer to Gtk::AccelMap::change_entry() about runtime accelerator changes.
If called more than once, accel_group remains locked until unlock() has been called an equivalent number of times.
|
static |
Converts an accelerator keyval and modifier mask into a string parseable by parse(). For example, if you pass in 'q' and Gdk::CONTROL_MASK, it returns "<Control>q".
|
protectedvirtual |
This is a default handler for the signal signal_accel_changed().
|
static |
Parse the accelerator string.
accelerator | See the Gtk::AccelKey constructor for the format. |
accelerator_key | Output argument |
accelerator_mods | Output argument |
Glib::PropertyProxy_ReadOnly< bool > Gtk::AccelGroup::property_is_locked | ( | ) | const |
Is the accel group locked.
Glib::PropertyProxy_ReadOnly< Gdk::ModifierType > Gtk::AccelGroup::property_modifier_mask | ( | ) | const |
Modifier Mask.
|
static |
Sets the modifiers that will be considered significant for keyboard accelerators. The default mod mask is Gdk::CONTROL_MASK | Gdk::SHIFT_MASK | Gdk::MOD1_MASK, that is, Control, Shift, and Alt. Other modifiers will ignored by default. You must include at least the three default modifiers in any value you pass to this function.
The default mod mask should be changed on application startup, before using any accelerator groups.
Glib::SignalProxy3< bool,const Glib::RefPtr<Glib::Object>&,guint,Gdk::ModifierType > Gtk::AccelGroup::signal_accel_activate | ( | ) |
bool on_my_accel_activate(const Glib::RefPtr<Glib::Object>& acceleratable, guint keyval, Gdk::ModifierType modifier)
Glib::SignalProxy3< void,guint,Gdk::ModifierType,GClosure* > Gtk::AccelGroup::signal_accel_changed | ( | ) |
void on_my_accel_changed(guint keyval, Gdk::ModifierType modifier, GClosure* accel_closure)
void Gtk::AccelGroup::unlock | ( | ) |
Undoes the last call to lock() on this accel_group.
|
static |
Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator. For example, the 'a' keyval plus Gdk::CONTROL_MASK is valid - this is a "Ctrl+a" accelerator. But you can't, for instance, use the GDK_Control_L keyval as an accelerator.
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |