]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
"titled" popups implemented.
authorasv <asv@opencascade.com>
Tue, 31 May 2005 06:51:34 +0000 (06:51 +0000)
committerasv <asv@opencascade.com>
Tue, 31 May 2005 06:51:34 +0000 (06:51 +0000)
src/CAM/CAM_Application.cxx
src/CAM/CAM_Application.h
src/CAM/CAM_Module.h
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h
src/STD/STD_Application.cxx
src/STD/STD_Application.h
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Module.cxx
src/SalomeApp/SalomeApp_Module.h
src/SalomeApp/SalomeApp_Study.cxx

index f9e7a3dd62d1eec8a094f62cbe66377282b74435..5f9696d462de0e9c1ac055cc3197dce2d345eb5e 100755 (executable)
@@ -10,6 +10,8 @@
 #include <qfile.h> 
 #include <qfileinfo.h>
 #include <qtextstream.h>
+#include <qlabel.h>
+#include <qfont.h>
 
 #ifdef WIN32
 #include <windows.h>
@@ -377,9 +379,9 @@ void CAM_Application::readModuleList()
     SUIT_MessageBox::error1( 0, tr( "Error" ), tr( "Can not load modules configuration file " ), tr( "Ok" ) );
 }
 
-void CAM_Application::contextMenuPopup( const QString& type, QPopupMenu* thePopup )
+void CAM_Application::contextMenuPopup( const QString& type, QPopupMenu* thePopup, QString& title )
 {
   // to do : add common items for popup menu ( if they are exist )
   if ( activeModule() ) 
-    activeModule()->contextMenuPopup( type, thePopup );
+    activeModule()->contextMenuPopup( type, thePopup, title );
 }
index f85ae75cf58f2d957d27f91cbe9686d459c29528..d9eaff9a7c25c6f490d130a921074c0559912cdb 100755 (executable)
@@ -41,7 +41,7 @@ public:
 
   virtual bool        activateModule( const QString& );
 
-  virtual void        contextMenuPopup( const QString&, QPopupMenu* );
+  virtual void        contextMenuPopup( const QString&, QPopupMenu*, QString& );
 
   QString             moduleName( const QString& ) const;
   QString             moduleTitle( const QString& ) const;
index 34990069e3caa66d8f03577a0eeee83f2f4db4bc..ed95b21ae0c5913efb5d080f4645355f7d52a2c3 100755 (executable)
@@ -35,7 +35,7 @@ public:
   CAM_DataModel*         dataModel() const;
   CAM_Application*       application() const;
 
-  virtual void           contextMenuPopup( const QString&, QPopupMenu* ) {};
+  virtual void           contextMenuPopup( const QString&, QPopupMenu*, QString& title ) {};
   virtual void           updateCommandsStatus() {};
 
 public slots:
index d0889bd5c46e5cc6d48f6c01314a077c8d63938b..9d6a53d79e76991c87d99d001da0865e9cd35cff 100644 (file)
@@ -369,7 +369,7 @@ void SALOME_PYQT_Module::onDesktopActivated()
   Context popup menu request.
   Called when user activates popup menu in some window (view, object browser, etc).
   */
-void SALOME_PYQT_Module::contextMenuPopup( const QString& theContext, QPopupMenu* thePopupMenu )
+void SALOME_PYQT_Module::contextMenuPopup( const QString& theContext, QPopupMenu* thePopupMenu, QString& /*title*/ )
 {
   MESSAGE( "SALOME_PYQT_Module::contextMenuPopup : " << theContext.latin1() );
   // perform synchronous request to Python event dispatcher
index d0f402c5fa568f129e4cd075af88eb3d8f38735f..2d87a3ae7642ef9c83af587ee70d716bba1a9528 100644 (file)
@@ -82,7 +82,7 @@ public:
   void           viewManagers( QStringList& ) const;
 
   /* context popup menu request */
-  void           contextMenuPopup( const QString&, QPopupMenu* );
+  void           contextMenuPopup( const QString&, QPopupMenu*, QString& );
   
 protected:
   /* data model creation */
index 4c2f1b1902485596fc90649e769de9cb71348c34..9f7075162a2030088540003ef834fe65fbecacae 100755 (executable)
@@ -13,6 +13,7 @@
 #include <QtxDockAction.h>
 #include <QtxActionMenuMgr.h>
 #include <QtxActionToolMgr.h>
+#include <QtxPopupMenu.h>
 
 #include <qmenubar.h>
 #include <qtoolbar.h>
@@ -603,9 +604,11 @@ void STD_Application::setActiveViewManager( SUIT_ViewManager* vm )
 
 void STD_Application::onConnectPopupRequest( SUIT_PopupClient* client, QContextMenuEvent* e )
 {
-  QPopupMenu* popup = new QPopupMenu();
+  QtxPopupMenu* popup = new QtxPopupMenu();
   // fill popup by own items
-  contextMenuPopup( client->popupClientType(), popup );
+  QString title;
+  contextMenuPopup( client->popupClientType(), popup, title );
+  popup->setTitleText( title );
 
   popup->insertSeparator();
   // add items from popup client
index 1e2427e5770348422d9c536bf6d26b06e74ffc65..886761ad7176bade4ceaf1984a918599b86656e3 100755 (executable)
@@ -59,7 +59,7 @@ public:
 
   virtual void          start();
 
-  virtual void          contextMenuPopup( const QString&, QPopupMenu* ) {}
+  virtual void          contextMenuPopup( const QString&, QPopupMenu*, QString& ) {}
 
 signals:
   void                  viewManagerAdded( SUIT_ViewManager* );
index 78e3610f047291ecbced0b0ceb56596952704498..c33026683fbb56b8ec2c4e5652ba07526082bef4 100644 (file)
@@ -463,8 +463,6 @@ void SalomeApp_Application::updateCommandsStatus()
 //=======================================================================
 void SalomeApp_Application::onHelpAbout()
 {
-  //QAD_MessageBox::info1( myDesktop, tr( "ABOUT" ), tr( "APP_NAME_LONG" ).arg( APP_VERSION ), tr( "BUT_OK" ) );
-
   QMessageBox aDlg( desktop(), "AboutDlg" );
 
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
@@ -472,7 +470,7 @@ void SalomeApp_Application::onHelpAbout()
 
   QFontMetrics m( aDlg.font() );
   QImage anImage = aPixmap.convertToImage();
-  int w = m.height() * 3;
+  int w = m.height() * 5;
   anImage = anImage.scale( w, w );
   aPixmap.convertFromImage( anImage );
 
@@ -782,6 +780,13 @@ void SalomeApp_Application::defaultViewManagers( QStringList& ) const
 {
 }
 
+void SalomeApp_Application::afterCloseDoc()
+{
+  updateWindows();
+
+  CAM_Application::afterCloseDoc();
+}
+
 CORBA::ORB_var SalomeApp_Application::orb()
 {
   ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
index 0b7dbac7864e929095159b652be64646fa21b385..d1cc44ba1b8c881030c2e1ce3becf4191c6c8a1a 100644 (file)
@@ -112,7 +112,7 @@ void SalomeApp_Module::updateObjBrowser( bool updateDataModel, SUIT_DataObject*
   getApp()->objectBrowser()->updateTree( root );
 }
 
-void SalomeApp_Module::contextMenuPopup( const QString& client, QPopupMenu* menu )
+void SalomeApp_Module::contextMenuPopup( const QString& client, QPopupMenu* menu, QString& /*title*/ )
 {
   SalomeApp_Selection* sel = createSelection();
   sel->init( client, getApp()->selectionMgr() );
index 62780b60fb0dd4464eeb16fec1ddd3bed8be14bf..8be396c33f9d2a65dfd05916774fbbbbae380119 100644 (file)
@@ -46,7 +46,7 @@ public:
   virtual void                        viewManagers( QStringList& ) const;
   virtual QString                     engineIOR() const;
 
-  virtual void                        contextMenuPopup( const QString&, QPopupMenu* );
+  virtual void                        contextMenuPopup( const QString&, QPopupMenu*, QString& );
 
   // Convenient shortcuts
   SalomeApp_Application*              getApp() const;
index c7dff3b6885e6a9968b98af391328621e9f6e95b..f735c66588d85de553102d942749273fd8f15635 100644 (file)
@@ -187,10 +187,10 @@ void SalomeApp_Study::closeDocument()
   emit closed( this );
 
   // close SALOMEDS document
-  _PTR(Study) st = studyDS();
-  if ( st.get() )
+  _PTR(Study) studyPtr = studyDS();
+  if ( studyPtr.get() )
   {
-    SalomeApp_Application::studyMgr()->Close( st );
+    SalomeApp_Application::studyMgr()->Close( studyPtr );
     SALOMEDSClient_Study* aStudy = 0;
     setStudyDS( _PTR(Study)(aStudy) );
   }