From 4064f45bd83f2bd7383dbf9abd8f2fc6bec3eecd Mon Sep 17 00:00:00 2001 From: asv Date: Fri, 26 Aug 2005 11:30:49 +0000 Subject: [PATCH] Switching from SVTK to VVTK InteractorStyle is being implemented. --- src/VVTK/VVTK_ViewWindow.cxx | 29 +++++++++++++++++++++++++++++ src/VVTK/VVTK_ViewWindow.h | 8 ++++++++ 2 files changed, 37 insertions(+) diff --git a/src/VVTK/VVTK_ViewWindow.cxx b/src/VVTK/VVTK_ViewWindow.cxx index a9c905f0..f42c3050 100755 --- a/src/VVTK/VVTK_ViewWindow.cxx +++ b/src/VVTK/VVTK_ViewWindow.cxx @@ -4,6 +4,14 @@ #include "SVTK_View.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" + +#include "QtxAction.h" + +#include + + //---------------------------------------------------------------------------- VVTK_ViewWindow ::VVTK_ViewWindow( SUIT_Desktop* theDesktop, @@ -14,6 +22,19 @@ VVTK_ViewWindow connect(this,SIGNAL(selectionChanged()), theModel,SLOT(onSelectionChanged())); + + // create another toolbar + myToolBar = new QToolBar(this); + myToolBar->setCloseMode(QDockWindow::Undocked); + myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL")); + + SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); + // SVTK / VVTK switcher action + QtxAction* aAction = new QtxAction(tr("MNU_VVTK_SWITCH"), aResMgr->loadPixmap( "VISU", tr( "ICON_VVTK_SWITCH" ) ), + tr( "MNU_VVTK_SWITCH" ), 0, this); + aAction->setStatusTip(tr("DSC_VVTK_SWITCH")); + connect(aAction, SIGNAL(activated()), this, SLOT(onSwitchIS())); + aAction->addTo( myToolBar ); } //---------------------------------------------------------------------------- @@ -21,3 +42,11 @@ VVTK_ViewWindow ::~VVTK_ViewWindow() { } + +//---------------------------------------------------------------------------- +void +VVTK_ViewWindow +::onSwitchIS() +{ + printf( "onswitch IS \n\n" ); +} diff --git a/src/VVTK/VVTK_ViewWindow.h b/src/VVTK/VVTK_ViewWindow.h index 3507f7f0..e646b925 100755 --- a/src/VVTK/VVTK_ViewWindow.h +++ b/src/VVTK/VVTK_ViewWindow.h @@ -9,6 +9,7 @@ #include "SVTK_ViewWindow.h" class VVTK_Viewer; +class QToolBar; class VVTK_EXPORT VVTK_ViewWindow : public SVTK_ViewWindow { @@ -17,6 +18,13 @@ class VVTK_EXPORT VVTK_ViewWindow : public SVTK_ViewWindow public: VVTK_ViewWindow( SUIT_Desktop*, VVTK_Viewer* ); virtual ~VVTK_ViewWindow(); + +protected slots: + void onSwitchIS(); + +private: + QToolBar* myToolBar; + }; #ifdef WIN32 -- 2.39.2