Salome HOME
Improve popup management
authorapo <apo@opencascade.com>
Mon, 6 Jun 2005 05:44:08 +0000 (05:44 +0000)
committerapo <apo@opencascade.com>
Mon, 6 Jun 2005 05:44:08 +0000 (05:44 +0000)
src/SVTK/SVTK_InteractorStyle.cxx
src/SVTK/SVTK_InteractorStyle.h
src/SVTK/SVTK_RenderWindowInteractor.cxx

index 2508794c34dfbdb2f40e9594994491fd89354785..77338f4b1cfb7c071c3b38f2d4074f4a573c703a 100644 (file)
@@ -185,6 +185,14 @@ SVTK_InteractorStyle
   Superclass::SetInteractor(theInteractor);
 }
 
+//----------------------------------------------------------------------------
+int
+SVTK_InteractorStyle
+::GetState()
+{
+  return State | ForcedState;
+}
+
 //----------------------------------------------------------------------------
 void 
 SVTK_InteractorStyle
index 5d04a131895d3c0e92a52ceb41d8e6eadc84fe93..c82b592d5a6e87bb45f7ddfae726646df02021b8 100644 (file)
@@ -78,6 +78,8 @@ class SVTK_EXPORT SVTK_InteractorStyle : public QObject,
   void setViewWindow(SVTK_ViewWindow* theViewWindow);
   void setGUIWindow(QWidget* theWindow);
 
+  virtual int GetState();
+
   void setTriedron(VTKViewer_Trihedron* theTrihedron);
   void setPreselectionProp(const double& theRed = 0, 
                           const double& theGreen = 1,
@@ -134,7 +136,6 @@ class SVTK_EXPORT SVTK_InteractorStyle : public QObject,
                const int left, const int top, 
                const int right, const int bottom);
 
-  int State;
   float MotionFactor;
   float RadianToDegree;                 // constant: for conv from deg to rad
   double myScale;
index a3ecadfc8dc114dd858220b408affb7eb40b7bb4..1b32fc424360a69d8c949849c097f79b80c0edc9 100644 (file)
@@ -436,7 +436,7 @@ SVTK_RenderWindowInteractor
                                      (event->state() & ShiftButton), 
                                      event->x(), event->y() ) ;
 
-  if(myInteractorStyle->GetState() == VTK_INTERACTOR_STYLE_CAMERA_NONE){
+  if(myInteractorStyle->GetState() == VTK_INTERACTOR_STYLE_CAMERA_NONE && !( event->state() & KeyButtonMask )){
     QContextMenuEvent aEvent( QContextMenuEvent::Mouse,
                               event->pos(), event->globalPos(),
                               event->state() );