From: sln Date: Fri, 15 Jul 2011 14:35:21 +0000 (+0000) Subject: Migration on VS9 (2008) + Integration of V1.6.4 sources X-Git-Tag: CTH_V17a~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e1af6cc5f51ed5220eda1aab656baa98ad951ef5;p=modules%2Fgui.git Migration on VS9 (2008) + Integration of V1.6.4 sources --- diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index 420103f47..e5100107e 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -882,21 +882,46 @@ int Plot2d_ViewFrame::testOperation( const QMouseEvent& me ) const int panBtn = Qt::ControlModifier | Qt::MidButton; const int fitBtn = Qt::ControlModifier | Qt::RightButton; - if ( btn == zoomBtn ) { - QPixmap zoomPixmap (imageZoomCursor); - QCursor zoomCursor (zoomPixmap); - myPlot->canvas()->setCursor( zoomCursor ); - return ZoomId; + //switch (btn) + //{ + //case zoomBtn: + // { + // QPixmap zoomPixmap (imageZoomCursor); + // QCursor zoomCursor (zoomPixmap); + // myPlot->canvas()->setCursor( zoomCursor ); + // return ZoomId; + // } + //case panBtn: + // myPlot->canvas()->setCursor( QCursor( Qt::SizeAllCursor ) ); + // return PanId; + //case fitBtn: + // myPlot->canvas()->setCursor( QCursor( Qt::PointingHandCursor ) ); + // return FitAreaId; + //default : + // return NoOpId; + //} + if(btn == zoomBtn) + { + QPixmap zoomPixmap (imageZoomCursor); + QCursor zoomCursor (zoomPixmap); + myPlot->canvas()->setCursor( zoomCursor ); + return ZoomId; + } + else if(btn == panBtn) + { + myPlot->canvas()->setCursor( QCursor( Qt::SizeAllCursor ) ); + return PanId; } - else if ( btn == panBtn ) { - myPlot->canvas()->setCursor( QCursor( Qt::SizeAllCursor ) ); - return PanId; + else if(btn == fitBtn) + { + myPlot->canvas()->setCursor( QCursor( Qt::PointingHandCursor ) ); + return FitAreaId; } - else if ( btn == fitBtn ) { - myPlot->canvas()->setCursor( QCursor( Qt::PointingHandCursor ) ); - return FitAreaId; + else + { + return NoOpId; } - return NoOpId; + } /*! @@ -1168,19 +1193,28 @@ void Plot2d_ViewFrame::onCurvesSettings() /*! "Fit Data" command slot -*/ + */ void Plot2d_ViewFrame::onFitData() { Plot2d_FitDataDlg* dlg = new Plot2d_FitDataDlg( this, mySecondY ); double xMin,xMax,yMin,yMax,y2Min,y2Max; getFitRanges(xMin,xMax,yMin,yMax,y2Min,y2Max); - + dlg->setRange( xMin, xMax, yMin, yMax, y2Min, y2Max ); - if ( dlg->exec() == QDialog::Accepted ) { + if ( dlg->exec() == QDialog::Accepted ) + { int mode = dlg->getRange( xMin, xMax, yMin, yMax, y2Min, y2Max ); fitData(mode,xMin,xMax,yMin,yMax,y2Min,y2Max); + + if ( mode == 1 ) + emit xRangeUpdated( xMin, xMax ); + else if ( mode == 2 ) + emit yRangeUpdated( yMin, yMax, y2Min, y2Max ); + else + emit bothRangesUpdated( xMin, xMax, yMin, yMax, y2Min, y2Max ); } delete dlg; + } /*! diff --git a/src/Plot2d/Plot2d_ViewFrame.h b/src/Plot2d/Plot2d_ViewFrame.h index 9d0c2c23b..3d585bbfa 100755 --- a/src/Plot2d/Plot2d_ViewFrame.h +++ b/src/Plot2d/Plot2d_ViewFrame.h @@ -186,6 +186,10 @@ signals: void curveErased( Plot2d_Curve* ); void curvesErased( const curveList& ); void curvesUpdated(); + void xRangeUpdated( const double&, const double&); + void yRangeUpdated( const double&, const double&, const double&, const double&); + void bothRangesUpdated( const double&, const double&, const double&, + const double&, const double&, const double& ); protected: Plot2d_Plot2d* myPlot; diff --git a/src/SUIT/SUIT_ViewManager.cxx b/src/SUIT/SUIT_ViewManager.cxx index 761bcab15..eb5dbd882 100755 --- a/src/SUIT/SUIT_ViewManager.cxx +++ b/src/SUIT/SUIT_ViewManager.cxx @@ -340,6 +340,14 @@ void SUIT_ViewManager::closeAllViews() for ( int i = 0; i < myViews.size(); i++ ) delete myViews[i]; myViews.clear(); + + // CS suggests follwoing code because of unknown reason + // i.e. the first view is always closed + /*int nbViews = myViews.size(); + for ( int i = 0; i < nbViews; i++ ) + closeView( myViews[0] ); + myViews.clear();*/ + } /*! diff --git a/src/SVTK/SVTK_RenderWindowInteractor.h b/src/SVTK/SVTK_RenderWindowInteractor.h index b72615593..791d9f2b6 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.h +++ b/src/SVTK/SVTK_RenderWindowInteractor.h @@ -89,6 +89,9 @@ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget void InvokeEvent(unsigned long theEvent, void* theCallData); + //! CS-integration during developing GUITHARE V1.6l no comments provided + virtual QPaintEngine* paintEngine() const { return 0; } + public slots: //! Need for initial contents display on Win32 virtual void show();