]> Creatis software - creaImageIO.git/commitdiff
#3131 creaImageIO Feature New Normal - branch changeWx28to30 compilation with wxWid...
authorEduardo DAVILA <davila@localhost.localdomain>
Fri, 22 Sep 2017 15:12:11 +0000 (17:12 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Fri, 22 Sep 2017 15:12:11 +0000 (17:12 +0200)
src/creaImageIOWxAnySimpleDlg.cpp
src/creaImageIOWxDescriptorPanel.cpp
src/creaImageIOWxDumpPanel.cpp
src/creaImageIOWxGimmickTools.cpp
src/creaImageIOWxGimmickView.cpp
src/creaImageIOWxSimpleDlg.cpp

index 926e1181675271f373a4e08021c5670b1fa536a3..5a713352cac2f32494cb0499d842a421e32a44f6 100644 (file)
@@ -88,7 +88,12 @@ namespace creaImageIO
      void WxAnySimpleDlg::OnReadFile(wxCommandEvent& event)
       {
           int resultShowModal;
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
           wxFileDialog* fileDlg = new wxFileDialog( 0,  _T("Select file"), _T(""), _T(""), crea::std2wx("*"), wxOPEN |wxFD_MULTIPLE, wxDefaultPosition);
+#else
+          wxFileDialog* fileDlg = new wxFileDialog( 0,  _T("Select file"), _T(""), _T(""), crea::std2wx("*"), wxFD_OPEN |wxFD_MULTIPLE, wxDefaultPosition);
+#endif
     
           resultShowModal = fileDlg->ShowModal();
           if ( resultShowModal==wxID_OK )
index 60868d45ab7e65817e5c4eb73161c799c99b4fd3..9f563b66493cee26f216d0f00ff303d4dbb75781 100644 (file)
@@ -109,7 +109,14 @@ namespace creaImageIO
 
        // RESULT
 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        ResultCtrl=new wxTextCtrl(this, ID_EL_CTRL,_T(""), wxPoint(5,150), wxSize(250,310), wxTE_READONLY| wxMac | wxTE_MULTILINE | wxTE_RICH );
+#else
+       ResultCtrl=new wxTextCtrl(this, ID_EL_CTRL,_T(""), wxPoint(5,150), wxSize(250,310), wxTE_READONLY| wxTE_MULTILINE | wxTE_RICH );
+#endif
+
+
        wxButton *RemoveCtrl = new wxButton(this, ID_REMOVE_ADD,_T("Remove an entry"), wxPoint(280,200) );
        Connect( RemoveCtrl->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxDescriptorPanel::OnRemove ); 
 
@@ -588,7 +595,12 @@ namespace creaImageIO
   //////////////////////////////////////////////////
    void WxDescriptorPanel::OnLoad(wxCommandEvent &Event)
    {
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
            long style = wxOPEN | wxFILE_MUST_EXIST;
+#else
+           long style = wxFD_OPEN | wxFD_FILE_MUST_EXIST;
+#endif
           LevelCtrl->SetValue(_T("patient"));
           ResultCtrl->Clear();
           DscpTree.clear();
@@ -635,7 +647,12 @@ namespace creaImageIO
    const std::string WxDescriptorPanel::saveDescriptor()
    {
           std::string file = "";
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                long style = wxSAVE;
+#else
+               long style = wxFD_SAVE;
+#endif
                std::string wc("*.dscp");
                wxFileDialog* FD = new wxFileDialog( 0, 
                                                _T("Select file"),
index 15e9966bd78c94949993e6feab431a68f3a5c68b..7ee1f30ced5c124a246aba148b725ec565f801cf 100644 (file)
@@ -61,7 +61,14 @@ namespace creaImageIO
        wxToolBar *mToolBar = new wxToolBar(this,-1,wxDefaultPosition,wxDefaultSize);
        mToolBar->AddTool( DUMP_SAVE_ID,_T("Save"), mIcon->GetBitmap(0), _T("Save Dicom Tags in text file"));
        mToolBar->Realize();
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        DumpText = new wxTextCtrl( this, wxID_ANY,_T(""), wxPoint(5,30), wxSize(520,510), wxTE_READONLY| wxMac | wxTE_MULTILINE | wxTE_RICH );
+#else
+       DumpText = new wxTextCtrl( this, wxID_ANY,_T(""), wxPoint(5,30), wxSize(520,510), wxTE_READONLY | wxTE_MULTILINE | wxTE_RICH );
+#endif
+
        Layout(); 
        Print();
        }
@@ -221,8 +228,14 @@ namespace creaImageIO
 ///////////////////////////////////////////////////
        void WxDumpPanel::SaveInfos(wxCommandEvent& event)
        {
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog* FD = new wxFileDialog( 0,_T("Select file"), _T(""), _T(""),
                                               crea::std2wx("*.txt"), wxOPEN, wxDefaultPosition);
+#else
+       wxFileDialog* FD = new wxFileDialog( 0,_T("Select file"), _T(""), _T(""),
+                                              crea::std2wx("*.txt"), wxFD_OPEN, wxDefaultPosition);
+#endif
         if (FD->ShowModal()==wxID_OK)
                {
                        wxBusyCursor busy;
index 2d06a41d773335c5f672b7772b43ac3d2102b5d4..b14ad6637e3f0558dfc380d312ebac21fb9171c1 100644 (file)
@@ -56,11 +56,22 @@ namespace creaImageIO
                Connect( _addCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxGimmickTools::onAddToDatabase );
                Connect( _mhdCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxGimmickTools::onMHD );
                
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                wxFlexGridSizer *textSizer = new wxFlexGridSizer(1,2);
+#else
+               wxFlexGridSizer *textSizer = new wxFlexGridSizer(2);
+#endif
+
                textSizer->Add( new wxStaticText(this, -1, _T("Transform a Bruker 'Serie'/'Study'/'set of Studies' directory into Dicom / MHD format.")), 1, wxGROW );
                textSizer->Add( new wxStaticText(this, -1, _T("If checkbox is selected images will be loaded into the DB.")), 1, wxGROW );
 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                wxFlexGridSizer *sizer  = new wxFlexGridSizer(2,5);
+#else
+               wxFlexGridSizer *sizer  = new wxFlexGridSizer(5);
+#endif
                sizer->Add( new wxStaticText(this, -1, _T(" ")), 1, wxGROW );
                sizer->Add( new wxStaticText(this, -1, _T(" ")), 1, wxGROW );
                sizer->Add( _inputPath,   1, wxGROW );
@@ -72,7 +83,12 @@ namespace creaImageIO
                sizer->Add( _addCheckBox, 1, wxGROW );
                sizer->Add( _mhdCheckBox, 1, wxGROW );
                
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                wxFlexGridSizer *topSizer = new wxFlexGridSizer(1, 2);
+#else
+               wxFlexGridSizer *topSizer = new wxFlexGridSizer(2);
+#endif
                topSizer->Add( textSizer, 1, wxGROW );
                topSizer->Add( sizer,     1, wxGROW );
                this->SetSizer( topSizer );
index 0ee66e527742783db26a6974ce6f4980a4252c02..c538c6a844ba183dd1b9a2f233439ec0fd21f4ce 100644 (file)
@@ -504,7 +504,15 @@ namespace creaImageIO
   void WxGimmickView::OnAddFiles(wxCommandEvent& event)
   {
     mViewer->StopPlayer();
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
     long style = wxOPEN | wxFILE_MUST_EXIST | wxFD_MULTIPLE;
+#else
+    long style = wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE;
+#endif
+
+
     std::string wc("*");
     wxFileDialog* FD = new wxFileDialog( 0, 
                                         _T("Select file"),
index ca984309b7eaf5d5e5cb27d8f3110c929317dd28..09f7e022d348a298c2e5f276e98f83f8bbba7f28 100644 (file)
@@ -69,7 +69,12 @@ namespace creaImageIO
          void WxSimpleDlg::OnReadFile(wxCommandEvent& event)
          {
                  int resultShowModal;
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                  wxFileDialog* fileDlg = new wxFileDialog( 0,  _T("Select file"), _T(""), _T(""), crea::std2wx("*"), wxOPEN |wxFD_MULTIPLE, wxDefaultPosition);
+#else
+                 wxFileDialog* fileDlg = new wxFileDialog( 0,  _T("Select file"), _T(""), _T(""), crea::std2wx("*"), wxFD_OPEN |wxFD_MULTIPLE, wxDefaultPosition);
+#endif
     
                    resultShowModal = fileDlg->ShowModal();
                        if ( resultShowModal==wxID_OK )