X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fviews.cpp;h=be956dbfc79e536805bcd0725b9004a8f730e7b7;hb=8318d419cd75251f57f51f9988c2385aca82ee31;hp=e2c0c47e4a08c6fb72765ef1d720f0c78451742a;hpb=0c4d286b980e2d617b926f9dbea7572eaf1897cd;p=ctsim.git diff --git a/src/views.cpp b/src/views.cpp index e2c0c47..be956db 100644 --- a/src/views.cpp +++ b/src/views.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: views.cpp,v 1.76 2001/01/27 01:51:47 kevin Exp $ +** $Id: views.cpp,v 1.79 2001/01/27 03:39:53 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 @@ -224,7 +224,7 @@ EVT_MENU(IFMENU_PLOT_HISTOGRAM, ImageFileView::OnPlotHistogram) END_EVENT_TABLE() ImageFileView::ImageFileView() -: wxView(), m_pCanvas(NULL), m_pFrame(NULL), m_bMinSpecified(false), m_bMaxSpecified(false), m_pFileMenu(0) +: wxView(), m_pFrame(NULL), m_pCanvas(NULL), m_pFileMenu(0), m_bMinSpecified(false), m_bMaxSpecified(false) { m_iDefaultExportFormatID = ImageFile::FORMAT_PNG; } @@ -358,7 +358,7 @@ ImageFileView::OnCompare (wxCommandEvent& event) differenceImage.setArraySize (rIF.nx(), rIF.ny()); if (! rIF.subtractImages (rCompareIF, differenceImage)) { - pDifferenceDoc->DeleteAllViews(); + pDifferenceDoc->getView()->getFrame()->Close(true); return; } @@ -1808,14 +1808,12 @@ PhantomFileView::OnProjections (wxCommandEvent& event) if (m_iDefaultTrace > Trace::TRACE_CONSOLE) { ProjectionsDialog dialogProjections (theScanner, rProj, rPhantom, m_iDefaultTrace, dynamic_cast(getFrameForChild())); for (int iView = 0; iView < rProj.nView(); iView++) { - ::wxYield(); ::wxYield(); if (dialogProjections.isCancelled() || ! dialogProjections.projectView (iView)) { - pProjectionDoc->DeleteAllViews(); + pProjectionDoc->getView()->getFrame()->Close(true); return; } ::wxYield(); - ::wxYield(); while (dialogProjections.isPaused()) { ::wxYield(); ::wxUsleep(50); @@ -1826,7 +1824,7 @@ PhantomFileView::OnProjections (wxCommandEvent& event) for (int i = 0; i < rProj.nView(); i++) { theScanner.collectProjections (rProj, rPhantom, i, 1, true, m_iDefaultTrace); if (! dlgProgress.Update (i+1)) { - pProjectionDoc->DeleteAllViews(); + pProjectionDoc->getView()->getFrame()->Close(true); return; } } @@ -1888,7 +1886,8 @@ PhantomFileView::OnRasterize (wxCommandEvent& event) for (unsigned int i = 0; i < imageFile.nx(); i++) { rPhantom.convertToImagefile (imageFile, m_iDefaultRasterNSamples, Trace::TRACE_NONE, i, 1, true); if (! dlgProgress.Update(i+1)) { - pRasterDoc->DeleteAllViews(); + pRasterDoc->Close(); + pRasterDoc->getView()->getFrame()->Close(true); return; } } @@ -2036,7 +2035,7 @@ PhantomFileView::OnClose (bool deleteWindow) if (m_pCanvas) { m_pCanvas->Clear(); m_pCanvas->setView(NULL); - m_pCanvas->Show(false); + m_pCanvas->Show(false); m_pCanvas = NULL; } wxString s(wxTheApp->GetAppName()); @@ -2274,7 +2273,7 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event) if (pDlgReconstruct->isCancelled() || ! pDlgReconstruct->reconstructView (iView)) { delete pDlgReconstruct; delete pReconstruct; - pReconDoc->DeleteAllViews(); + pReconDoc->getView()->getFrame()->Close(true); return; } ::wxYield(); @@ -2291,7 +2290,7 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event) pReconstruct->reconstructView (i, 1); if (! dlgProgress.Update(i + 1)) { delete pReconstruct; - pReconDoc->DeleteAllViews(); + pReconDoc->getView()->getFrame()->Close(true); return; } }