** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: views.cpp,v 1.85 2001/01/28 20:05:17 kevin Exp $
+** $Id: views.cpp,v 1.86 2001/01/28 21:57:09 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
ImageFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) )
{
m_pFrame = CreateChildFrame(doc, this);
- (m_pFrame);
+ (m_pFrame);
m_bMinSpecified = false;
m_bMaxSpecified = false;
return false;
if (m_pCanvas) {
- m_pCanvas->Show(false);
+ m_pCanvas->Show(false);
m_pCanvas->setView(NULL);
m_pCanvas = NULL;
}
SetFrame(NULL);
Activate(false);
-
+
if (deleteWindow) {
m_pFrame->Show(false);
- ::wxYield();
m_pFrame->Destroy();
m_pFrame = NULL;
}
for (int iView = 0; iView < rProj.nView(); iView++) {
::wxYield();
if (dialogProjections.isCancelled() || ! dialogProjections.projectView (iView)) {
- pProjectionDoc->getView()->getFrame()->Close(true);
+ pProjectionDoc->getView()->getFrame()->Show(true);
+ GetDocumentManager()->ActivateView (pProjectionDoc->getView(), true, false);
+ pProjectionDoc->getView()->getFrame()->SetFocus();
+ wxCommandEvent event;
+ GetDocumentManager()->OnFileClose (event);
+ GetDocumentManager()->ActivateView (this, true, false);
+ getFrame()->SetFocus();
return;
}
::wxYield();
for (int i = 0; i < rProj.nView(); i++) {
theScanner.collectProjections (rProj, rPhantom, i, 1, true, m_iDefaultTrace);
if (! dlgProgress.Update (i+1)) {
- pProjectionDoc->getView()->OnClose(true);
- delete pProjectionDoc;
+ pProjectionDoc->getView()->getFrame()->Show(true);
+ GetDocumentManager()->ActivateView (pProjectionDoc->getView(), true, false);
+ pProjectionDoc->getView()->getFrame()->SetFocus();
+ wxCommandEvent event;
+ GetDocumentManager()->OnFileClose (event);
+ GetDocumentManager()->ActivateView (this, true, false);
+ getFrame()->SetFocus();
return;
}
}
ProjectionFileView* projView = pProjectionDoc->getView();
if (projView) {
projView->OnUpdate (projView, NULL);
- if (projView->getCanvas())
+ if (projView->getCanvas())
projView->getCanvas()->SetClientSize (m_iDefaultNDet, m_iDefaultNView);
if (wxFrame* pFrame = projView->getFrame()) {
pFrame->Show(true);
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->Close();
- pRasterDoc->getView()->OnClose(true);
- delete pRasterDoc;
+ GetDocumentManager()->ActivateView (pRasterDoc->getView(), true, true);
+ pRasterDoc->getView()->getFrame()->SetFocus();
+ wxCommandEvent event;
+ GetDocumentManager()->OnFileClose (event);
+ GetDocumentManager()->ActivateView (this, true, false);
+ getFrame()->SetFocus();
return;
}
}
return false;
if (m_pCanvas) {
- m_pCanvas->Show(false);
+ m_pCanvas->Show(false);
m_pCanvas->setView(NULL);
m_pCanvas = NULL;
}
Activate(false);
if (deleteWindow) {
- m_pFrame->Show(false);
- ::wxYield();
- m_pFrame->Destroy();
+ m_pFrame->Show(false);
+ m_pFrame->Destroy();
m_pFrame = NULL;
}
m_iDefaultNX = 256;
m_iDefaultNY = 256;
#endif
-
+
m_iDefaultFilter = SignalFilter::FILTER_ABS_BANDLIMIT;
m_dDefaultFilterParam = 1.;
#if HAVE_FFTW
pReconstruct->reconstructView (i, 1);
if (! dlgProgress.Update (i + 1)) {
delete pReconstruct;
- pReconDoc->getView()->OnClose(true);
- delete pReconDoc;
+ GetDocumentManager()->ActivateView (pReconDoc->getView(), true, true);
+ pReconDoc->getView()->getFrame()->SetFocus();
+ wxCommandEvent event;
+ GetDocumentManager()->OnFileClose (event);
+ GetDocumentManager()->ActivateView (this, true, false);
+ getFrame()->SetFocus();
return;
}
}
return false;
if (m_pCanvas) {
- m_pCanvas->Show(false);
+ m_pCanvas->Show(false);
m_pCanvas->setView(NULL);
m_pCanvas = NULL;
}
if (deleteWindow) {
m_pFrame->Show(false);
- ::wxYield();
m_pFrame->Destroy();
m_pFrame = NULL;
}
return false;
if (m_pCanvas) {
- m_pCanvas->Show(false);
+ m_pCanvas->Show(false);
m_pCanvas->setView (NULL);
m_pCanvas = NULL;
}
Activate(false);
m_pFrame->SetView(NULL);
- SetFrame(NULL);
+ SetFrame(NULL);
if (deleteWindow) {
m_pFrame->Show(false);
- ::wxYield();
- m_pFrame->Destroy();
+ m_pFrame->Destroy();
m_pFrame = NULL;
}
return true;
bool
TextFileView::OnClose (bool deleteWindow)
{
- // if (m_pFrame && m_pFrame->GetTitle() == "Log")
- return false;
+ // if (m_pFrame && m_pFrame->GetTitle() == "Log")
+ return false;
if (! GetDocument() || ! GetDocument()->Close())
return false;
m_pCanvas->Show(false);
Activate(false);
-
+
SetFrame(NULL);
m_pFrame->SetView(NULL);
if (deleteWindow) {
m_pFrame->Show(false);
- ::wxYield();
- m_pFrame->Destroy();
+ m_pFrame->Destroy();
m_pFrame = NULL;
}