From a947e05a9b21d1c671fb63c69db4a643f6c17532 Mon Sep 17 00:00:00 2001 From: asv Date: Tue, 31 May 2005 06:51:34 +0000 Subject: [PATCH] "titled" popups implemented. --- src/CAM/CAM_Application.cxx | 6 ++++-- src/CAM/CAM_Application.h | 2 +- src/CAM/CAM_Module.h | 2 +- .../SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx | 2 +- src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h | 2 +- src/STD/STD_Application.cxx | 7 +++++-- src/STD/STD_Application.h | 2 +- src/SalomeApp/SalomeApp_Application.cxx | 11 ++++++++--- src/SalomeApp/SalomeApp_Module.cxx | 2 +- src/SalomeApp/SalomeApp_Module.h | 2 +- src/SalomeApp/SalomeApp_Study.cxx | 6 +++--- 11 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/CAM/CAM_Application.cxx b/src/CAM/CAM_Application.cxx index f9e7a3dd6..5f9696d46 100755 --- a/src/CAM/CAM_Application.cxx +++ b/src/CAM/CAM_Application.cxx @@ -10,6 +10,8 @@ #include #include #include +#include +#include #ifdef WIN32 #include @@ -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 ); } diff --git a/src/CAM/CAM_Application.h b/src/CAM/CAM_Application.h index f85ae75cf..d9eaff9a7 100755 --- a/src/CAM/CAM_Application.h +++ b/src/CAM/CAM_Application.h @@ -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; diff --git a/src/CAM/CAM_Module.h b/src/CAM/CAM_Module.h index 34990069e..ed95b21ae 100755 --- a/src/CAM/CAM_Module.h +++ b/src/CAM/CAM_Module.h @@ -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: diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx index d0889bd5c..9d6a53d79 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx @@ -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 diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h index d0f402c5f..2d87a3ae7 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h @@ -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 */ diff --git a/src/STD/STD_Application.cxx b/src/STD/STD_Application.cxx index 4c2f1b190..9f7075162 100755 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -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 diff --git a/src/STD/STD_Application.h b/src/STD/STD_Application.h index 1e2427e57..886761ad7 100755 --- a/src/STD/STD_Application.h +++ b/src/STD/STD_Application.h @@ -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* ); diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 78e3610f0..c33026683 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -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_::Instance(); diff --git a/src/SalomeApp/SalomeApp_Module.cxx b/src/SalomeApp/SalomeApp_Module.cxx index 0b7dbac78..d1cc44ba1 100644 --- a/src/SalomeApp/SalomeApp_Module.cxx +++ b/src/SalomeApp/SalomeApp_Module.cxx @@ -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() ); diff --git a/src/SalomeApp/SalomeApp_Module.h b/src/SalomeApp/SalomeApp_Module.h index 62780b60f..8be396c33 100644 --- a/src/SalomeApp/SalomeApp_Module.h +++ b/src/SalomeApp/SalomeApp_Module.h @@ -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; diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index c7dff3b68..f735c6658 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -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) ); } -- 2.39.2