** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: docs.cpp,v 1.41 2002/06/04 19:19:40 kevin Exp $
+** $Id: docs.cpp,v 1.42 2002/06/04 19:24:03 kevin Exp $
**
** 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
wxString filename (constFilename);
- if (filename == szNEW_IMAGE_FILENAME) {
+ if (filename == szNEW_IMAGE_FILENAME)
filename = "";
- } else if (! m_pImageFile->fileRead (filename.c_str())) {
+ else if (! m_pImageFile->fileRead (filename.c_str())) {
*theApp->getLog() << "Unable to read image file " << filename << "\n";
m_bBadFileOpen = true;
return false;
}
bool
-ProjectionFileDocument::OnOpenDocument(const wxString& filename)
+ProjectionFileDocument::OnOpenDocument(const wxString& constFilename)
{
if (! OnSaveModified())
return false;
- if (! m_pProjectionFile->read (filename.c_str())) {
+ wxString filename (constFilename);
+
+ if (filename == szNEW_PROJECTION_FILENAME)
+ filename = "";
+ else if (! m_pProjectionFile->read (filename.c_str())) {
*theApp->getLog() << "Unable to read projection file " << filename << "\n";
m_bBadFileOpen = true;
return false;
}
- if (theApp->getVerboseLogging())
+
+ if (theApp->getVerboseLogging() && filename != "")
*theApp->getLog() << "Read projection file " << filename << "\n";
+
SetFilename(filename, true);
Modify(false);
getView()->setInitialClientSize();
}
bool
-PlotFileDocument::OnOpenDocument(const wxString& filename)
+PlotFileDocument::OnOpenDocument(const wxString& constFilename)
{
if (! OnSaveModified())
return false;
- if (! m_plot.fileRead (filename.c_str())) {
+ wxString filename (constFilename);
+
+ if (filename == szNEW_PLOT_FILENAME)
+ filename = "";
+ else if (! m_plot.fileRead (filename.c_str())) {
*theApp->getLog() << "Unable to read plot file " << filename << "\n";
m_bBadFileOpen = true;
return false;
}
- if (theApp->getVerboseLogging())
+
+ if (theApp->getVerboseLogging() && filename != "")
*theApp->getLog() << "Read plot file " << filename << "\n";
+
SetFilename (filename, true);
m_namePlot = filename.c_str();
Modify (false);
UpdateAllViews();
- //GetFirstView()->OnUpdate (NULL, NULL);
m_bBadFileOpen = false;
return true;
SetFilename (filename, true);
Modify (false);
- // UpdateAllViews();
+ UpdateAllViews();
m_bBadFileOpen = false;
return true;
}
{
SetFilename (filename, true);
Modify (false);
- // UpdateAllViews();
+ UpdateAllViews();
m_bBadFileOpen = false;
return true;
}