a keyboard shortcut manager. More...
#include <vtkKWKeyBindingsManager.h>


Public Types | |
| typedef vtkKWObject | Superclass |
Public Member Functions | |
| virtual const char * | GetClassName () |
| virtual int | IsA (const char *type) |
| void | PrintSelf (ostream &os, vtkIndent indent) |
| virtual void | SetKeyBindingsFromEventMap (vtkKWEventMap *map) |
| virtual const char * | GetPrettyBinding (const char *binding) |
| virtual const char * | GetPrettyContext (const char *context) |
Static Public Member Functions | |
| static vtkKWKeyBindingsManager * | New () |
| static int | IsTypeOf (const char *type) |
| static vtkKWKeyBindingsManager * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
| vtkKWKeyBindingsManager () | |
| ~vtkKWKeyBindingsManager () | |
Protected Attributes | |
| vtkKWKeyBindingsManagerInternals * | Internals |
|
| |
| virtual void | AddKeyBinding (vtkObject *target, const char *binding, vtkObject *callback_object=NULL, const char *callback_command=NULL, const char *context=NULL, const char *description=NULL) |
| virtual void | SetKeyBinding (vtkObject *target, const char *binding, vtkObject *callback_object=NULL, const char *callback_command=NULL, const char *context=NULL, const char *description=NULL) |
| virtual void | RemoveKeyBinding (vtkObject *target, const char *binding=NULL, vtkObject *callback_object=NULL, const char *callback_command=NULL) |
| virtual int | GetNumberOfTargets () |
| virtual vtkObject * | GetNthTarget (int idx) |
| virtual int | GetNumberOfBindings (vtkObject *target) |
| virtual const char * | GetNthBinding (vtkObject *target, int idx) |
| virtual int | GetNumberOfCallbackObjects (vtkObject *target, const char *binding) |
| virtual vtkObject * | GetNthCallbackObject (vtkObject *target, const char *binding, int idx) |
| virtual int | GetNumberOfKeyBindings (vtkObject *target, const char *binding, vtkObject *callback_object) |
| virtual const char * | GetNthCallbackCommand (vtkObject *target, const char *binding, vtkObject *callback_object, int idx) |
| virtual const char * | GetNthContext (vtkObject *target, const char *binding, vtkObject *callback_object, int idx) |
| virtual const char * | GetNthDescription (vtkObject *target, const char *binding, vtkObject *callback_object, int idx) |
| virtual void | ProcessCallbackCommandEvents (vtkObject *caller, unsigned long event, void *calldata) |
a keyboard shortcut manager.
This class is basically a manager that acts as a container for a set of key bindings. Any object that define a key binding can register it here. This manager can be queried later on to list all key bindings, for example. This class does not support reassigning key bindings yet.
Definition at line 34 of file vtkKWKeyBindingsManager.h.
Reimplemented from vtkKWObject.
Definition at line 39 of file vtkKWKeyBindingsManager.h.
| vtkKWKeyBindingsManager::vtkKWKeyBindingsManager | ( | ) | [protected] |
| vtkKWKeyBindingsManager::~vtkKWKeyBindingsManager | ( | ) | [protected] |
| static vtkKWKeyBindingsManager* vtkKWKeyBindingsManager::New | ( | ) | [static] |
Reimplemented from vtkKWObject.
| virtual const char* vtkKWKeyBindingsManager::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkKWObject.
| static int vtkKWKeyBindingsManager::IsTypeOf | ( | const char * | type | ) | [static] |
Reimplemented from vtkKWObject.
| virtual int vtkKWKeyBindingsManager::IsA | ( | const char * | type | ) | [virtual] |
Reimplemented from vtkKWObject.
| static vtkKWKeyBindingsManager* vtkKWKeyBindingsManager::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkKWObject.
| void vtkKWKeyBindingsManager::PrintSelf | ( | ostream & | os, | |
| vtkIndent | indent | |||
| ) | [virtual] |
Reimplemented from vtkKWObject.
| virtual void vtkKWKeyBindingsManager::AddKeyBinding | ( | vtkObject * | target, | |
| const char * | binding, | |||
| vtkObject * | callback_object = NULL, |
|||
| const char * | callback_command = NULL, |
|||
| const char * | context = NULL, |
|||
| const char * | description = NULL | |||
| ) | [virtual] |
Add or set or remove a key binding. Setting a key binding will remove any items that were previously associated to that specific binding. 'target' is generally a pointer to the class that set up this binding. 'binding' is the binding itself, in a Tk event form (say, <KeyPress-p>) 'callback_object' and 'callback_command' define the callback associated to this binding. The 'object' argument is the object that will have the 'command' (method) called on it. The 'method' argument is the name of the method to be called and any arguments in string form. If the 'object' is NULL, the method is still evaluated as a simple Tcl command. simple Tcl command. 'context' is a string in plain English (or preferably localized) that explains in which context this key binding is valid. For example: "Any 2D View", or "Any Main Window". It usually is a simple/short description of the class setting the binding (i.e. the 'target'). 'description' is a string in plain English (or preferably localized) that explains what that binding does. For example: "Reset the camera".
| virtual void vtkKWKeyBindingsManager::SetKeyBinding | ( | vtkObject * | target, | |
| const char * | binding, | |||
| vtkObject * | callback_object = NULL, |
|||
| const char * | callback_command = NULL, |
|||
| const char * | context = NULL, |
|||
| const char * | description = NULL | |||
| ) | [virtual] |
Add or set or remove a key binding. Setting a key binding will remove any items that were previously associated to that specific binding. 'target' is generally a pointer to the class that set up this binding. 'binding' is the binding itself, in a Tk event form (say, <KeyPress-p>) 'callback_object' and 'callback_command' define the callback associated to this binding. The 'object' argument is the object that will have the 'command' (method) called on it. The 'method' argument is the name of the method to be called and any arguments in string form. If the 'object' is NULL, the method is still evaluated as a simple Tcl command. simple Tcl command. 'context' is a string in plain English (or preferably localized) that explains in which context this key binding is valid. For example: "Any 2D View", or "Any Main Window". It usually is a simple/short description of the class setting the binding (i.e. the 'target'). 'description' is a string in plain English (or preferably localized) that explains what that binding does. For example: "Reset the camera".
| virtual void vtkKWKeyBindingsManager::RemoveKeyBinding | ( | vtkObject * | target, | |
| const char * | binding = NULL, |
|||
| vtkObject * | callback_object = NULL, |
|||
| const char * | callback_command = NULL | |||
| ) | [virtual] |
Add or set or remove a key binding. Setting a key binding will remove any items that were previously associated to that specific binding. 'target' is generally a pointer to the class that set up this binding. 'binding' is the binding itself, in a Tk event form (say, <KeyPress-p>) 'callback_object' and 'callback_command' define the callback associated to this binding. The 'object' argument is the object that will have the 'command' (method) called on it. The 'method' argument is the name of the method to be called and any arguments in string form. If the 'object' is NULL, the method is still evaluated as a simple Tcl command. simple Tcl command. 'context' is a string in plain English (or preferably localized) that explains in which context this key binding is valid. For example: "Any 2D View", or "Any Main Window". It usually is a simple/short description of the class setting the binding (i.e. the 'target'). 'description' is a string in plain English (or preferably localized) that explains what that binding does. For example: "Reset the camera".
| virtual int vtkKWKeyBindingsManager::GetNumberOfTargets | ( | ) | [virtual] |
Query the key bindings. While a little convoluted, this is the fastest way to query the internal bindings: iterate over the targets, then iterate over the bindings for each target, then iterate over the callback objects for each binding, then iterate over the key bindings entries themselves for each callback objet; for each entry (given a target, binding, callback object and index), you can retrieve the callback command, context and description. See vtkKWKeyBindingsWidget.cxx for an example.
| virtual vtkObject* vtkKWKeyBindingsManager::GetNthTarget | ( | int | idx | ) | [virtual] |
Add or set or remove a key binding. Setting a key binding will remove any items that were previously associated to that specific binding. 'target' is generally a pointer to the class that set up this binding. 'binding' is the binding itself, in a Tk event form (say, <KeyPress-p>) 'callback_object' and 'callback_command' define the callback associated to this binding. The 'object' argument is the object that will have the 'command' (method) called on it. The 'method' argument is the name of the method to be called and any arguments in string form. If the 'object' is NULL, the method is still evaluated as a simple Tcl command. simple Tcl command. 'context' is a string in plain English (or preferably localized) that explains in which context this key binding is valid. For example: "Any 2D View", or "Any Main Window". It usually is a simple/short description of the class setting the binding (i.e. the 'target'). 'description' is a string in plain English (or preferably localized) that explains what that binding does. For example: "Reset the camera".
| virtual int vtkKWKeyBindingsManager::GetNumberOfBindings | ( | vtkObject * | target | ) | [virtual] |
Add or set or remove a key binding. Setting a key binding will remove any items that were previously associated to that specific binding. 'target' is generally a pointer to the class that set up this binding. 'binding' is the binding itself, in a Tk event form (say, <KeyPress-p>) 'callback_object' and 'callback_command' define the callback associated to this binding. The 'object' argument is the object that will have the 'command' (method) called on it. The 'method' argument is the name of the method to be called and any arguments in string form. If the 'object' is NULL, the method is still evaluated as a simple Tcl command. simple Tcl command. 'context' is a string in plain English (or preferably localized) that explains in which context this key binding is valid. For example: "Any 2D View", or "Any Main Window". It usually is a simple/short description of the class setting the binding (i.e. the 'target'). 'description' is a string in plain English (or preferably localized) that explains what that binding does. For example: "Reset the camera".
| virtual const char* vtkKWKeyBindingsManager::GetNthBinding | ( | vtkObject * | target, | |
| int | idx | |||
| ) | [virtual] |
Add or set or remove a key binding. Setting a key binding will remove any items that were previously associated to that specific binding. 'target' is generally a pointer to the class that set up this binding. 'binding' is the binding itself, in a Tk event form (say, <KeyPress-p>) 'callback_object' and 'callback_command' define the callback associated to this binding. The 'object' argument is the object that will have the 'command' (method) called on it. The 'method' argument is the name of the method to be called and any arguments in string form. If the 'object' is NULL, the method is still evaluated as a simple Tcl command. simple Tcl command. 'context' is a string in plain English (or preferably localized) that explains in which context this key binding is valid. For example: "Any 2D View", or "Any Main Window". It usually is a simple/short description of the class setting the binding (i.e. the 'target'). 'description' is a string in plain English (or preferably localized) that explains what that binding does. For example: "Reset the camera".
| virtual int vtkKWKeyBindingsManager::GetNumberOfCallbackObjects | ( | vtkObject * | target, | |
| const char * | binding | |||
| ) | [virtual] |
Add or set or remove a key binding. Setting a key binding will remove any items that were previously associated to that specific binding. 'target' is generally a pointer to the class that set up this binding. 'binding' is the binding itself, in a Tk event form (say, <KeyPress-p>) 'callback_object' and 'callback_command' define the callback associated to this binding. The 'object' argument is the object that will have the 'command' (method) called on it. The 'method' argument is the name of the method to be called and any arguments in string form. If the 'object' is NULL, the method is still evaluated as a simple Tcl command. simple Tcl command. 'context' is a string in plain English (or preferably localized) that explains in which context this key binding is valid. For example: "Any 2D View", or "Any Main Window". It usually is a simple/short description of the class setting the binding (i.e. the 'target'). 'description' is a string in plain English (or preferably localized) that explains what that binding does. For example: "Reset the camera".
| virtual vtkObject* vtkKWKeyBindingsManager::GetNthCallbackObject | ( | vtkObject * | target, | |
| const char * | binding, | |||
| int | idx | |||
| ) | [virtual] |
Add or set or remove a key binding. Setting a key binding will remove any items that were previously associated to that specific binding. 'target' is generally a pointer to the class that set up this binding. 'binding' is the binding itself, in a Tk event form (say, <KeyPress-p>) 'callback_object' and 'callback_command' define the callback associated to this binding. The 'object' argument is the object that will have the 'command' (method) called on it. The 'method' argument is the name of the method to be called and any arguments in string form. If the 'object' is NULL, the method is still evaluated as a simple Tcl command. simple Tcl command. 'context' is a string in plain English (or preferably localized) that explains in which context this key binding is valid. For example: "Any 2D View", or "Any Main Window". It usually is a simple/short description of the class setting the binding (i.e. the 'target'). 'description' is a string in plain English (or preferably localized) that explains what that binding does. For example: "Reset the camera".
| virtual int vtkKWKeyBindingsManager::GetNumberOfKeyBindings | ( | vtkObject * | target, | |
| const char * | binding, | |||
| vtkObject * | callback_object | |||
| ) | [virtual] |
Add or set or remove a key binding. Setting a key binding will remove any items that were previously associated to that specific binding. 'target' is generally a pointer to the class that set up this binding. 'binding' is the binding itself, in a Tk event form (say, <KeyPress-p>) 'callback_object' and 'callback_command' define the callback associated to this binding. The 'object' argument is the object that will have the 'command' (method) called on it. The 'method' argument is the name of the method to be called and any arguments in string form. If the 'object' is NULL, the method is still evaluated as a simple Tcl command. simple Tcl command. 'context' is a string in plain English (or preferably localized) that explains in which context this key binding is valid. For example: "Any 2D View", or "Any Main Window". It usually is a simple/short description of the class setting the binding (i.e. the 'target'). 'description' is a string in plain English (or preferably localized) that explains what that binding does. For example: "Reset the camera".
| virtual const char* vtkKWKeyBindingsManager::GetNthCallbackCommand | ( | vtkObject * | target, | |
| const char * | binding, | |||
| vtkObject * | callback_object, | |||
| int | idx | |||
| ) | [virtual] |
Add or set or remove a key binding. Setting a key binding will remove any items that were previously associated to that specific binding. 'target' is generally a pointer to the class that set up this binding. 'binding' is the binding itself, in a Tk event form (say, <KeyPress-p>) 'callback_object' and 'callback_command' define the callback associated to this binding. The 'object' argument is the object that will have the 'command' (method) called on it. The 'method' argument is the name of the method to be called and any arguments in string form. If the 'object' is NULL, the method is still evaluated as a simple Tcl command. simple Tcl command. 'context' is a string in plain English (or preferably localized) that explains in which context this key binding is valid. For example: "Any 2D View", or "Any Main Window". It usually is a simple/short description of the class setting the binding (i.e. the 'target'). 'description' is a string in plain English (or preferably localized) that explains what that binding does. For example: "Reset the camera".
| virtual const char* vtkKWKeyBindingsManager::GetNthContext | ( | vtkObject * | target, | |
| const char * | binding, | |||
| vtkObject * | callback_object, | |||
| int | idx | |||
| ) | [virtual] |
Add or set or remove a key binding. Setting a key binding will remove any items that were previously associated to that specific binding. 'target' is generally a pointer to the class that set up this binding. 'binding' is the binding itself, in a Tk event form (say, <KeyPress-p>) 'callback_object' and 'callback_command' define the callback associated to this binding. The 'object' argument is the object that will have the 'command' (method) called on it. The 'method' argument is the name of the method to be called and any arguments in string form. If the 'object' is NULL, the method is still evaluated as a simple Tcl command. simple Tcl command. 'context' is a string in plain English (or preferably localized) that explains in which context this key binding is valid. For example: "Any 2D View", or "Any Main Window". It usually is a simple/short description of the class setting the binding (i.e. the 'target'). 'description' is a string in plain English (or preferably localized) that explains what that binding does. For example: "Reset the camera".
| virtual const char* vtkKWKeyBindingsManager::GetNthDescription | ( | vtkObject * | target, | |
| const char * | binding, | |||
| vtkObject * | callback_object, | |||
| int | idx | |||
| ) | [virtual] |
Add or set or remove a key binding. Setting a key binding will remove any items that were previously associated to that specific binding. 'target' is generally a pointer to the class that set up this binding. 'binding' is the binding itself, in a Tk event form (say, <KeyPress-p>) 'callback_object' and 'callback_command' define the callback associated to this binding. The 'object' argument is the object that will have the 'command' (method) called on it. The 'method' argument is the name of the method to be called and any arguments in string form. If the 'object' is NULL, the method is still evaluated as a simple Tcl command. simple Tcl command. 'context' is a string in plain English (or preferably localized) that explains in which context this key binding is valid. For example: "Any 2D View", or "Any Main Window". It usually is a simple/short description of the class setting the binding (i.e. the 'target'). 'description' is a string in plain English (or preferably localized) that explains what that binding does. For example: "Reset the camera".
| virtual void vtkKWKeyBindingsManager::SetKeyBindingsFromEventMap | ( | vtkKWEventMap * | map | ) | [virtual] |
Convenience method that can be used to add all the key and keysym bindings found in a vtkKWEventMap.
| virtual const char* vtkKWKeyBindingsManager::GetPrettyBinding | ( | const char * | binding | ) | [virtual] |
Get a "pretty" representation of a binding (remove trailing <>, Key-, KeyPress-, translate some keysyms, change - into +, uppercase the key).
| virtual const char* vtkKWKeyBindingsManager::GetPrettyContext | ( | const char * | context | ) | [virtual] |
Get a "pretty" representation of a context (if the context is a single word, i.e. maybe a class name, remove the usual prefixes, and separate each words).
| virtual void vtkKWKeyBindingsManager::ProcessCallbackCommandEvents | ( | vtkObject * | caller, | |
| unsigned long | event, | |||
| void * | calldata | |||
| ) | [protected, virtual] |
Processes the events that are passed through CallbackCommand (or others). Subclasses can oberride this method to process their own events, but should call the superclass too.
Reimplemented from vtkKWObject.
vtkKWKeyBindingsManagerInternals* vtkKWKeyBindingsManager::Internals [protected] |
Definition at line 130 of file vtkKWKeyBindingsManager.h.
1.6.1