r3877: Auto commit for Debian build
[ctsim.git] / src / views.cpp
index 72b79738d44dc361ee7ee25d92a70651793b6b08..88e5f042fc7dc22b2a030fec80d9713b98c7b42f 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: views.cpp,v 1.164 2003/01/24 05:24:19 kevin Exp $
+**  $Id: views.cpp,v 1.167 2003/01/29 07:18:38 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
@@ -329,6 +329,7 @@ ImageFileView::OnScaleAuto (wxCommandEvent& event)
       m_dMinPixel = dMin;
       m_dMaxPixel = dMax;
       m_dAutoScaleFactor = dialogAutoScale.getAutoScaleFactor();
+      OnUpdate(this, NULL);
       GetDocument()->UpdateAllViews (this);
     }
   }
@@ -1060,8 +1061,10 @@ ImageFileView::setInitialClientSize ()
 void 
 ImageFileView::OnDraw (wxDC* dc)
 {
-  if (m_pBitmap && m_pBitmap->Ok())
+  if (m_pBitmap && m_pBitmap->Ok()) {
+    *theApp->getLog() << "Drawing bitmap";
     dc->DrawBitmap(*m_pBitmap, 0, 0, false);
+  }
   
   int xCursor, yCursor;
   if (m_pCanvas->GetCurrentCursor (xCursor, yCursor))
@@ -1111,8 +1114,11 @@ ImageFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) )
       }
     }
     wxImage image (nx, ny, imageData, true);
-    if (m_pBitmap)
+    if (m_pBitmap) {
       delete m_pBitmap;
+      m_pBitmap = NULL;
+    }
+    *theApp->getLog() << "Making new bitmap bitmap";
     m_pBitmap = new wxBitmap (image);
     delete imageData;
     m_pCanvas->SetScrollbars(20, 20, nx/20, ny/20);
@@ -3153,8 +3159,10 @@ ProjectionFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint)
       }
     }
     wxImage image (nDet, nView, imageData, true);
-    if (m_pBitmap)
+    if (m_pBitmap) {
       delete m_pBitmap;
+      m_pBitmap = NULL;
+    }
     m_pBitmap = new wxBitmap (image);
     delete imageData;
   }