** Date Started: July 2000
**
** This is part of the CTSim program
-** Copyright (c) 1983-2001 Kevin Rosenberg
-**
-** $Id$
+** Copyright (c) 1983-2009 Kevin Rosenberg
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
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;
}
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);
getView()->setInitialClientSize();
+ this->SetFilename(filename, true);
UpdateAllViews();
m_bBadFileOpen = false;
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());
}
while (m_vecpBackgroundSupervisors.size() > 0) {
::wxYield();
- ::wxUsleep(50);
+ ::wxMilliSleep(50);
}
#endif
}
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;
}
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);
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;
}
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;
}
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;
}
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();