r577: no message
[ctsim.git] / src / docs.cpp
index b356033164193c8a900a84b1d0ed1678895d974e..bb8ec90d973e122046ac32d95cda6c34d7f52bb4 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: docs.cpp,v 1.26 2001/02/23 18:56:56 kevin Exp $
+**  $Id: docs.cpp,v 1.27 2001/02/23 21:58:31 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
@@ -151,39 +151,38 @@ ProjectionFileDocument::~ProjectionFileDocument()
 {
   for (BackgroundContainer::iterator i = m_vecpBackgroundSupervisors.begin(); 
         i != m_vecpBackgroundSupervisors.end(); i++) {
-          (*i)->cancel();
+          BackgroundSupervisor::cancelSupervisor(*i);
     }
   
-  m_vecpBackgroundSupervisors.clear();
+  while (m_vecpBackgroundSupervisors.size() > 0)
+    ::wxYield();
+
   delete m_pProjectionFile;
 }
 
 void
 ProjectionFileDocument::OnAddBackground (wxCommandEvent& event)
 {
-}
+  BackgroundSupervisor* pSupervisor = reinterpret_cast<BackgroundSupervisor*>(event.GetClientData());
+  wxASSERT (pSupervisor != NULL);
 
-void
-ProjectionFileDocument::OnRemoveBackground (wxCommandEvent& event)
-{
-}
-
-void
-ProjectionFileDocument::addReconstructor (BackgroundSupervisor* pRecon)
-{
   wxCriticalSectionLocker locker (m_criticalSection);
-  m_vecpBackgroundSupervisors.push_back (pRecon);
+  if (pSupervisor)
+    m_vecpBackgroundSupervisors.push_back (pSupervisor);
 }
 
 void
-ProjectionFileDocument::removeReconstructor (BackgroundSupervisor* pRecon)
+ProjectionFileDocument::OnRemoveBackground (wxCommandEvent& event)
 {
+  BackgroundSupervisor* pSupervisor = reinterpret_cast<BackgroundSupervisor*>(event.GetClientData());
+  wxASSERT (pSupervisor != NULL);
+
   wxCriticalSectionLocker locker (m_criticalSection);
   bool bFound = false;
   for (BackgroundContainer::iterator i = m_vecpBackgroundSupervisors.begin(); 
         i != m_vecpBackgroundSupervisors.end(); 
         i++) 
-          if (*i == pRecon) {
+          if (*i == pSupervisor) {
             m_vecpBackgroundSupervisors.erase(i);
             bFound = true;
             break;