]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
new field of SUIT_Accel type is added, and its initialization in constructor.
authorasv <asv@opencascade.com>
Tue, 23 Aug 2005 12:21:03 +0000 (12:21 +0000)
committerasv <asv@opencascade.com>
Tue, 23 Aug 2005 12:21:03 +0000 (12:21 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h

index 39fd8cc55bbf709eb2f5f19ce6774b6e0ac545cd..5a47d786bca029cd8ecd677c0475de0dfb210422 100644 (file)
@@ -48,6 +48,7 @@
 
 #include <SUIT_Tools.h>
 #include <SUIT_Session.h>
+#include <SUIT_Accel.h>
 
 #include <QtxToolBar.h>
 #include <QtxMRUAction.h>
@@ -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;
+}
index 031c4806d7ec246ac8e2d7e45b8efb078e83a272..43fa56db2d7cdce649bcbeb4f6e22cfbcf7a6a6a 100644 (file)
@@ -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_;
 };