1 /*****************************************************************************
5 ** Purpose: Document routines for CTSim program
6 ** Programmer: Kevin Rosenberg
7 ** Date Started: July 2000
9 ** This is part of the CTSim program
10 ** Copyright (C) 1983-2000 Kevin Rosenberg
12 ** $Id: docs.cpp,v 1.1 2000/07/13 07:01:59 kevin Exp $
14 ** This program is free software; you can redistribute it and/or modify
15 ** it under the terms of the GNU General Public License (version 2) as
16 ** published by the Free Software Foundation.
18 ** This program is distributed in the hope that it will be useful,
19 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ** GNU General Public License for more details.
23 ** You should have received a copy of the GNU General Public License
24 ** along with this program; if not, write to the Free Software
25 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 ******************************************************************************/
29 // #pragma implementation
32 // For compilers that support precompilation, includes "wx/wx.h".
33 #include "wx/wxprec.h"
42 #include "wx/txtstrm.h"
44 #if !wxUSE_DOC_VIEW_ARCHITECTURE
45 #error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h!
55 IMPLEMENT_DYNAMIC_CLASS(ImageFileDocument, wxDocument)
57 bool ImageFileDocument::OnSaveDocument(const wxString& filename)
59 if (!m_imageFile.fileWrite (filename))
65 bool ImageFileDocument::OnOpenDocument(const wxString& filename)
67 if (! m_imageFile.fileRead (filename))
70 SetFilename(filename, true);
76 bool ImageFileDocument::IsModified(void) const
78 return wxDocument::IsModified();
81 void ImageFileDocument::Modify(bool mod)
83 wxDocument::Modify(mod);
86 // ProjectionFileDocument
88 IMPLEMENT_DYNAMIC_CLASS(ProjectionFileDocument, wxDocument)
90 bool ProjectionFileDocument::OnSaveDocument(const wxString& filename)
92 if (!m_projectionFile.write (filename))
98 bool ProjectionFileDocument::OnOpenDocument(const wxString& filename)
100 if (! m_projectionFile.read (filename))
103 SetFilename(filename, true);
109 bool ProjectionFileDocument::IsModified(void) const
111 return wxDocument::IsModified();
114 void ProjectionFileDocument::Modify(bool mod)
116 wxDocument::Modify(mod);