00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00028 #ifndef __vtkWidgetCallbackMapper_h
00029 #define __vtkWidgetCallbackMapper_h
00030
00031 #include "vtkObject.h"
00032
00033 class vtkWidgetEvent;
00034 class vtkAbstractWidget;
00035 class vtkWidgetEventTranslator;
00036 class vtkCallbackMap;
00037
00038
00039 class VTK_WIDGETS_EXPORT vtkWidgetCallbackMapper : public vtkObject
00040 {
00041 public:
00043 static vtkWidgetCallbackMapper *New();
00044
00046
00047 vtkTypeRevisionMacro(vtkWidgetCallbackMapper,vtkObject);
00048 void PrintSelf(ostream& os, vtkIndent indent);
00050
00052
00053 void SetEventTranslator(vtkWidgetEventTranslator *t);
00054 vtkGetObjectMacro(EventTranslator,vtkWidgetEventTranslator);
00056
00057
00059 typedef void (*CallbackType)(vtkAbstractWidget*);
00060
00061
00063
00071 void SetCallbackMethod(unsigned long VTKEvent, unsigned long widgetEvent,
00072 vtkAbstractWidget *w, CallbackType f);
00073 void SetCallbackMethod(unsigned long VTKEvent, int modifiers, char keyCode,
00074 int repeatCount, const char* keySym,
00075 unsigned long widgetEvent,
00076 vtkAbstractWidget *w, CallbackType f);
00077
00078
00080
00083 void InvokeCallback(unsigned long widgetEvent);
00084
00085 protected:
00086 vtkWidgetCallbackMapper();
00087 ~vtkWidgetCallbackMapper();
00088
00089
00090 vtkWidgetEventTranslator *EventTranslator;
00091
00092
00093 vtkCallbackMap *CallbackMap;
00094
00096
00100 void SetCallbackMethod(unsigned long widgetEvent,
00101 vtkAbstractWidget *w, CallbackType f);
00103
00104
00105 private:
00106 vtkWidgetCallbackMapper(const vtkWidgetCallbackMapper&);
00107 void operator=(const vtkWidgetCallbackMapper&);
00108
00109 };
00110
00111
00112 #endif
00113