]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
#3129 creaContours Feature New Normal - branch changeWx28to30 compilation with...
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourMainFrame.cxx
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());