From: Eduardo DAVILA Date: Fri, 22 Sep 2017 15:12:11 +0000 (+0200) Subject: #3131 creaImageIO Feature New Normal - branch changeWx28to30 compilation with wxWid... X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=creaImageIO.git;a=commitdiff_plain;h=2281508661c7a5b0732eb6ec64cb97b753df5de0 #3131 creaImageIO Feature New Normal - branch changeWx28to30 compilation with wxWidgets3 --- diff --git a/src/creaImageIOWxAnySimpleDlg.cpp b/src/creaImageIOWxAnySimpleDlg.cpp index 926e118..5a71335 100644 --- a/src/creaImageIOWxAnySimpleDlg.cpp +++ b/src/creaImageIOWxAnySimpleDlg.cpp @@ -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 ) diff --git a/src/creaImageIOWxDescriptorPanel.cpp b/src/creaImageIOWxDescriptorPanel.cpp index 60868d4..9f563b6 100644 --- a/src/creaImageIOWxDescriptorPanel.cpp +++ b/src/creaImageIOWxDescriptorPanel.cpp @@ -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"), diff --git a/src/creaImageIOWxDumpPanel.cpp b/src/creaImageIOWxDumpPanel.cpp index 15e9966..7ee1f30 100644 --- a/src/creaImageIOWxDumpPanel.cpp +++ b/src/creaImageIOWxDumpPanel.cpp @@ -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; diff --git a/src/creaImageIOWxGimmickTools.cpp b/src/creaImageIOWxGimmickTools.cpp index 2d06a41..b14ad66 100644 --- a/src/creaImageIOWxGimmickTools.cpp +++ b/src/creaImageIOWxGimmickTools.cpp @@ -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 ); diff --git a/src/creaImageIOWxGimmickView.cpp b/src/creaImageIOWxGimmickView.cpp index 0ee66e5..c538c6a 100644 --- a/src/creaImageIOWxGimmickView.cpp +++ b/src/creaImageIOWxGimmickView.cpp @@ -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"), diff --git a/src/creaImageIOWxSimpleDlg.cpp b/src/creaImageIOWxSimpleDlg.cpp index ca98430..09f7e02 100644 --- a/src/creaImageIOWxSimpleDlg.cpp +++ b/src/creaImageIOWxSimpleDlg.cpp @@ -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 )