** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: docs.cpp,v 1.7 2000/12/19 21:37:51 kevin Exp $
+** $Id: docs.cpp,v 1.9 2000/12/29 15:45:06 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
}
Modify(false);
UpdateAllViews();\r
- ImageFileView* ifView = dynamic_cast<ImageFileView*>(GetFirstView());\r
- if (ifView)\r
- ifView->OnUpdate(ifView, NULL);\r
+ GetFirstView()->OnUpdate (GetFirstView(), NULL);\r
return true;
}
SetFilename(filename, true);
}
Modify(false);
- UpdateAllViews();
+ UpdateAllViews();\r
+
return true;
}
}
m_idPhantom = m_phantom.id();
Modify(false);
- UpdateAllViews();
+ UpdateAllViews();\r
+
return true;
}
IMPLEMENT_DYNAMIC_CLASS(PlotFileDocument, wxDocument)
+bool PlotFileDocument::OnSaveDocument(const wxString& filename)\r
+{\r
+ m_namePlot = filename.c_str();\r
+ if (! m_plot.fileWrite (filename)) {\r
+ *theApp->getLog() << "Unable to write plot file " << filename << "\n";\r
+ return false;\r
+ }\r
+ *theApp->getLog() << "Wrote plot file " << filename << "\n";\r
+ Modify(false);\r
+ return true;\r
+}\r
+\r
bool PlotFileDocument::OnOpenDocument(const wxString& filename)
{
if (filename == "untitled.plt") {
return false;
}
*theApp->getLog() << "Read plot file " << filename << "\n";
- SetFilename(filename, true);
+ SetFilename (filename, true);\r
+ m_namePlot = filename.c_str();
}
- Modify(false);
+ Modify (false);
UpdateAllViews();\r
- PlotFileView* ifView = dynamic_cast<PlotFileView*>(GetFirstView());\r
- if (ifView)\r
- ifView->OnUpdate(ifView, NULL);\r
return true;
}