** 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.81 2001/01/27 22:31:57 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
ImageFileCanvas::~ImageFileCanvas()
{
- m_pView = NULL;
+ m_pView = NULL;
}
void
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;
}
differenceImage.setArraySize (rIF.nx(), rIF.ny());
if (! rIF.subtractImages (rCompareIF, differenceImage)) {
- pDifferenceDoc->DeleteAllViews();
+ pDifferenceDoc->getView()->getFrame()->Close(true);
return;
}
if (m_pCanvas) {
m_pCanvas->Clear();
- m_pCanvas->Show(false);
+ m_pCanvas->Show(false);
m_pCanvas->setView(NULL);
m_pCanvas = NULL;
}
Activate(false);
if (deleteWindow) {
- m_pFrame->Show(false);
- m_pFrame->Destroy();
-// delete m_pFrame;
+ //m_pFrame->Show(false);
+ m_pFrame->Destroy();
+ // delete m_pFrame;
m_pFrame = NULL;
}
return true;
PhantomCanvas::~PhantomCanvas ()
{
- m_pView = NULL;
+ m_pView = NULL;
}
void
END_EVENT_TABLE()
PhantomFileView::PhantomFileView()
-: wxView(), m_pCanvas(NULL), m_pFrame(NULL), m_pFileMenu(0)
+: wxView(), m_pFrame(NULL), m_pCanvas(NULL), m_pFileMenu(0)
{
m_iDefaultNDet = 367;
m_iDefaultNView = 320;
PhantomFileView::~PhantomFileView()
{
- theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
+ theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
}
void
if (m_iDefaultTrace > Trace::TRACE_CONSOLE) {
ProjectionsDialog dialogProjections (theScanner, rProj, rPhantom, m_iDefaultTrace, dynamic_cast<wxWindow*>(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);
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;
}
}
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;
}
}
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());
Activate(false);
if (deleteWindow) {
- m_pFrame->Show(false);
- m_pFrame->Destroy();
-// delete m_pFrame;
+ // m_pFrame->Show(false);
+ m_pFrame->Destroy();
+ // delete m_pFrame;
m_pFrame = NULL;
}
ProjectionFileCanvas::~ProjectionFileCanvas ()
{
- m_pView = NULL;
+ m_pView = NULL;
}
void
ProjectionFileView::~ProjectionFileView()
{
- theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
+ theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
}
void
pPolarDoc->UpdateAllViews();
pPolarDoc->getView()->OnUpdate (this, NULL);
pPolarDoc->getView()->getFrame()->Show(true);
-}
+ }
}
void
if (pDlgReconstruct->isCancelled() || ! pDlgReconstruct->reconstructView (iView)) {
delete pDlgReconstruct;
delete pReconstruct;
- pReconDoc->DeleteAllViews();
+ pReconDoc->getView()->getFrame()->Close(true);
return;
}
::wxYield();
pReconstruct->reconstructView (i, 1);
if (! dlgProgress.Update(i + 1)) {
delete pReconstruct;
- pReconDoc->DeleteAllViews();
+ pReconDoc->getView()->getFrame()->Close(true);
return;
}
}
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());
if (m_pFrame)
m_pFrame->SetTitle(s);
-// SetFrame(NULL);
+ // SetFrame(NULL);
Activate(false);
if (deleteWindow) {
- m_pFrame->Show(false);
- m_pFrame->Destroy();
-// delete m_pFrame;
+ //m_pFrame->Show(false);
+ m_pFrame->Destroy();
+ // delete m_pFrame;
m_pFrame = NULL;
}
return true;
PlotFileCanvas::~PlotFileCanvas ()
{
- m_pView = NULL;
+ m_pView = NULL;
}
void
{
if (m_pEZPlot)
delete m_pEZPlot;
-
+
theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
}
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());
Activate(false);
if (deleteWindow) {
- m_pFrame->Show(false);
- m_pFrame->Destroy();
-// delete m_pFrame;
+ //m_pFrame->Show(false);
+ m_pFrame->Destroy();
+ // delete m_pFrame;
m_pFrame = NULL;
}
return true;
TextFileView::~TextFileView()
{
- theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
+ theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
}
bool TextFileView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
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);
if (deleteWindow) {
- m_pFrame->Show(false);
- m_pFrame->Destroy();
-// delete m_pFrame;
- m_pFrame = NULL;
-
+ //m_pFrame->Show(false);
+ m_pFrame->Destroy();
+ // delete m_pFrame;
+ m_pFrame = NULL;
+
}
return TRUE;
}
// Define a constructor for my text subwindow
TextFileCanvas::TextFileCanvas (TextFileView* v, wxFrame* frame, const wxPoint& pos, const wxSize& size, long style)
- : wxTextCtrl (frame, -1, "", pos, size, style), m_pView(v)
+: wxTextCtrl (frame, -1, "", pos, size, style), m_pView(v)
{
}
TextFileCanvas::~TextFileCanvas ()
{
- m_pView = NULL;
+ m_pView = NULL;
}