Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

GUI/Widgets/vtkKWEventMap.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Module:    $RCSfile: vtkKWEventMap.h,v $
00004 
00005   Copyright (c) Kitware, Inc.
00006   All rights reserved.
00007   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE.  See the above copyright notice for more information.
00012 
00013 =========================================================================*/
00023 #ifndef __vtkKWEventMap_h
00024 #define __vtkKWEventMap_h
00025 
00026 #include "vtkObject.h"
00027 #include "vtkKWWidgets.h" // Needed for export symbols directives
00028 
00029 class KWWIDGETS_EXPORT vtkKWEventMap : public vtkObject
00030 {
00031 public:
00032   static vtkKWEventMap *New();
00033   vtkTypeRevisionMacro(vtkKWEventMap, vtkObject);
00034   void PrintSelf(ostream& os, vtkIndent indent);
00035 
00036   // In the following code:
00037   // button:   0 = Left, 1 = Middle, 2 = Right
00038   // modifier: 0 = button only, 1 = button + shift, 2 = button + control
00039 
00040   //BTX
00041   enum 
00042   {
00043     LeftButton   = 0,
00044     MiddleButton = 1,
00045     RightButton  = 2
00046   };
00047   
00048   enum 
00049   {
00050     NoModifier      = 0,
00051     ShiftModifier   = 1,
00052     ControlModifier = 2
00053   };
00054   //ETX
00055 
00056 
00057   //BTX
00058   // @cond nested_class
00059   struct MouseEvent
00060   {
00061     int Button;
00062     int Modifier;
00063     char *Action;
00064   };
00065   // @endcond
00066   
00067   // @cond nested_class
00068   struct KeyEvent
00069   {
00070     char Key;
00071     int Modifier;
00072     char *Action;
00073   };
00074   // @endcond
00075   
00076   // @cond nested_class
00077   struct KeySymEvent
00078   {
00079     char *KeySym;
00080     int Modifier;
00081     char *Action;
00082   };
00083   // @endcond
00084   //ETX
00085 
00086   // ---------------------------------------------------------
00087 
00089 
00091   void AddMouseEvent(struct MouseEvent *me);
00092   //ETX
00093   void AddMouseEvent(int button, int modifier, const char *action);
00095 
00097 
00100   void SetMouseEvent(struct MouseEvent *me);
00101   //ETX
00102   void SetMouseEvent(int button, int modifier, const char *action);
00104 
00106 
00107   struct MouseEvent* GetMouseEvent(int index);
00108   //ETX
00110   
00112 
00114   void RemoveMouseEvent(struct MouseEvent *me);
00115   //ETX
00116   void RemoveMouseEvent(int button, int modifier, const char *action = NULL);
00117   void RemoveAllMouseEvents();
00119 
00122   const char* FindMouseAction(int button, int modifier);
00123   
00125 
00126   vtkGetMacro(NumberOfMouseEvents, int);
00128   
00129   // ---------------------------------------------------------
00130 
00132 
00134   void AddKeyEvent(struct KeyEvent *me);
00135   //ETX
00136   void AddKeyEvent(char key, int modifier, const char *action);
00138   
00141   void SetKeyEvent(char key, int modifier, const char *action);
00142   
00144 
00145   struct KeyEvent* GetKeyEvent(int index);
00146   //ETX
00148   
00150 
00152   void RemoveKeyEvent(char key, int modifier, const char *action = NULL);
00153   void RemoveAllKeyEvents();
00155   
00158   const char* FindKeyAction(char key, int modifier);
00159   
00161 
00162   vtkGetMacro(NumberOfKeyEvents, int);
00164   
00165   // ---------------------------------------------------------
00166 
00168 
00170   void AddKeySymEvent(struct KeySymEvent *me);
00171   //ETX
00172   void AddKeySymEvent(const char *keySym, int modifier, const char *action);
00174   
00177   void SetKeySymEvent(const char *keySym, int modifier, const char *action);
00178   
00180 
00181   struct KeySymEvent* GetKeySymEvent(int index);
00182   //ETX
00184   
00186 
00188   void RemoveKeySymEvent(const char *keySym, int modifier, const char *action = NULL);
00189   void RemoveAllKeySymEvents();
00191   
00194   const char* FindKeySymAction(const char *keySym, int modifier);
00195   
00197 
00198   vtkGetMacro(NumberOfKeySymEvents, int);
00200 
00202   void ShallowCopy(vtkKWEventMap *tprop);
00203   
00204 protected:
00205   vtkKWEventMap();
00206   ~vtkKWEventMap();
00207   
00208   MouseEvent *MouseEvents;
00209   KeyEvent *KeyEvents;
00210   KeySymEvent *KeySymEvents;
00211 
00212   int NumberOfMouseEvents;
00213   int NumberOfKeyEvents;
00214   int NumberOfKeySymEvents;
00215   
00216 private:
00217   vtkKWEventMap(const vtkKWEventMap&);  // Not implemented
00218   void operator=(const vtkKWEventMap&);  // Not implemented
00219 };
00220 
00221 #endif
00222 

Generated on Tue May 30 12:31:42 2006 for ParaView by doxygen 1.3.5