From: Eduardo DAVILA Date: Fri, 22 Sep 2017 12:25:30 +0000 (+0200) Subject: #3128 creaMaracasVisu Feature New Normal - branch changeWx28to30 compilation with... X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=38e6a09417baf9a03ad75a3c6e74d7a638756cbc;p=creaMaracasVisu.git #3128 creaMaracasVisu Feature New Normal - branch changeWx28to30 compilation with wxWidgets3 --- diff --git a/bbtk/src/bbmaracasvisuContourVOI.cxx b/bbtk/src/bbmaracasvisuContourVOI.cxx index 536d678..5ed739c 100644 --- a/bbtk/src/bbmaracasvisuContourVOI.cxx +++ b/bbtk/src/bbmaracasvisuContourVOI.cxx @@ -64,13 +64,21 @@ END_EVENT_TABLE( ); initializeVOIWidget(); } } - void wxWidgetVOI::initializeVOIWidget(){ + + void wxWidgetVOI::initializeVOIWidget() + { wxSizer* sizer = this->GetSizer(); /// \TODO fix deprecated warning: virtual bool wxSizer::Remove(wxWindow*) is deprecated (declared at /usr/include/wx-2.8/wx/sizer.h:513) - if(mcontourvoiwidget!=NULL){ - sizer->Remove( mcontourvoiwidget ); + if(mcontourvoiwidget!=NULL) + { +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + sizer->Remove( mcontourvoiwidget ); +#else + sizer->Detach( mcontourvoiwidget ); +#endif mcontourvoiwidget->Destroy(); } @@ -84,10 +92,13 @@ END_EVENT_TABLE( ); this->Refresh(); } - void wxWidgetVOI::setBaseView(wxVtkBaseView * wxvtkbaseview){ + void wxWidgetVOI::setBaseView(wxVtkBaseView * wxvtkbaseview) + { this->wxvtkbaseview = wxvtkbaseview; } - void wxWidgetVOI::setImageData(vtkImageData * imagedata){ + + void wxWidgetVOI::setImageData(vtkImageData * imagedata) + { this->imagedata = imagedata; } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp index ab311ae..57fd497 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp @@ -72,7 +72,14 @@ wxManualPaintPanel::wxManualPaintPanel( wxWindow * parent ) this->_gConfigSizer->Add( _mBarSlices, 1, wxGROW ); //GrayLevel Slider this->_gConfigSizer->Add( _txtGrayLevel ); + +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 wxFlexGridSizer *sizerGrayLevel = new wxFlexGridSizer( 2, wxHORIZONTAL ); +#else + wxFlexGridSizer *sizerGrayLevel = new wxFlexGridSizer( 2 ); +#endif + sizerGrayLevel->Add( _sldGrayLevel, 1, wxGROW ); sizerGrayLevel->Add( _graylevelCtrl, 1, wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 ); @@ -87,7 +94,14 @@ wxManualPaintPanel::wxManualPaintPanel( wxWindow * parent ) new wxStaticText( this, -1, _T("Brush Settings") ) ); //BrushSize Slider this->_brushSizer->Add( _txtBrushSize ); + +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 wxFlexGridSizer *sizersdlBrushSize = new wxFlexGridSizer( 2, wxHORIZONTAL ); +#else + wxFlexGridSizer *sizersdlBrushSize = new wxFlexGridSizer( 2 ); +#endif + sizersdlBrushSize->Add( _sldBrushSize, 1, wxGROW ); sizersdlBrushSize->Add( _BrushSizeCtrl, 1, wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.cxx index a465765..738cae1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.cxx @@ -425,24 +425,24 @@ END_EVENT_TABLE() mpWindow::mpWindow( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, int flag ) : wxScrolledWindow( parent, id, wxDefaultPosition, wxDefaultSize, flag, wxT("wxPlotter") ) { - m_scaleX = m_scaleY = 1.0; - m_posX = m_posY = 0; - m_scrX = m_scrY = 64; - m_minX = m_minY = 0; - m_maxX = m_maxY = 0; - maxScrX = maxScrY = 200; - minScrX = minScrY = 0; - m_clickedX = 0; - m_clickedY = 5000; - m_lockaspect = FALSE; - offsetX = offsetY = 0; - offsetPixelX = offsetPixelY= 0; - _bitmap_functions=NULL; - - real_guideLine_X = -1; - real_guideLine_Y = -1; - drawGuides = true; - type=1; + m_scaleX = m_scaleY = 1.0; + m_posX = m_posY = 0; + m_scrX = m_scrY = 64; + m_minX = m_minY = 0; + m_maxX = m_maxY = 0; + maxScrX = maxScrY = 200; + minScrX = minScrY = 0; + m_clickedX = 0; + m_clickedY = 5000; + m_lockaspect = FALSE; + offsetX = offsetY = 0; + offsetPixelX = offsetPixelY = 0; + _bitmap_functions = NULL; + + real_guideLine_X = -1; + real_guideLine_Y = -1; + drawGuides = true; + type = 1; m_popmenu.Append( mpID_CENTER, _("Center"), _("Center plot view to this position")); m_popmenu.Append( mpID_FIT, _("Fit"), _("Set plot view to show all items")); @@ -515,16 +515,13 @@ void mpWindow::ZoomOut() void mpWindow::LockAspect(bool enable) { m_lockaspect = enable; - m_popmenu.Check(mpID_LOCKASPECT, enable); - if (m_lockaspect) { double s = (m_scaleX + m_scaleY)/2; m_scaleX = s; m_scaleY = s; } - UpdateAll(); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.h index a55e7b0..743bc54 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.h @@ -465,6 +465,7 @@ public: int flags = 0); ~mpWindow(); + /** Get reference to context menu of the plot canvas. @return Pointer to menu. The menu can be modified. */ @@ -917,13 +918,22 @@ protected: */ int type; + private: //bitmap of functions wxBitmap *_bitmap_functions; +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 DECLARE_CLASS(mpWindow) +#else + wxDECLARE_DYNAMIC_CLASS(mpWindow); +#endif + DECLARE_EVENT_TABLE() + + }; #endif // _MP_MATHPLOT_H_ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotter.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotter.cxx index 1e80597..c6d803e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotter.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotter.cxx @@ -229,10 +229,20 @@ void pPlotter::setAll() text.Clear(); text = _T("minX="); double realMin_X = actualFunction->getMinX(); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 text = text + realMin_X; +#else + text = text + wxString::FromDouble( realMin_X ); +#endif text = text + _T(" maxX="); double realMax_X = actualFunction->getMaxX(); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 text = text + realMax_X; +#else + text = text + wxString::FromDouble( realMax_X ); +#endif int minShowed = actualFunction->getMinXShowed(); int maxShowed = actualFunction->getMaxXShowed(); barrange -> setRepresentedValues (realMin_X, realMax_X); diff --git a/lib/maracasVisuLib/src/kernel/marParameters.cpp b/lib/maracasVisuLib/src/kernel/marParameters.cpp index b201515..d2d5ae2 100644 --- a/lib/maracasVisuLib/src/kernel/marParameters.cpp +++ b/lib/maracasVisuLib/src/kernel/marParameters.cpp @@ -302,6 +302,7 @@ bool marParameters::load( std::ifstream& is ) int i, s; try { + char tmp[500]; is.read( ( char* )_boolValues, e_bool_cont * sizeof( bool ) ); is.read( ( char* )_intValues, e_int_cont * sizeof( int ) ); is.read( ( char* )_doubleValues, e_double_cont * sizeof( double ) ); @@ -309,7 +310,13 @@ bool marParameters::load( std::ifstream& is ) { is.read( ( char* )&s, sizeof( int ) ); _stringValues[ i ].resize( s ); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 is.read( ( char* )_stringValues[ i ].c_str( ), s * sizeof( char ) ); +#else + is.read( tmp , s * sizeof( char ) ); + _stringValues[ i ]=wxString(tmp); +#endif } // rof return( true ); } @@ -422,7 +429,12 @@ wxArrayString marParameters::getRelationalArray( ) for( i = 0; i < e_string_cont; i++, j += 2 ) { ret.Add( wxString( StringParamNames[ i ], wxConvUTF8) ); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 ret.Add( wxString( _stringValues[ i ].c_str( ), wxConvUTF8 ) ); +#else + ret.Add( wxString( _stringValues[ i ] ) ); +#endif } // rof