X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fdocs.cpp;h=028c8214fe24841e2700209bbd4c6f670620d534;hp=0f07a5223507874b56fc5c7c59a20838a512f942;hb=f7ee98f7d964ed361068179f0e7ea4475ed1abdf;hpb=37d0a9642338bd25e4185f8c96fbef445d6988ff diff --git a/src/docs.cpp b/src/docs.cpp index 0f07a52..028c821 100644 --- a/src/docs.cpp +++ b/src/docs.cpp @@ -51,12 +51,12 @@ IMPLEMENT_DYNAMIC_CLASS(ImageFileDocument, wxDocument) bool ImageFileDocument::OnSaveDocument(const wxString& filename) { - if (! m_pImageFile->fileWrite (filename)) { - *theApp->getLog() << "Unable to write image file " << filename << "\n"; + if (! m_pImageFile->fileWrite (filename.mb_str(wxConvUTF8))) { + *theApp->getLog() << _T("Unable to write image file ") << filename << _T("\n"); return false; } if (theApp->getVerboseLogging()) - *theApp->getLog() << "Wrote image file " << filename << "\n"; + *theApp->getLog() << _T("Wrote image file ") << filename << _T("\n"); Modify(false); return true; } @@ -66,14 +66,14 @@ bool ImageFileDocument::OnOpenDocument(const wxString& filename) if (! OnSaveModified()) return false; - if (! m_pImageFile->fileRead (filename.c_str())) { - *theApp->getLog() << "Unable to read image file " << filename << "\n"; + if (! m_pImageFile->fileRead (filename.mb_str(wxConvUTF8))) { + *theApp->getLog() << _T("Unable to read image file ") << filename << _T("\n"); m_bBadFileOpen = true; return false; } - if (theApp->getVerboseLogging() && filename != "") - *theApp->getLog() << "Read image file " << filename << "\n"; + if (theApp->getVerboseLogging() && filename != _T("")) + *theApp->getLog() << _T("Read image file ") << filename << _T("\n"); SetFilename(filename, true); Modify(false); @@ -106,13 +106,13 @@ bool ImageFileDocument::Revert () { if (IsModified()) { - wxString msg ("Revert to saved "); + wxString msg (_T("Revert to saved ")); msg += GetFilename(); - msg += "?"; - wxMessageDialog dialog (getView()->getFrame(), msg, "Are you sure?", wxYES_NO | wxNO_DEFAULT); + msg += _T("?"); + wxMessageDialog dialog (getView()->getFrame(), msg, _T("Are you sure?"), wxYES_NO | wxNO_DEFAULT); if (dialog.ShowModal() == wxID_YES) { if (theApp->getVerboseLogging()) - *theApp->getLog() << "Reverting to saved " << GetFilename() << "\n"; + *theApp->getLog() << _T("Reverting to saved ") << GetFilename() << _T("\n"); Modify (false); OnOpenDocument (GetFilename()); } @@ -177,7 +177,7 @@ BackgroundProcessingDocument::cancelRunningTasks() while (m_vecpBackgroundSupervisors.size() > 0) { ::wxYield(); - ::wxUsleep(50); + ::wxMilliSleep(50); } #endif } @@ -190,12 +190,12 @@ IMPLEMENT_DYNAMIC_CLASS(ProjectionFileDocument, BackgroundProcessingDocument) bool ProjectionFileDocument::OnSaveDocument(const wxString& filename) { - if (! m_pProjectionFile->write (filename.c_str())) { - *theApp->getLog() << "Unable to write projection file " << filename << "\n"; + if (! m_pProjectionFile->write (filename.mb_str(wxConvUTF8))) { + *theApp->getLog() << _T("Unable to write projection file ") << filename << _T("\n"); return false; } if (theApp->getVerboseLogging()) - *theApp->getLog() << "Wrote projection file " << filename << "\n"; + *theApp->getLog() << _T("Wrote projection file ") << filename << _T("\n"); Modify(false); return true; } @@ -213,15 +213,15 @@ ProjectionFileDocument::OnOpenDocument(const wxString& filename) if (! OnSaveModified()) return false; - if (! m_pProjectionFile->read (filename.c_str())) { - *theApp->getLog() << "Unable to read projection file " << filename << "\n"; + if (! m_pProjectionFile->read (filename.mb_str(wxConvUTF8))) { + *theApp->getLog() << _T("Unable to read projection file ") << filename << _T("\n"); m_bBadFileOpen = true; return false; } m_bBadFileOpen = false; - if (theApp->getVerboseLogging() && filename != "") - *theApp->getLog() << "Read projection file " << filename << "\n"; + if (theApp->getVerboseLogging() && filename != _T("")) + *theApp->getLog() << _T("Read projection file ") << filename << _T("\n"); SetFilename(filename, true); Modify(false); @@ -276,17 +276,17 @@ PhantomFileDocument::OnOpenDocument(const wxString& constFilename) wxString filename (constFilename); if (wxFile::Exists (filename)) { - m_phantom.createFromFile (filename); + m_phantom.createFromFile (filename.mb_str(wxConvUTF8)); if (theApp->getVerboseLogging()) - *theApp->getLog() << "Read phantom file " << filename << "\n"; + *theApp->getLog() << _T("Read phantom file ") << filename << _T("\n"); } else { - filename.Replace (".phm", ""); - m_phantom.createFromPhantom (filename); + filename.Replace (_T(".phm"), _T("")); + m_phantom.createFromPhantom (filename.mb_str(wxConvUTF8)); } m_namePhantom = filename; SetFilename (filename, true); if (m_phantom.fail()) { - *theApp->getLog() << "Failure creating phantom " << filename << "\n"; + *theApp->getLog() << _T("Failure creating phantom ") << filename << _T("\n"); m_bBadFileOpen = true; return false; } @@ -301,12 +301,12 @@ PhantomFileDocument::OnOpenDocument(const wxString& constFilename) bool PhantomFileDocument::OnSaveDocument(const wxString& filename) { - if (! m_phantom.fileWrite (filename.c_str())) { - *theApp->getLog() << "Unable to write phantom file " << filename << "\n"; + if (! m_phantom.fileWrite (filename.mb_str(wxConvUTF8))) { + *theApp->getLog() << _T("Unable to write phantom file ") << filename << _T("\n"); return false; } if (theApp->getVerboseLogging()) - *theApp->getLog() << "Wrote phantom file " << filename << "\n"; + *theApp->getLog() << _T("Wrote phantom file ") << filename << _T("\n"); Modify(false); return true; } @@ -346,12 +346,12 @@ bool PlotFileDocument::OnSaveDocument(const wxString& filename) { m_namePlot = filename.c_str(); - if (! m_plot.fileWrite (filename)) { - *theApp->getLog() << "Unable to write plot file " << filename << "\n"; + if (! m_plot.fileWrite (filename.mb_str(wxConvUTF8))) { + *theApp->getLog() << _T("Unable to write plot file ") << filename << _T("\n"); return false; } if (theApp->getVerboseLogging()) - *theApp->getLog() << "Wrote plot file " << filename << "\n"; + *theApp->getLog() << _T("Wrote plot file ") << filename << _T("\n"); Modify(false); return true; } @@ -362,15 +362,15 @@ PlotFileDocument::OnOpenDocument(const wxString& filename) if (! OnSaveModified()) return false; - if (! m_plot.fileRead (filename.c_str())) { - *theApp->getLog() << "Unable to read plot file " << filename << "\n"; + if (! m_plot.fileRead (filename.mb_str(wxConvUTF8))) { + *theApp->getLog() << _T("Unable to read plot file ") << filename << _T("\n"); m_bBadFileOpen = true; return false; } m_bBadFileOpen = false; - if (theApp->getVerboseLogging() && filename != "") - *theApp->getLog() << "Read plot file " << filename << "\n"; + if (theApp->getVerboseLogging() && filename != _T("")) + *theApp->getLog() << _T("Read plot file ") << filename << _T("\n"); SetFilename (filename, true); m_namePlot = filename.c_str();