]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
IPAL20121 there are no tool tips for new controls of "View Operations" toolbar.
authordmv <dmv@opencascade.com>
Tue, 2 Dec 2008 09:20:45 +0000 (09:20 +0000)
committerdmv <dmv@opencascade.com>
Tue, 2 Dec 2008 09:20:45 +0000 (09:20 +0000)
src/SVTK/SVTK_ViewWindow.cxx
src/SVTK/SVTK_ViewWindow.h
src/SVTK/resources/SVTK_msg_en.ts

index 3093d1ba5c41e6f65b3fcd0e0da76d85225c6240..0d7348f429d890ed6e5344a0223e32bddeefc8a7 100755 (executable)
@@ -674,8 +674,10 @@ void SVTK_ViewWindow::activateStartFocalPointSelection()
 
 void SVTK_ViewWindow::activateProjectionMode(int theMode)
 {
-  SVTK_ComboAction* a = ::qobject_cast<SVTK_ComboAction*>( toolMgr()->action( ProjectionModeId ) );
-  if ( a ) a->setCurrentIndex(theMode);
+  if (theMode)
+    toolMgr()->action( ProjectionModeId )->setChecked( true );
+  else
+    toolMgr()->action( ParallelModeId )->setChecked( true );
 }
 
 /*!
@@ -1504,10 +1506,10 @@ void SVTK_ViewWindow::activateStartPointSelection()
 /*!
   Set the view projection mode: orthogonal or perspective
 */
-void SVTK_ViewWindow::onProjectionMode(int mode)
+void SVTK_ViewWindow::onPerspectiveMode()
 {
   vtkCamera* aCamera = getRenderer()->GetActiveCamera();
-  aCamera->SetParallelProjection(mode==0);
+  aCamera->SetParallelProjection(toolMgr()->action( ParallelModeId )->isChecked());
   GetInteractor()->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
 }
 
@@ -1675,13 +1677,26 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
   connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onUpdateRate(bool)));
   mgr->registerAction( anAction, UpdateRate );
 
-  // Set projection mode
-  SVTK_ComboAction* aModeAction = new SVTK_ComboAction(tr("MNU_SVTK_PROJECTION_MODE"), this);
-  aModeAction->setStatusTip(tr("DSC_SVTK_PROJECTION_MODE"));
-  aModeAction->insertItem(theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARALLEL" ) ) );
-  aModeAction->insertItem(theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PERSPECTIVE" ) ) );
-  connect(aModeAction, SIGNAL(triggered(int)), this, SLOT(onProjectionMode(int)));
-  mgr->registerAction( aModeAction, ProjectionModeId );
+  // Set perspective mode group
+  anAction = new QtxAction(tr("MNU_SVTK_PARALLEL_MODE"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARALLEL" ) ),
+                          tr( "MNU_SVTK_PARALLEL_MODE" ), 0, this);
+  anAction->setStatusTip(tr("DSC_SVTK_PARALLEL_MODE"));
+  anAction->setCheckable(true);
+  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
+  mgr->registerAction( anAction, ParallelModeId );
+
+  anAction = new QtxAction(tr("MNU_SVTK_PERSPECTIVE_MODE"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PERSPECTIVE" ) ),
+                          tr( "MNU_SVTK_PERSPECTIVE_MODE" ), 0, this);
+  anAction->setStatusTip(tr("DSC_SVTK_PERSPECTIVE_MODE"));
+  anAction->setCheckable(true);
+  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
+  mgr->registerAction( anAction, ProjectionModeId );
+
+  QActionGroup* aPerspectiveGroup = new QActionGroup( this );
+  aPerspectiveGroup->addAction( mgr->action( ParallelModeId ) );
+  aPerspectiveGroup->addAction( mgr->action( ProjectionModeId ) );
 
   // View Parameters
   anAction = new QtxAction(tr("MNU_VIEWPARAMETERS_VIEW"), 
@@ -1779,6 +1794,8 @@ void SVTK_ViewWindow::createToolBar()
   mgr->append( GraduatedAxes, myToolBar );
 
   mgr->append( ViewParametersId, myToolBar );
+  mgr->append( toolMgr()->separator(), myToolBar );
+  mgr->append( ParallelModeId, myToolBar );
   mgr->append( ProjectionModeId, myToolBar );
 
   mgr->append( StartRecordingId, myRecordingToolBar );
index 0b5f2014ac14aabf059d53bc82242a10fd313d7a..92a4dbc0fc267a321d7c4a76df8419740a57563d 100755 (executable)
@@ -271,7 +271,7 @@ public slots:
   void activatePanning(); 
   void activateGlobalPanning(); 
 
-  void onProjectionMode(int mode);
+  void onPerspectiveMode();
 
   void activateProjectionMode(int);
 
@@ -358,7 +358,7 @@ protected:
         ChangeRotationPointId, RotationId,
          FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, 
         ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate,
-        ProjectionModeId, ViewParametersId, SwitchInteractionStyleId,
+        ParallelModeId, ProjectionModeId, ViewParametersId, SwitchInteractionStyleId,
         StartRecordingId, PlayRecordingId, PauseRecordingId, StopRecordingId };
 
 
index e8467cd57a6ceed033ff8f2cd0fe10a2b95a0dbf..bbaa60f878f699dd423c4e370362d0d690e0f7ab 100644 (file)
         <translation>Change the parameters of the view</translation>
     </message>
     <message>
-        <source>MNU_SVTK_PROJECTION_MODE</source>
-        <translation>Projection Mode</translation>
+        <source>MNU_SVTK_PARALLEL_MODE</source>
+        <translation>Orthogonal Mode</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_PARALLEL_MODE</source>
+        <translation>Set the orthogonal projection type</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_PERSPECTIVE_MODE</source>
+        <translation>Perspective Mode</translation>
     </message>
     <message>
-        <source>DSC_SVTK_PROJECTION_MODE</source>
-        <translation>Set orthogonal or perspective projection of the view</translation>
+        <source>DSC_SVTK_PERSPECTIVE_MODE</source>
+        <translation>Set the perspective projection type</translation>
     </message>
     <message>
         <source>DSC_SVTK_STYLE_SWITCH</source>