From 1cde44fb05e35ef5f43e4e9dff7e73eb634d8dd9 Mon Sep 17 00:00:00 2001 From: vtn Date: Fri, 22 Mar 2013 09:04:14 +0000 Subject: [PATCH] Fix for #247 issue. --- src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx | 32 +++++++++++++++++++++++ src/SALOME_PYQT/SalomePyQt/SalomePyQt.h | 1 + src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip | 1 + 3 files changed, 34 insertions(+) diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx index 6efe3b600..d8bcbb819 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx @@ -3430,6 +3430,38 @@ void SalomePyQt::updateCurves(const int id) ProcessVoidEvent( new TEvent(id) ); } +/*! + \fn QString SalomePyQt::getPlot2dTitle( const int id, ObjectType type = MainTitle ) + \brief Get title of corresponding type + \param id window identifier + \param type is type of title + \return title of corresponding type +*/ + +class TGetPlot2dTitle: public SALOME_Event +{ +public: + typedef QString TResult; + TResult myResult; + int myWndId; + ObjectType myType; + TGetPlot2dTitle(const int id, ObjectType type) : + myWndId(id), + myType(type) {} + virtual void Execute() { + Plot2d_ViewWindow* wnd = dynamic_cast(getWnd( myWndId )); + if ( wnd ) + { + myResult = wnd->getViewFrame()->getTitle((Plot2d_ViewFrame::ObjectType)myType); + } + } +}; +QString SalomePyQt::getPlot2dTitle(const int id, ObjectType type) +{ + return ProcessEvent( new TGetPlot2dTitle(id, type) ); +} + + /*! \fn void SalomePyQt::setPlot2dTitle( const int id, const QString& title, ObjectType type = MainTitle, bool show = true ) \brief Set title of corresponding type diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h index 98eb7f9fa..30487676e 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h @@ -277,6 +277,7 @@ public: static void eraseCurve(const int, Plot2d_Curve*); static void eraseCurve(Plot2d_Curve*); static void updateCurves( const int ); + static QString getPlot2dTitle(const int, ObjectType = MainTitle); static void setPlot2dTitle(const int, const QString&, ObjectType = MainTitle, bool = true); static QList getPlot2dFitRangeByCurves(const int); static QList getPlot2dFitRangeCurrent(const int); diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip index 464835c19..cde76dc33 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip @@ -400,6 +400,7 @@ public: static void eraseCurve(const int, Plot2d_Curve*) /ReleaseGIL/ ; static void eraseCurve(Plot2d_Curve*) /ReleaseGIL/ ; static void updateCurves( const int ) /ReleaseGIL/ ; + static QString getPlot2dTitle(const int, ObjectType = MainTitle) /ReleaseGIL/ ; static void setPlot2dTitle(const int, const QString&, ObjectType = MainTitle, bool = true) /ReleaseGIL/ ; static QList getPlot2dFitRangeByCurves(const int) /ReleaseGIL/ ; static QList getPlot2dFitRangeCurrent(const int) /ReleaseGIL/ ; -- 2.39.2