From 8017b62959a2818f7f14ee82746a24f1a36460d2 Mon Sep 17 00:00:00 2001 From: asv Date: Tue, 23 Aug 2005 12:21:03 +0000 Subject: [PATCH] new field of SUIT_Accel type is added, and its initialization in constructor. --- src/SalomeApp/SalomeApp_Application.cxx | 31 +++++++++++++++++++++++++ src/SalomeApp/SalomeApp_Application.h | 5 ++++ 2 files changed, 36 insertions(+) diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 39fd8cc55..5a47d786b 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -48,6 +48,7 @@ #include #include +#include #include #include @@ -148,6 +149,30 @@ myPrefs( 0 ) mySelMgr = new SalomeApp_SelectionMgr( this ); + myAccel = new SUIT_Accel( desktop() ); + myAccel->setActionKey( SUIT_Accel::PanLeft, CTRL+Key_Left, OCCViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::PanRight, CTRL+Key_Right, OCCViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::PanUp, CTRL+Key_Up, OCCViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::PanDown, CTRL+Key_Down, OCCViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::ZoomIn, CTRL+Key_Plus, OCCViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::ZoomOut, CTRL+Key_Minus, OCCViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::ZoomFit, CTRL+Key_Asterisk, OCCViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::RotateLeft, ALT+Key_Left, OCCViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::RotateRight, ALT+Key_Right, OCCViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::RotateUp, ALT+Key_Up, OCCViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::RotateDown, ALT+Key_Down, OCCViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::PanLeft, CTRL+Key_Left, VTKViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::PanRight, CTRL+Key_Right, VTKViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::PanUp, CTRL+Key_Up, VTKViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::PanDown, CTRL+Key_Down, VTKViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::ZoomIn, CTRL+Key_Plus, VTKViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::ZoomOut, CTRL+Key_Minus, VTKViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::ZoomFit, CTRL+Key_Asterisk, VTKViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::RotateLeft, ALT+Key_Left, VTKViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::RotateRight, ALT+Key_Right, VTKViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::RotateUp, ALT+Key_Up, VTKViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::RotateDown, ALT+Key_Down, VTKViewer_Viewer::Type() ); + connect( desk, SIGNAL( closing( SUIT_Desktop*, QCloseEvent* ) ), this, SLOT( onDesktopClosing( SUIT_Desktop*, QCloseEvent* ) ) ); @@ -1945,3 +1970,9 @@ void SalomeApp_Application::onRegDisplay() regWnd->raise(); regWnd->setActiveWindow(); } + +/*!return keyborad accelerators manager object */ +SUIT_Accel* SalomeApp_Application::accel() const +{ + return myAccel; +} diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index 031c4806d..43fa56db2 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -32,6 +32,7 @@ class SalomeApp_Module; class SalomeApp_Preferences; class SalomeApp_SelectionMgr; class SalomeApp_WidgetContainer; +class SUIT_Accel; class SALOME_LifeCycleCORBA; @@ -103,6 +104,8 @@ public: virtual void createEmptyStudy(); + SUIT_Accel* accel() const; + static CORBA::ORB_var orb(); static SALOMEDSClient_StudyManager* studyMgr(); static SALOME_NamingService* namingService(); @@ -207,6 +210,8 @@ private: ActionMap myActions; WindowMap myWindows; + SUIT_Accel* myAccel; + static SalomeApp_Preferences* _prefs_; }; -- 2.39.2