From fd6c36a1a383f65193e9d17cb9ca9b31fbc34221 Mon Sep 17 00:00:00 2001 From: asl Date: Mon, 28 Apr 2008 12:48:23 +0000 Subject: [PATCH] fix for PAL19420: the possibility to have own tool manager is implemented (necessary for Gauss viewer sub windows) --- src/SVTK/SVTK_MainWindow.cxx | 27 ++++++++++++++++++--------- src/SVTK/SVTK_MainWindow.h | 3 +++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/SVTK/SVTK_MainWindow.cxx b/src/SVTK/SVTK_MainWindow.cxx index 4685fdfe3..edfeb787a 100644 --- a/src/SVTK/SVTK_MainWindow.cxx +++ b/src/SVTK/SVTK_MainWindow.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include "SVTK_NonIsometricDlg.h" #include "SVTK_UpdateRateDlg.h" @@ -67,11 +68,6 @@ SVTK_MainWindow { setObjectName(theName); setWindowFlags( windowFlags() & ~Qt::Window ); - - myToolBar = myViewWindow->toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), -1, this ); - - createActions(theResourceMgr); - createToolBar(); } /*! @@ -81,6 +77,11 @@ void SVTK_MainWindow ::Initialize(SVTK_RenderWindowInteractor* theInteractor) { + myToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), -1, this ); + + createActions( SUIT_Session::session()->activeApplication()->resourceMgr() ); + createToolBar(); + myInteractor = theInteractor; SetEventDispatcher(myInteractor->GetDevice()); @@ -106,6 +107,14 @@ SVTK_MainWindow { } +/*! + \return assigned tool manager +*/ +QtxActionToolMgr* SVTK_MainWindow::toolMgr() const +{ + return myViewWindow->toolMgr(); +} + /*! \return used SVTK_RenderWindowInteractor */ @@ -397,7 +406,7 @@ QToolBar* SVTK_MainWindow ::getToolBar() { - return myViewWindow->toolMgr()->toolBar( myToolBar ); + return toolMgr()->toolBar( myToolBar ); } void @@ -419,7 +428,7 @@ SVTK_MainWindow ::createActions(SUIT_ResourceMgr* theResourceMgr) { QtxAction* anAction; - QtxActionToolMgr* mgr = myViewWindow->toolMgr(); + QtxActionToolMgr* mgr = toolMgr(); // Dump view anAction = new QtxAction(tr("MNU_DUMP_VIEW"), @@ -584,7 +593,7 @@ void SVTK_MainWindow ::createToolBar() { - QtxActionToolMgr* mgr = myViewWindow->toolMgr(); + QtxActionToolMgr* mgr = toolMgr(); mgr->append( DumpId, myToolBar ); mgr->append( ViewTrihedronId, myToolBar ); @@ -909,5 +918,5 @@ SVTK_MainWindow */ QtxAction* SVTK_MainWindow::action( int id ) const { - return dynamic_cast( myViewWindow->toolMgr()->action( id ) ); + return dynamic_cast( toolMgr()->action( id ) ); } diff --git a/src/SVTK/SVTK_MainWindow.h b/src/SVTK/SVTK_MainWindow.h index dbb26f5db..510266f73 100644 --- a/src/SVTK/SVTK_MainWindow.h +++ b/src/SVTK/SVTK_MainWindow.h @@ -37,6 +37,7 @@ class vtkInteractorStyle; class vtkRenderWindowInteractor; class QtxAction; +class QtxActionToolMgr; class SUIT_ResourceMgr; class SUIT_ViewWindow; @@ -235,6 +236,8 @@ public: QImage dumpView(); protected: + virtual QtxActionToolMgr* toolMgr() const; + void createActions(SUIT_ResourceMgr* theResourceMgr); -- 2.39.2