Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/gui.git] / src / QxScene / QxScene_ViewWindow.cxx
index 169694bb27e7341629c817512ac97650030e15c1..63aec8dde2b37016ef6d222ea81d5ea444c58c8e 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME QxScene : build Supervisor viewer into desktop
 //
 #include "QxScene_ViewWindow.h"
@@ -39,8 +37,6 @@
 //#define _DEVDEBUG_
 #include "DebTrace.hxx"
 
-using namespace std;
-
 /*!
     Constructor
 */
@@ -88,7 +84,7 @@ void QxScene_ViewWindow::createActions()
   aAction = new QtxAction( tr( "MNU_FITALL" ),
                            aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_FITALL" ) ),
                            tr( "MNU_FITALL" ),
-                          0, this);
+                           0, this);
   aAction->setStatusTip( tr( "DSC_FITALL" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewFitAll() ) );
   mgr->registerAction( aAction, FitAllId );
@@ -97,16 +93,16 @@ void QxScene_ViewWindow::createActions()
   aAction = new QtxAction( tr( "MNU_FITRECT" ),
                            aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_FITAREA" ) ),
                            tr( "MNU_FITRECT" ),
-                          0, this);
+                           0, this);
   aAction->setStatusTip( tr( "DSC_FITRECT" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewFitArea() ) );
   mgr->registerAction( aAction, FitRectId );
 
   // 2.3. Zoom
   aAction = new QtxAction( tr( "MNU_ZOOM_VIEW" ),
-                          aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_ZOOM" ) ),
+                           aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_ZOOM" ) ),
                            tr( "MNU_ZOOM_VIEW" ),
-                          0, this);
+                           0, this);
   aAction->setStatusTip( tr( "DSC_ZOOM_VIEW" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewZoom() ) );
   mgr->registerAction( aAction, ZoomId );
@@ -122,18 +118,18 @@ void QxScene_ViewWindow::createActions()
 
   // 3.1. Panning
   aAction = new QtxAction( tr( "MNU_PAN_VIEW" ),
-                          aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_PAN" ) ),
-                          tr( "MNU_PAN_VIEW" ), 
-                          0, this);
+                           aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_PAN" ) ),
+                           tr( "MNU_PAN_VIEW" ), 
+                           0, this);
   aAction->setStatusTip( tr( "DSC_PAN_VIEW" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewPan() ) );
   mgr->registerAction( aAction, PanId );
 
   // 3.2. Global Panning
   aAction = new QtxAction( tr( "MNU_GLOBALPAN_VIEW" ),
-                          aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_GLOBALPAN" ) ),
+                           aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_GLOBALPAN" ) ),
                            tr( "MNU_GLOBALPAN_VIEW" ),
-                          0, this);
+                           0, this);
   aAction->setStatusTip( tr( "DSC_GLOBALPAN_VIEW" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewGlobalPan() ) );
   mgr->registerAction( aAction, GlobalPanId );
@@ -146,9 +142,9 @@ void QxScene_ViewWindow::createActions()
 
   // reset
   aAction = new QtxAction( tr( "MNU_RESET_VIEW" ),
-                          aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_RESET" ) ),
-                          tr( "MNU_RESET_VIEW" ), 
-                          0, this);
+                           aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_RESET" ) ),
+                           tr( "MNU_RESET_VIEW" ), 
+                           0, this);
   aAction->setStatusTip( tr( "DSC_RESET_VIEW" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewReset() ) );
   mgr->registerAction( aAction, ResetId );
@@ -161,7 +157,7 @@ void QxScene_ViewWindow::createToolBar()
 {
   DEBTRACE("QxScene_ViewWindow::createToolBar");
   QtxActionToolMgr* mgr = toolMgr();
-  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
+  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ), false );
   mgr->append( ScaleOpId, myToolBar );
   mgr->append( MoveOpId, myToolBar );
   mgr->append( ResetId, myToolBar );
@@ -276,7 +272,7 @@ SUIT_ResourceMgr* QxScene_ViewWindow::resMgr() const
 bool QxScene_ViewWindow::closeRequested()
 {
   DEBTRACE("QxScene_ViewWindow::closeRequested");
-  bool isClosed = false;
+  bool isClosed = true;
   emit tryClose(isClosed, this);
   DEBTRACE("isClosed=" << isClosed);
   return isClosed;