]> Creatis software - creaContours.git/commitdiff
#3129 creaContours Feature New Normal - branch changeWx28to30 compilation with... changeWx28to30
authorEduardo DAVILA <davila@localhost.localdomain>
Wed, 4 Oct 2017 12:15:52 +0000 (14:15 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Wed, 4 Oct 2017 12:15:52 +0000 (14:15 +0200)
lib/Interface_Icons_NDimensions/interfMainPanel.cxx
lib/Interface_Icons_NDimensions/interfToolsPanels.cxx
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx

index 7d77c933622ace10e4195237b09823ef94fbae81..dac24f69ac7ad532e1b0c0e648b69b3b536313cf 100644 (file)
@@ -330,7 +330,13 @@ void interfMainPanel::showPanel(wxWindow* panel)
        if(currentWindow != NULL){
                currentWindow->Hide();
                /// \TODO fix warning: virtual bool wxSizer::Remove(wxWindow*) is deprecated 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                sizer->Remove(currentWindow);
+#else
+               sizer->Detach(currentWindow);
+#endif
+
        }
        sizer->Add(panel);
        currentWindow = panel;
@@ -356,7 +362,13 @@ void interfMainPanel::hidePanel( )
        if(currentWindow != NULL){
                currentWindow->Hide();
                /// \TODO fix warning: virtual bool wxSizer::Remove(wxWindow*) is deprecated 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                sizer->Remove(currentWindow);
+#else
+               sizer->Detach(currentWindow);
+#endif
+
        }
        wxPanel * emptyPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
        sizer->Add(emptyPanel);
index baa8cd810574b04aa25fa41ab78fd3dabd8e2727..f59c2e20262870de974c22492878cc93331ad8df 100644 (file)
@@ -195,7 +195,15 @@ void interfSpreadPanel::appendStringSpread(std::string val){
        /* // if */
        wxString newstring;
        //newstring.Printf("%s %d -",_wxtextctrlSpread->GetValue(), actualSlice );
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        newstring.append(wxString(_wxtextctrlSpread->GetValue(),wxConvUTF8));
+#else
+       newstring.append( _wxtextctrlSpread->GetValue() );
+#endif
+
+
        newstring.append(wxString(" ",wxConvUTF8));
        newstring.append(wxString(val.c_str(),wxConvUTF8));
        _wxtextctrlSpread->SetValue(newstring);
@@ -326,7 +334,12 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
 
        FillGridWithContoursInformation();
 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFlexGridSizer * sizerSave             = new wxFlexGridSizer(2,2);
+#else
+       wxFlexGridSizer * sizerSave             = new wxFlexGridSizer(2);
+#endif
        sizerSave -> Add( new wxStaticText(this,-1,_T("Save Options: "))  , 1, wxGROW );
        sizerSave->Add( _XYZValues,    1, wxALL, 2 );
        sizerSave->Add( _statistics,   1, wxALL, 2 );
@@ -344,7 +357,12 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        sizerB->Add( showResultImagesBtn,         1, wxALL, 2 );
        sizerB->Add( saveResultsBtn,              1, wxALL, 2 );
 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFlexGridSizer * sizer         = new wxFlexGridSizer(1,8);
+#else
+       wxFlexGridSizer * sizer         = new wxFlexGridSizer(8);
+#endif
        sizer->Add( sizerA                     , 1, wxALL               , 0 );
        sizer->Add( new wxStaticText(this      ,-1,_T("Slice Range"))   , 1, wxALL , 0 );
        sizer->Add( _mbarrangeSliceInformation , 1, wxALL|wxGROW        , 2 );
@@ -409,7 +427,12 @@ void interfInformationPanel::onExtractInformation(wxCommandEvent& event){
 
 void interfInformationPanel::onSaveResults(wxCommandEvent& event)
 {
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog dialog(this, _T("Choose a filename"), _T(""), _T(""), wxFileSelectorDefaultWildcardStr, wxSAVE );
+#else
+       wxFileDialog dialog(this, _T("Choose a filename"), _T(""), _T(""), wxFileSelectorDefaultWildcardStr, wxFD_SAVE );
+#endif
        if (dialog.ShowModal() == wxID_OK)
        {
                onExtractInformation( event );
index 3d4413be34a071a8f99afdf762f7b8e8ee747966..8aaa0bb954ab78dd74df584db0fdc5c959714b3c 100644 (file)
@@ -961,7 +961,12 @@ void wxContourMainFrame::onLoad()
        if(GetFileLocation().empty())
        {
 //------------------------------------------------------------------------------------------------------------
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxOPEN );
+#else
+               wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxFD_OPEN );
+#endif
                if (dialog.ShowModal() == wxID_OK)
                {
                        fileNameContourROI = (const char *)(dialog.GetPath().mb_str());
@@ -1010,16 +1015,11 @@ printf("EED wxContourMainFrame::SetZForAllContours contour=%d \n", i );
        }// for i  list of static things
 }
 
-
-
 void wxContourMainFrame::onLoadContours(std::string fileNameContourROI, bool interactiveInterface)
 {
        char tmp[255];
        char tmpD[255];
-
        FILE *pFile =fopen(fileNameContourROI.c_str(),"r+");
-
-
 //CMRU 03-09-09- ----------------------------------------------------------------------------------------------
        if(pFile != NULL)
        {
@@ -1086,18 +1086,22 @@ printf("EED wxContourMainFrame::onLoadContours  version%s \n", version.c_str() )
                if(pFileData != NULL)
                {
                        fclose(pFileData);
-               }
+               } // if
        }
        _theViewPanel->getSceneManager()->removeSceneContours();
        changeInstant();
 }
 
 
-
-void wxContourMainFrame::onImport(){
+void wxContourMainFrame::onImport()
+{
        std::string filename, filenamecontours;
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog dialog(NULL, _T("Choose a XML Osirix File"), _T(""), _T(""), _T("*.xml"), wxOPEN );
-
+#else
+       wxFileDialog dialog(NULL, _T("Choose a XML Osirix File"), _T(""), _T(""), _T("*.xml"), wxFD_OPEN );
+#endif
        if (dialog.ShowModal() == wxID_OK)
        {
                filename = dialog.GetPath().mb_str();
@@ -1105,19 +1109,25 @@ void wxContourMainFrame::onImport(){
 
                if(filenamecontours.compare("") != 0){
                        onLoadContours(filenamecontours,true);
-               }
-
-       }
+               } // if
+       } // if
 }
-void wxContourMainFrame::onTest(){
+
+void wxContourMainFrame::onTest()
+{
        std::string filename, filenamecontours;
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog dialog(NULL, _T("Choose a File"), _T(""), _T(""), _T("*.*"), wxOPEN );
+#else
+       wxFileDialog dialog(NULL, _T("Choose a File"), _T(""), _T(""), _T("*.*"), wxFD_OPEN );
+#endif
 
        if (dialog.ShowModal() == wxID_OK)
        {
                filename = dialog.GetPath().mb_str();
                std::cout << "This is the filename: " << filename << std::endl;
-       }
+       } // if
 }
 
 
@@ -1127,7 +1137,12 @@ void wxContourMainFrame::onSave(){
        if(GetFileLocation().empty())
        {
 //------------------------------------------------------------------------------------------------------------
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxSAVE );
+#else
+               wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxFD_SAVE );
+#endif
                if (dialog.ShowModal() == wxID_OK)
                {
                        std::string fileNameContourROI = (const char *)(dialog.GetPath().mb_str());
index aac92df99d4bdd62a7cdccd40469018230601430..166f8ed9a5066789c43b8dc33eb3fbe8e3b070ec 100644 (file)
@@ -751,7 +751,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
 
                bool condition = true;  
                int X,Y;
-               wxVTKRenderWindowInteractor *_wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
+               crea::wxVTKRenderWindowInteractor *_wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
                _wxVTKiren->GetEventPosition( X , Y );
 
                bool ctrlKey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey() == 1;
@@ -809,9 +809,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                                        size = selectionSize;
                                        iter = _workingGroup->begin();
                                }
-                       }                       
-                       else
-                       {
+                       } else {
                                
                                _toIncludeAtInteractionGroup = false;
                        }
@@ -1120,7 +1118,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                double sg = (double)(start) / CLOCKS_PER_SEC;
 #endif
                int tmpPx,tmpPy;
-               wxVTKRenderWindowInteractor *wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
+               crea::wxVTKRenderWindowInteractor *wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
                wxVTKiren->GetEventPosition( tmpPx , tmpPy );
                fprintf(ff,"::%s (x,y) = (%i, %i) t(sg): %f\n  \n",method.c_str(), tmpPx, tmpPy, sg);
                fclose(ff);