From 9538989b04262388ea2cb9315939fb801cc8eae2 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sun, 28 Jan 2001 03:48:55 +0000 Subject: [PATCH] r458: no message --- include/ct.h | 7 ++- msvc/ctsim/ctsim.plg | 10 ++-- src/ctsim.cpp | 5 +- src/views.cpp | 119 +++++++++++++++++++++++++++---------------- src/views.h | 12 ++--- 5 files changed, 95 insertions(+), 58 deletions(-) diff --git a/include/ct.h b/include/ct.h index a36412f..de8548e 100644 --- a/include/ct.h +++ b/include/ct.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ct.h,v 1.53 2001/01/13 03:51:35 kevin Exp $ +** $Id: ct.h,v 1.54 2001/01/28 03:48:55 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 @@ -38,6 +38,11 @@ #include #endif +#ifdef _DEBUG +#undef DEBUG +#define DEBUG 1 +#endif + #define HAVE_ANSI_CPP 1 #ifdef HAVE_ANSI_CPP #include diff --git a/msvc/ctsim/ctsim.plg b/msvc/ctsim/ctsim.plg index 9a07f72..8756f70 100644 --- a/msvc/ctsim/ctsim.plg +++ b/msvc/ctsim/ctsim.plg @@ -6,13 +6,13 @@ --------------------Configuration: ctsim - Win32 Debug--------------------

Command Lines

-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP140E.tmp" with contents +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2E7.tmp" with contents [ /nologo /G6 /MTd /W3 /Gm /GR /GX /Zi /Od /I "\wx2\include" /I "." /I "..\..\include" /I "..\..\getopt" /I "..\..\..\lpng108" /I "..\..\..\zlib" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /D VERSION=\"2.5.0\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.0.0alpha5\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c -"D:\ctsim\src\views.cpp" +"C:\ctsim\src\views.cpp" ] -Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP140E.tmp" -Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP140F.tmp" with contents +Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2E7.tmp" +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2E8.tmp" with contents [ comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../libctsim/Debug/libctsim.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lpng108\msvc\win32\libpng\lib_dbg\libpng.lib ..\..\..\lpng108\msvc\win32\zlib\lib_dbg\zlib.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib ../../../wx2/lib/wxd.lib xpmd.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"..\..\..\lpng108\msvc\win32\libpng\lib" /libpath:"..\..\..\lpng108\msvc\win32\zlib\lib" /libpath:"..\..\..\wx2\lib" .\Debug\ctsim.obj @@ -28,7 +28,7 @@ comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib w \wx2\lib\wxd.lib \wx2\lib\xpmd.lib ] -Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP140F.tmp" +Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2E8.tmp"

Output Window

Compiling... views.cpp diff --git a/src/ctsim.cpp b/src/ctsim.cpp index e96746c..c2c952e 100644 --- a/src/ctsim.cpp +++ b/src/ctsim.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctsim.cpp,v 1.51 2001/01/27 22:10:11 kevin Exp $ +** $Id: ctsim.cpp,v 1.52 2001/01/28 03:48:55 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 @@ -70,7 +70,7 @@ #endif #endif -static const char* rcsindent = "$Id: ctsim.cpp,v 1.51 2001/01/27 22:10:11 kevin Exp $"; +static const char* rcsindent = "$Id: ctsim.cpp,v 1.52 2001/01/28 03:48:55 kevin Exp $"; struct option CTSimApp::ctsimOptions[] = { @@ -371,6 +371,7 @@ MainFrame::~MainFrame() if (theApp->getConfig()) theApp->getDocManager()->FileHistorySave (*theApp->getConfig()); delete theApp->getDocManager(); + } void diff --git a/src/views.cpp b/src/views.cpp index ec75fcc..315474d 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.81 2001/01/27 22:31:57 kevin Exp $ +** $Id: views.cpp,v 1.82 2001/01/28 03:48:55 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 @@ -231,7 +231,8 @@ ImageFileView::ImageFileView() ImageFileView::~ImageFileView() { - theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu); + GetDocumentManager()->FileHistoryRemoveMenu (m_pFileMenu); + GetDocumentManager()->ActivateView(this, FALSE, TRUE); } void @@ -818,8 +819,8 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view) m_pFileMenu->AppendSeparator(); m_pFileMenu->Append(MAINMENU_FILE_EXIT, "E&xit"); #endif - theApp->getDocManager()->FileHistoryAddFilesToMenu(m_pFileMenu); - theApp->getDocManager()->FileHistoryUseMenu(m_pFileMenu); + GetDocumentManager()->FileHistoryAddFilesToMenu(m_pFileMenu); + GetDocumentManager()->FileHistoryUseMenu(m_pFileMenu); wxMenu *view_menu = new wxMenu; view_menu->Append(IFMENU_VIEW_SCALE_MINMAX, "Display Scale S&et...\tCtrl-E"); @@ -911,7 +912,7 @@ bool ImageFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) ) { m_pFrame = CreateChildFrame(doc, this); - SetFrame (m_pFrame); + (m_pFrame); m_bMinSpecified = false; m_bMaxSpecified = false; @@ -999,22 +1000,23 @@ ImageFileView::OnClose (bool deleteWindow) return false; if (m_pCanvas) { - m_pCanvas->Clear(); - m_pCanvas->Show(false); +// m_pCanvas->Show(false); +// m_pCanvas->Clear(); m_pCanvas->setView(NULL); m_pCanvas = NULL; } wxString s(theApp->GetAppName()); if (m_pFrame) m_pFrame->SetTitle(s); - SetFrame(NULL); + SetFrame(NULL); Activate(false); - + if (deleteWindow) { - //m_pFrame->Show(false); + m_pFrame->Show(false); + //m_pFrame->Close(true); m_pFrame->Destroy(); - // delete m_pFrame; + // delete m_pFrame; m_pFrame = NULL; } return true; @@ -1736,8 +1738,13 @@ END_EVENT_TABLE() PhantomFileView::PhantomFileView() : wxView(), m_pFrame(NULL), m_pCanvas(NULL), m_pFileMenu(0) { +#if defined(DEBUG) || defined(_DEBUG) + m_iDefaultNDet = 165; + m_iDefaultNView = 180; +#else m_iDefaultNDet = 367; m_iDefaultNView = 320; +#endif m_iDefaultNSample = 1; m_dDefaultRotation = 1; m_dDefaultFocalLength = 2; @@ -1745,14 +1752,21 @@ PhantomFileView::PhantomFileView() m_iDefaultGeometry = Scanner::GEOMETRY_PARALLEL; m_iDefaultTrace = Trace::TRACE_NONE; +#ifdef DEBUG + m_iDefaultRasterNX = 115; + m_iDefaultRasterNY = 115; + m_iDefaultRasterNSamples = 1; +#else m_iDefaultRasterNX = 256; m_iDefaultRasterNY = 256; m_iDefaultRasterNSamples = 2; +#endif } PhantomFileView::~PhantomFileView() { - theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu); + GetDocumentManager()->FileHistoryRemoveMenu (m_pFileMenu); + GetDocumentManager()->ActivateView(this, FALSE, TRUE); } void @@ -1848,7 +1862,7 @@ PhantomFileView::OnProjections (wxCommandEvent& event) pFrame->SetFocus(); pFrame->Raise(); } - theApp->getDocManager()->ActivateView (pView, true, false); + GetDocumentManager()->ActivateView (pView, true, false); } ::wxYield(); if (theApp->getSetModifyNewDocs()) @@ -1959,8 +1973,8 @@ PhantomFileView::CreateChildFrame(wxDocument *doc, wxView *view) m_pFileMenu->AppendSeparator(); m_pFileMenu->Append(MAINMENU_FILE_EXIT, "E&xit"); #endif - theApp->getDocManager()->FileHistoryAddFilesToMenu(m_pFileMenu); - theApp->getDocManager()->FileHistoryUseMenu(m_pFileMenu); + GetDocumentManager()->FileHistoryAddFilesToMenu(m_pFileMenu); + GetDocumentManager()->FileHistoryUseMenu(m_pFileMenu); wxMenu *process_menu = new wxMenu; process_menu->Append(PHMMENU_PROCESS_RASTERIZE, "&Rasterize...\tCtrl-R"); @@ -2033,22 +2047,23 @@ PhantomFileView::OnClose (bool deleteWindow) return false; if (m_pCanvas) { - m_pCanvas->Clear(); + //m_pCanvas->Show(false); + //m_pCanvas->Clear(); m_pCanvas->setView(NULL); - 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(); + //GetDocumentManager()->ActivateView(this, FALSE, TRUE); + // delete m_pFrame; m_pFrame = NULL; } @@ -2114,8 +2129,14 @@ END_EVENT_TABLE() ProjectionFileView::ProjectionFileView() : wxView(), m_pCanvas(NULL), m_pFrame(NULL), m_pFileMenu(0) { +#ifdef DEBUG + m_iDefaultNX = 115; + m_iDefaultNY = 115; +#else m_iDefaultNX = 256; m_iDefaultNY = 256; +#endif + m_iDefaultFilter = SignalFilter::FILTER_ABS_BANDLIMIT; m_dDefaultFilterParam = 1.; #if HAVE_FFTW @@ -2139,7 +2160,8 @@ ProjectionFileView::ProjectionFileView() ProjectionFileView::~ProjectionFileView() { - theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu); + GetDocumentManager()->FileHistoryRemoveMenu (m_pFileMenu); + GetDocumentManager()->ActivateView(this, FALSE, TRUE);; } void @@ -2365,8 +2387,8 @@ ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view) m_pFileMenu->AppendSeparator(); m_pFileMenu->Append(MAINMENU_FILE_EXIT, "E&xit"); #endif - theApp->getDocManager()->FileHistoryAddFilesToMenu(m_pFileMenu); - theApp->getDocManager()->FileHistoryUseMenu(m_pFileMenu); + GetDocumentManager()->FileHistoryAddFilesToMenu(m_pFileMenu); + GetDocumentManager()->FileHistoryUseMenu(m_pFileMenu); wxMenu *convert_menu = new wxMenu; convert_menu->Append (PJMENU_CONVERT_POLAR, "&Polar Image...\tCtrl-L"); @@ -2503,22 +2525,23 @@ ProjectionFileView::OnClose (bool deleteWindow) return false; if (m_pCanvas) { - m_pCanvas->Clear(); + //m_pCanvas->Show(false); + //m_pCanvas->Clear(); m_pCanvas->setView(NULL); - 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->Show(false); m_pFrame->Destroy(); - // delete m_pFrame; + // delete m_pFrame; + //m_pFrame->Close(true); m_pFrame = NULL; } return true; @@ -2567,7 +2590,7 @@ PlotFileView::~PlotFileView() if (m_pEZPlot) delete m_pEZPlot; - theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu); + GetDocumentManager()->FileHistoryRemoveMenu (m_pFileMenu); } void @@ -2694,8 +2717,8 @@ PlotFileView::CreateChildFrame(wxDocument *doc, wxView *view) m_pFileMenu->AppendSeparator(); m_pFileMenu->Append(MAINMENU_FILE_EXIT, "E&xit"); #endif - theApp->getDocManager()->FileHistoryAddFilesToMenu(m_pFileMenu); - theApp->getDocManager()->FileHistoryUseMenu(m_pFileMenu); + GetDocumentManager()->FileHistoryAddFilesToMenu(m_pFileMenu); + GetDocumentManager()->FileHistoryUseMenu(m_pFileMenu); wxMenu *view_menu = new wxMenu; view_menu->Append(PLOTMENU_VIEW_SCALE_MINMAX, "Display Scale &Set...\tCtrl-E"); @@ -2833,21 +2856,24 @@ PlotFileView::OnClose (bool deleteWindow) return false; if (m_pCanvas) { - m_pCanvas->Clear(); +// m_pCanvas->Show(false); +// m_pCanvas->Clear(); m_pCanvas->setView (NULL); - m_pCanvas->Show(false); m_pCanvas = NULL; } wxString s(wxTheApp->GetAppName()); if (m_pFrame) m_pFrame->SetTitle(s); - SetFrame(NULL); Activate(false); + m_pFrame->SetView(NULL); + SetFrame(NULL); if (deleteWindow) { - //m_pFrame->Show(false); - m_pFrame->Destroy(); + m_pFrame->Show(false); + m_pFrame->Destroy(); + //m_pFrame->Close(true); + //GetDocumentManager()->ActivateView(this, FALSE, TRUE); // delete m_pFrame; m_pFrame = NULL; } @@ -2862,7 +2888,8 @@ IMPLEMENT_DYNAMIC_CLASS(TextFileView, wxView) TextFileView::~TextFileView() { - theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu); + GetDocumentManager()->FileHistoryRemoveMenu (m_pFileMenu); + GetDocumentManager()->ActivateView(this, FALSE, TRUE);; } bool TextFileView::OnCreate(wxDocument *doc, long WXUNUSED(flags) ) @@ -2901,7 +2928,7 @@ void TextFileView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) ) bool TextFileView::OnClose (bool deleteWindow) { - if (m_pFrame && m_pFrame->GetTitle() == "Log") + // if (m_pFrame && m_pFrame->GetTitle() == "Log") return false; if (! GetDocument() || ! GetDocument()->Close()) @@ -2909,10 +2936,14 @@ TextFileView::OnClose (bool deleteWindow) m_pCanvas->Show(false); Activate(false); - + + SetFrame(NULL); + m_pFrame->SetView(NULL); if (deleteWindow) { - //m_pFrame->Show(false); - m_pFrame->Destroy(); + m_pFrame->Show(false); + m_pFrame->Destroy(); + //m_pFrame->Close(true); + //GetDocumentManager()->ActivateView(this, FALSE, TRUE); // delete m_pFrame; m_pFrame = NULL; @@ -2951,8 +2982,8 @@ TextFileView::CreateChildFrame (wxDocument *doc, wxView *view) m_pFileMenu->AppendSeparator(); m_pFileMenu->Append(MAINMENU_FILE_EXIT, "E&xit"); #endif - theApp->getDocManager()->FileHistoryAddFilesToMenu(m_pFileMenu); - theApp->getDocManager()->FileHistoryUseMenu(m_pFileMenu); + GetDocumentManager()->FileHistoryAddFilesToMenu(m_pFileMenu); + GetDocumentManager()->FileHistoryUseMenu(m_pFileMenu); wxMenu *help_menu = new wxMenu; help_menu->Append(MAINMENU_HELP_CONTENTS, "&Contents\tF1"); diff --git a/src/views.h b/src/views.h index eca72d4..0bec2e6 100644 --- a/src/views.h +++ b/src/views.h @@ -7,9 +7,9 @@ ** Date Started: July 2000 ** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg +** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: views.h,v 1.35 2001/01/27 03:08:16 kevin Exp $ +** $Id: views.h,v 1.36 2001/01/28 03:48:55 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 @@ -66,7 +66,7 @@ private: wxWindow* getFrameForChild() #if CTSIM_MDI - { return theApp->getMainFrame()->GetClientWindow(); } + { return theApp->getMainFrame(); } #else { return m_pFrame; } #endif @@ -207,7 +207,7 @@ private: wxWindow* getFrameForChild() #if CTSIM_MDI - { return theApp->getMainFrame()->GetClientWindow(); } + { return theApp->getMainFrame(); } #else { return m_pFrame; } #endif @@ -290,7 +290,7 @@ private: wxWindow* getFrameForChild() #if CTSIM_MDI - { return theApp->getMainFrame()->GetClientWindow(); } + { return theApp->getMainFrame(); } #else { return m_pFrame; } #endif @@ -361,7 +361,7 @@ private: PlotFileCanvas *CreateCanvas(wxView *view, wxFrame *parent); wxWindow* getFrameForChild() #if CTSIM_MDI - { return theApp->getMainFrame()->GetClientWindow(); } + { return theApp->getMainFrame(); } #else { return m_pFrame; } #endif -- 2.34.1