FreeMat: vtkWidgetEventTranslator

FreeMat

- Main Page
- Related Pages

vtkWidgetEventTranslator

Section: Visualization Toolkit Widget Classes

# Usage

vtkWidgetEventTranslator maps VTK events (defined on vtkCommand) into widget events (defined in vtkWidgetEvent.h). This class is typically used in combination with vtkWidgetCallbackMapper, which is responsible for translating widget events into method callbacks, and then invoking the callbacks.

This class can be used to define different mappings of VTK events into the widget events. Thus widgets can be reconfigured to use different event bindings.

To create an instance of class vtkWidgetEventTranslator, simply invoke its constructor as follows

      obj = vtkWidgetEventTranslator

# Methods

The class vtkWidgetEventTranslator has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkWidgetEventTranslator class.

- `string = obj.GetClassName ()` - Standard macros.
- `int = obj.IsA (string name)` - Standard macros.
- `vtkWidgetEventTranslator = obj.NewInstance ()` - Standard macros.
- `vtkWidgetEventTranslator = obj.SafeDownCast (vtkObject o)` - Standard macros.
- `obj.SetTranslation (long VTKEvent, long widgetEvent)` - Use these methods to create the translation from a VTK event to a widget event. Specifying vtkWidgetEvent::NoEvent or an empty string for the (toEvent) erases the mapping for the event.
- `obj.SetTranslation (string VTKEvent, string widgetEvent)` - Use these methods to create the translation from a VTK event to a widget event. Specifying vtkWidgetEvent::NoEvent or an empty string for the (toEvent) erases the mapping for the event.
- `obj.SetTranslation (long VTKEvent, int modifier, char keyCode, int repeatCount, string keySym, long widgetEvent)` - Use these methods to create the translation from a VTK event to a widget event. Specifying vtkWidgetEvent::NoEvent or an empty string for the (toEvent) erases the mapping for the event.
- `obj.SetTranslation (vtkEvent VTKevent, long widgetEvent)` - Use these methods to create the translation from a VTK event to a widget event. Specifying vtkWidgetEvent::NoEvent or an empty string for the (toEvent) erases the mapping for the event.
- `long = obj.GetTranslation (long VTKEvent)` - Translate a VTK event into a widget event. If no event mapping is found, then the methods return vtkWidgetEvent::NoEvent or a NULL string.
- `string = obj.GetTranslation (string VTKEvent)` - Translate a VTK event into a widget event. If no event mapping is found, then the methods return vtkWidgetEvent::NoEvent or a NULL string.
- `long = obj.GetTranslation (long VTKEvent, int modifier, char keyCode, int repeatCount, string keySym)` - Translate a VTK event into a widget event. If no event mapping is found, then the methods return vtkWidgetEvent::NoEvent or a NULL string.
- `long = obj.GetTranslation (vtkEvent VTKEvent)` - Translate a VTK event into a widget event. If no event mapping is found, then the methods return vtkWidgetEvent::NoEvent or a NULL string.
- `int = obj.RemoveTranslation (long VTKEvent, int modifier, char keyCode, int repeatCount, string keySym)` - Remove translations for a binding. Returns the number of translations removed.
- `int = obj.RemoveTranslation (vtkEvent e)` - Remove translations for a binding. Returns the number of translations removed.
- `int = obj.RemoveTranslation (long VTKEvent)` - Remove translations for a binding. Returns the number of translations removed.
- `obj.ClearEvents ()` - Clear all events from the translator (i.e., no events will be translated).