r441: no message
[ctsim.git] / src / views.cpp
index 9d0314ac8b66e143b5fe169bd7f064a636aaedab..4e970c173bd2bb43a6739d96d5c419797c6ba51f 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: views.cpp,v 1.72 2001/01/26 09:54:31 kevin Exp $
+**  $Id: views.cpp,v 1.74 2001/01/26 21:33: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
@@ -231,14 +231,15 @@ EVT_MENU(IFMENU_PLOT_FFT_COL, ImageFileView::OnPlotFFTCol)
 EVT_MENU(IFMENU_PLOT_HISTOGRAM, ImageFileView::OnPlotHistogram)
 END_EVENT_TABLE()
 
-ImageFileView::ImageFileView(void
+ImageFileView::ImageFileView() 
 : wxView(), m_canvas(NULL), m_frame(NULL), m_bMinSpecified(false), m_bMaxSpecified(false), m_pFileMenu(0)
 {
   m_iDefaultExportFormatID = ImageFile::FORMAT_PNG;
 }
 
-ImageFileView::~ImageFileView(void)
+ImageFileView::~ImageFileView()
 {
+
 }
 
 void
@@ -993,7 +994,7 @@ ImageFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) )
 bool 
 ImageFileView::OnClose (bool deleteWindow)
 {
-  if (!GetDocument()->Close())
+  if (! GetDocument() || ! GetDocument()->Close())
     return false;
   
   if (m_canvas) {
@@ -1732,7 +1733,7 @@ EVT_MENU(PHMMENU_PROCESS_RASTERIZE, PhantomFileView::OnRasterize)
 EVT_MENU(PHMMENU_PROCESS_PROJECTIONS, PhantomFileView::OnProjections)
 END_EVENT_TABLE()
 
-PhantomFileView::PhantomFileView(void
+PhantomFileView::PhantomFileView() 
 : wxView(), m_canvas(NULL), m_frame(NULL), m_pFileMenu(0)
 {
   m_iDefaultNDet = 367;
@@ -1751,6 +1752,7 @@ PhantomFileView::PhantomFileView(void)
 
 PhantomFileView::~PhantomFileView()
 {
+       
 }
 
 void
@@ -2022,7 +2024,7 @@ PhantomFileView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) )
 bool 
 PhantomFileView::OnClose (bool deleteWindow)
 {
-  if (!GetDocument()->Close())
+  if (! GetDocument() || ! GetDocument()->Close())
     return false;
   
   if (m_canvas) {
@@ -2106,7 +2108,7 @@ EVT_MENU(PJMENU_CONVERT_POLAR, ProjectionFileView::OnConvertPolar)
 EVT_MENU(PJMENU_CONVERT_FFT_POLAR, ProjectionFileView::OnConvertFFTPolar)
 END_EVENT_TABLE()
 
-ProjectionFileView::ProjectionFileView(void
+ProjectionFileView::ProjectionFileView() 
 : wxView(), m_canvas(NULL), m_frame(NULL), m_pFileMenu(0)
 {
   m_iDefaultNX = 256;
@@ -2132,8 +2134,9 @@ ProjectionFileView::ProjectionFileView(void)
   m_iDefaultPolarZeropad = 1;
 }
 
-ProjectionFileView::~ProjectionFileView(void)
+ProjectionFileView::~ProjectionFileView()
 {
+       
 }
 
 void
@@ -2485,7 +2488,7 @@ ProjectionFileView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint)
 bool 
 ProjectionFileView::OnClose (bool deleteWindow)
 {
-  if (!GetDocument()->Close())
+  if (! GetDocument() || ! GetDocument()->Close())
     return false;
   
   if (m_canvas) {
@@ -2545,17 +2548,19 @@ EVT_MENU(PLOTMENU_VIEW_SCALE_AUTO, PlotFileView::OnScaleAuto)
 EVT_MENU(PLOTMENU_VIEW_SCALE_FULL, PlotFileView::OnScaleFull)
 END_EVENT_TABLE()
 
-PlotFileView::PlotFileView(void
+PlotFileView::PlotFileView() 
 : wxView(), m_canvas(NULL), m_frame(NULL), m_pEZPlot(NULL), m_pFileMenu(0)
 {
   m_bMinSpecified = false;
   m_bMaxSpecified = false;
 }
 
-PlotFileView::~PlotFileView(void)
+PlotFileView::~PlotFileView()
 {
   if (m_pEZPlot)
     delete m_pEZPlot;
+
+  
 }
 
 void
@@ -2813,7 +2818,7 @@ PlotFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) )
 bool 
 PlotFileView::OnClose (bool deleteWindow)
 {
-  if (!GetDocument()->Close())
+  if (! GetDocument() || ! GetDocument()->Close())
     return false;
   
   if (m_canvas) {
@@ -2843,6 +2848,7 @@ IMPLEMENT_DYNAMIC_CLASS(TextFileView, wxView)
 
 TextFileView::~TextFileView() 
 {
+       
 }
 
 bool TextFileView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
@@ -2881,9 +2887,10 @@ void TextFileView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) )
 bool 
 TextFileView::OnClose (bool deleteWindow)
 {
-  return false;
+       if (m_pFrame && m_pFrame->GetTitle() == "Log")
+       return false;
   
-  if (!GetDocument()->Close())
+  if (! GetDocument() || ! GetDocument()->Close())
     return false;
   
   Activate(false);
@@ -2891,7 +2898,8 @@ TextFileView::OnClose (bool deleteWindow)
   if (deleteWindow)
   {
     delete m_pFrame;
-    return TRUE;
+       m_pFrame = NULL;
+   
   }
   return TRUE;
 }