X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fdocs.cpp;h=bab1d1348183eb7ce4e494c19740ae5fbbce665d;hp=c3fd4892fd8747a0eb08adda81880eb0936f2703;hb=5c6b29ab4885308cc3381af6e0a68f4804956d2e;hpb=89997e727ff5d4d8828f6fdaee435d809b623ffe diff --git a/src/docs.cpp b/src/docs.cpp index c3fd489..bab1d13 100644 --- a/src/docs.cpp +++ b/src/docs.cpp @@ -9,7 +9,7 @@ ** 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 @@ -81,9 +81,7 @@ bool ImageFileDocument::OnOpenDocument(const wxString& filename) } Modify(false); UpdateAllViews(); - ImageFileView* ifView = dynamic_cast(GetFirstView()); - if (ifView) - ifView->OnUpdate(ifView, NULL); + GetFirstView()->OnUpdate (GetFirstView(), NULL); return true; } @@ -133,7 +131,8 @@ bool ProjectionFileDocument::OnOpenDocument(const wxString& filename) SetFilename(filename, true); } Modify(false); - UpdateAllViews(); + UpdateAllViews(); + return true; } @@ -176,7 +175,8 @@ bool PhantomDocument::OnOpenDocument(const wxString& filename) } m_idPhantom = m_phantom.id(); Modify(false); - UpdateAllViews(); + UpdateAllViews(); + return true; } @@ -201,6 +201,18 @@ void PhantomDocument::Modify(bool mod) IMPLEMENT_DYNAMIC_CLASS(PlotFileDocument, wxDocument) +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"; + return false; + } + *theApp->getLog() << "Wrote plot file " << filename << "\n"; + Modify(false); + return true; +} + bool PlotFileDocument::OnOpenDocument(const wxString& filename) { if (filename == "untitled.plt") { @@ -212,13 +224,11 @@ bool PlotFileDocument::OnOpenDocument(const wxString& filename) return false; } *theApp->getLog() << "Read plot file " << filename << "\n"; - SetFilename(filename, true); + SetFilename (filename, true); + m_namePlot = filename.c_str(); } - Modify(false); + Modify (false); UpdateAllViews(); - PlotFileView* ifView = dynamic_cast(GetFirstView()); - if (ifView) - ifView->OnUpdate(ifView, NULL); return true; }