X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fdocs.cpp;h=69b59544fc448f6afafff26201f94d69f5248170;hp=ac7e3a69c08b3c156767ecf13c70f3127e16b205;hb=9b2bb510160bdb56f04847f5b55ab61dd8a47976;hpb=65732cc5d8dbf867ed56a021c07c5636cea93b5a diff --git a/src/docs.cpp b/src/docs.cpp index ac7e3a6..69b5954 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.8 2000/12/27 03:16:02 kevin Exp $ +** $Id: docs.cpp,v 1.10 2001/01/02 05:34:57 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,10 +175,22 @@ bool PhantomDocument::OnOpenDocument(const wxString& filename) } m_idPhantom = m_phantom.id(); Modify(false); - UpdateAllViews(); + UpdateAllViews(); + return true; } +bool PhantomDocument::OnSaveDocument(const wxString& filename) +{ + if (! m_phantom.fileWrite (filename.c_str())) { + *theApp->getLog() << "Unable to write phantom file " << filename << "\n"; + return false; + } + *theApp->getLog() << "Wrote phantom file " << filename << "\n"; + Modify(false); + return true; +} + bool PhantomDocument::OnCloseDocument () { bool bReturn = wxDocument::OnCloseDocument(); @@ -224,14 +235,12 @@ 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); + GetFirstView()->OnUpdate (NULL, NULL); return true; }