]> Creatis software - creaMaracasVisu.git/commitdiff
#3128 creaMaracasVisu Feature New Normal - branch changeWx28to30 compilation with...
authorEduardo DAVILA <davila@localhost.localdomain>
Fri, 22 Sep 2017 12:25:30 +0000 (14:25 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Fri, 22 Sep 2017 12:25:30 +0000 (14:25 +0200)
bbtk/src/bbmaracasvisuContourVOI.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotter.cxx
lib/maracasVisuLib/src/kernel/marParameters.cpp

index 536d67833e6ab35e184e288bcecc4b682c668bef..5ed739c404743cfc4bf63649f7641d0b08e93f42 100644 (file)
@@ -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;
   }
 
index ab311ae392aaa469c0c690c4ff9dbfe323cd7c26..57fd497a452561a4a12581e93187cf765dd599f6 100644 (file)
@@ -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 );
index a465765e2663c6fb4835b3df0a097e4abc96f2d2..738cae1a18c679ffc58824cb6c176891870dfde2 100644 (file)
@@ -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();
 }
 
index a55e7b0d1c4b8256395920a05ca98082c6f75822..743bc54d5cca32ab867b1995d1ce8dce58493a1f 100644 (file)
@@ -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_
index 1e80597db847ec10a8969e9f9cd9a0de58152e87..c6d803e05e23014b2513cfbe8f2c00c944754fb8 100644 (file)
@@ -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);
index b201515ddea4f6c5f988fa77c01057016077d368..d2d5ae212cd7265a0a6be5b80e3f5f978c3a7518 100644 (file)
@@ -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