Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# accelgroup.hh File Reference

GtkAccelGroup C++ wrapper interface. More...

`#include <xfc/glib/object.hh>`
`#include <xfc/gtk/accelkey.hh>`
`#include <xfc/gtk/inline/accelgroup.inl>`

## Namespaces

- namespace Xfc
- namespace Xfc::Gtk

## Classes

- class Xfc::Gtk::AccelGroup
    GtkAccelGroup C++ wrapper class. More...

## Accelerator Methods

- bool accel_groups_activate (G::Object &object, const AccelKey &accel_key)
    Finds the first accelerator in any AccelGroup attached to object that matches the key value and modifiers, and activates that accelerator.
- Gdk::ModifierTypeField accelerator_get_default_mod_mask ()
    Gets the value set by set_default_mod_mask().
- void accelerator_set_default_mod_mask (Gdk::ModifierTypeField default_mod_mask)
    Sets the modifiers that will be considered significant for keyboard accelerators.
- bool accelerator_valid (const AccelKey &accel_key)
    Determines whether a given AccelKey is a valid keyboard accelerator.
- AccelKey accelerator_parse (const String &accelerator, AccelFlagsField accel_flags=Gtk::ACCEL_VISIBLE)
    Construct an AccelKey from a string representing an accelerator.
- String accelerator_name (const AccelKey &accel_key)
    Converts an AccelKey's key value and modifier mask into a string parseable by parse().
- String accelerator_get_label (unsigned int accelerator_key, Gdk::ModifierType accelerator_mods)
    Converts an accelerator key value and modifier mask into a string which can be used to represent the accelerator to the user.

## Detailed Description

GtkAccelGroup C++ wrapper interface.

Provides Gtk::AccelGroup, an object which represents a group of keyboard accelerators.

## Function Documentation

bool accel_groups_activate | ( | G::Object & | object,
|  | const AccelKey & | accel_key
| ) |

  | Finds the first accelerator in any AccelGroup attached to object that matches the key value and modifiers, and activates that accelerator. Parameters:
  | object | The G::Object, usually a Gtk::Window, on which to activate the accelerator.
  | accel_key | An AccelKey specifying the accelerator key value and modifiers.
Returns: true if an accelerator was activated and handled this keypress.

Gdk::ModifierTypeField accelerator_get_default_mod_mask | ( |  | ) |

| Gets the value set by set_default_mod_mask(). Returns: The default accelerator modifier mask.

String accelerator_get_label | ( | unsigned int | accelerator_key,
|  | Gdk::ModifierType | accelerator_mods
| ) |

  | Converts an accelerator key value and modifier mask into a string which can be used to represent the accelerator to the user. Parameters:
  | accelerator_key | The accelerator key value.
  | accelerator_mods | The accelerator modifier mask.
Returns: A String representing the accelerator.

String accelerator_name | ( | const AccelKey & | accel_key | ) |

  | Converts an AccelKey's key value and modifier mask into a string parseable by parse(). Parameters:
  | accel_key | An AccelKey specifying the accelerator key value and modifiers.
Returns: The accelerator name. For example, if you pass in GDK_q and Gdk::CONTROL_MASK, this function returns "\<Control\>q".

AccelKey accelerator_parse | ( | const String & | accelerator,
|  | AccelFlagsField | accel_flags = `Gtk::ACCEL_VISIBLE`
| ) |

  | Construct an AccelKey from a string representing an accelerator. Parameters:
  | accelerator | A string representing an accelerator.
  | accel_flags | A flag mask to configure this accelerator.
Returns: accel_key An AccelKey specifying the accelerator key value and modifiers. Parses a string representing an accelerator. The format looks like "\<Control\>a" or "\<Shift\>\<Alt\>F1" or "\<Release\>z" (the last one is for key release). The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "\<Ctl\>" and "\<Ctrl\>". If the parse fails, accelerator and its modifiers will be set to 0 (zero).

void accelerator_set_default_mod_mask | ( | Gdk::ModifierTypeField | default_mod_mask | ) |

  | Sets the modifiers that will be considered significant for keyboard accelerators. Parameters:
  | default_mod_mask | Accelerator modifier mask.
The default mod mask is GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK, that is, Control, Shift, and Alt. Other modifiers will by default be ignored by AccelGroup. You must include at least the three default modifiers in any value you pass to this method. The default mod mask should be changed on application startup, before using any accelerator groups.

bool accelerator_valid | ( | const AccelKey & | accel_key | ) |

  | Determines whether a given AccelKey is a valid keyboard accelerator. Parameters:
  | accel_key | An AccelKey specifying the accelerator key value and modifiers.
Returns: true if the accelerator is valid. For example, the GDK_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 key value as an accelerator.

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3