]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix problem with activating view window programmatically.
authorvsr <vsr@opencascade.com>
Thu, 23 Apr 2015 14:49:43 +0000 (17:49 +0300)
committervsr <vsr@opencascade.com>
Fri, 24 Apr 2015 07:45:18 +0000 (10:45 +0300)
src/LightApp/LightApp_Application.cxx
src/STD/STD_TabDesktop.cxx
src/STD/STD_TabDesktop.h
src/SUIT/SUIT_Desktop.cxx
src/SUIT/SUIT_Desktop.h

index 4b8c81e654a14affaf8cbe8f75d2c7edd8902c21..ef92a88d48c38ff2de8217c31830b434acd584d7 100644 (file)
@@ -1423,7 +1423,7 @@ SUIT_ViewManager* LightApp_Application::getViewManager( const QString& vmType, c
     if ( !aVM->getActiveView() )
       aVM->createView();
     else
-      aVM->getActiveView()->setFocus();
+      desktop()->setActiveWindow( aVM->getActiveView() );
   }
   else if ( create )
     aVM = createViewManager( vmType );
index 8e0d6cbd7534ef57ba7fb1ecb42917337c42a2e8..6ca5a47db9cad00a60c4c7eab34a254845de1b00 100644 (file)
@@ -97,6 +97,18 @@ SUIT_ViewWindow* STD_TabDesktop::activeWindow() const
   return wnd;
 }
 
+/*!
+  Set active window
+  \param wnd - view window
+*/
+void STD_TabDesktop::setActiveWindow(SUIT_ViewWindow* wnd)
+{
+  if (wnd) {
+    myWorkstack->setActiveWindow(wnd);
+    wnd->setFocus();
+  }
+}
+
 /*!
   \retval QPtrList<SUIT_ViewWindow> - return const active window list.
 */
index e844d8daab56b8db5af0ac6e00d488154179c5ef..0b75fea13dfc3abf501680409d41822e105d2a91 100644 (file)
@@ -46,6 +46,7 @@ public:
   virtual ~STD_TabDesktop();
 
   virtual SUIT_ViewWindow* activeWindow() const;
+  virtual void setActiveWindow(SUIT_ViewWindow*);
   virtual QList<SUIT_ViewWindow*> windows() const;
 
   void                     windowOperation( const int );
index 10fddbfece4699014edec1c082042b57958ec1dc..e0cbd04a03f8daf457007c40c9b420ff71554576 100755 (executable)
@@ -216,3 +216,11 @@ void SUIT_Desktop::emitMessage( const QString& theMessage )
 {
   emit message( theMessage );
 }
+
+/*!
+  Activate window (default implementation just sets focus to the window.
+*/
+void SUIT_Desktop::setActiveWindow(SUIT_ViewWindow* wnd)
+{
+  if (wnd) wnd->setFocus();
+}
index 7e2b961b47bdf5c046f2e1db7c412ad3e3fb42ad..c1f62e4d7087653089ee1b0b2a27783b33f83ae9 100755 (executable)
@@ -60,6 +60,7 @@ public:
   QtxLogoMgr*              logoMgr() const;
 
   virtual SUIT_ViewWindow* activeWindow() const = 0;
+  virtual void setActiveWindow(SUIT_ViewWindow*);
   virtual QList<SUIT_ViewWindow*> windows() const = 0;
 
   int                      logoCount() const;