r470: Fixed shutdown error, take 3
[ctsim.git] / src / docs.h
index 6db956883128ae8b115b89de9a7c9d9408e2d2ff..9d09e879ea61c163edb039e2db4f09977c2fa3ff 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: docs.h,v 1.15 2001/01/28 19:10:18 kevin Exp $
+**  $Id: docs.h,v 1.16 2001/01/30 02:20:50 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
@@ -51,6 +51,7 @@ class ImageFileDocument: public wxDocument
 private:
     DECLARE_DYNAMIC_CLASS(ImageFileDocument)
     ImageFile m_imageFile;
+    bool m_bBadFileOpen;
 
 public:
     virtual bool OnSaveDocument (const wxString& filename);
@@ -58,13 +59,17 @@ public:
     virtual bool IsModified () const;
     virtual void Modify (bool mod);
     
-    ImageFileDocument () {}
+    ImageFileDocument () 
+      : m_bBadFileOpen(false)
+    {}
+
     virtual ~ImageFileDocument () {}
 
     const ImageFile& getImageFile() const { return m_imageFile; }
 
     ImageFile& getImageFile() { return m_imageFile; }
     ImageFileView* getView() const;
+    bool getBadFileOpen() const { return m_bBadFileOpen; }
 };
 
 
@@ -73,6 +78,7 @@ class ProjectionFileDocument: public wxDocument
 private:
     DECLARE_DYNAMIC_CLASS(ProjectionFileDocument)
     Projections m_projectionFile;
+    bool m_bBadFileOpen;
 
 public:
     virtual bool OnSaveDocument (const wxString& filename);
@@ -80,13 +86,17 @@ public:
     virtual bool IsModified () const;
     virtual void Modify (bool mod);
     
-    ProjectionFileDocument () {}
+    ProjectionFileDocument () 
+          : m_bBadFileOpen(false)
+    {}
+
     virtual ~ProjectionFileDocument () {}
 
     const Projections& getProjections () const { return m_projectionFile; }
     Projections& getProjections ()     { return m_projectionFile; }
 
     ProjectionFileView* getView() const;
+    bool getBadFileOpen() const { return m_bBadFileOpen; }
 };
 
 
@@ -97,10 +107,11 @@ private:
     Phantom m_phantom;
     int m_idPhantom;
     wxString m_namePhantom;
+    bool m_bBadFileOpen;
 
 public:
     PhantomFileDocument () 
-       : m_idPhantom(Phantom::PHM_INVALID)
+       : m_idPhantom(Phantom::PHM_INVALID), m_bBadFileOpen(false)
     {}
 
     virtual ~PhantomFileDocument () 
@@ -119,6 +130,7 @@ public:
     virtual bool IsModified () const;
     virtual void Modify (bool mod);
     PhantomFileView* getView() const;
+    bool getBadFileOpen() const { return m_bBadFileOpen; }
 };
 
 
@@ -128,10 +140,12 @@ private:
     DECLARE_DYNAMIC_CLASS(PlotFileDocument)
     PlotFile m_plot;
     wxString m_namePlot;
+    bool m_bBadFileOpen;
 
 public:
     PlotFileDocument () 
-       {}
+      : m_bBadFileOpen(false)
+    {}
 
     virtual ~PlotFileDocument () 
        {}
@@ -150,27 +164,31 @@ public:
     virtual bool IsModified () const;
     virtual void Modify (bool mod);
     PlotFileView* getView() const;
+    bool getBadFileOpen() const { return m_bBadFileOpen; }
 };
 
-#include "views.h"
 
 class TextFileDocument: public wxDocument
 {
  private:
   DECLARE_DYNAMIC_CLASS(TextFileDocument)
+  bool m_bBadFileOpen;
 
  public:
-  TextFileDocument(void) {}
+  TextFileDocument(void) 
+        : m_bBadFileOpen(false)
+  {}
+
   virtual ~TextFileDocument(void) {}
 
   virtual bool OnSaveDocument(const wxString& filename);
   virtual bool OnOpenDocument(const wxString& filename);
   virtual bool IsModified(void) const;
 
-  wxTextCtrl* getTextCtrl()
-  { return dynamic_cast<TextFileView*>(GetFirstView())->getTextCtrl(); }
+  wxTextCtrl* getTextCtrl();
 
   TextFileView* getView() const;
+  bool getBadFileOpen() const { return m_bBadFileOpen; }
 };