From cbcb02ba9b76a82c9a09ce1c7712431bb215575a Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Tue, 30 Jan 2001 02:20:50 +0000 Subject: [PATCH] r470: Fixed shutdown error, take 3 --- ChangeLog | 2 + libctsupport/syserror.cpp | 10 +- msvc/ctsim/ctsim.dsp | 10 +- msvc/ctsim/ctsim.plg | 59 ++++++++++-- msvc/ctsim225.dsw | 182 +++++++++++++++++++++++++++++++++++ msvc/ctsimtext/ctsimtext.dsp | 8 +- msvc/libctsim/libctsim.dsp | 4 +- src/docs.cpp | 39 +++++++- src/docs.h | 36 +++++-- src/views.cpp | 28 ++++-- src/views.h | 5 +- 11 files changed, 335 insertions(+), 48 deletions(-) create mode 100644 msvc/ctsim225.dsw diff --git a/ChangeLog b/ChangeLog index 6b18e09..0e1af36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ * ctsim: Added MDI interface for Windows version and made it default * ctsim: Added graphical About box + + * ctsim: Escape key now removes cursor from image files * ctsim: Added accelerator (hotkeys) to frames diff --git a/libctsupport/syserror.cpp b/libctsupport/syserror.cpp index a4f8eda..d50471e 100644 --- a/libctsupport/syserror.cpp +++ b/libctsupport/syserror.cpp @@ -2,7 +2,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: syserror.cpp,v 1.19 2001/01/28 19:10:18 kevin Exp $ +** $Id: syserror.cpp,v 1.20 2001/01/30 02:20:50 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 @@ -54,8 +54,12 @@ void sys_error (int severity, const char *msg, ...) sys_verror (strOutput, severity, msg, arg); #ifdef HAVE_WXWINDOWS - if (g_bRunningWXWindows) - wxLog::OnLog (wxLOG_Message, strOutput.c_str(), time(NULL)); + if (g_bRunningWXWindows) { + if (theApp) + *theApp->getLog() << strOutput.c_str() << "\n"; + else + wxLog::OnLog (wxLOG_Message, strOutput.c_str(), time(NULL)); + } else #endif std::cout << strOutput; diff --git a/msvc/ctsim/ctsim.dsp b/msvc/ctsim/ctsim.dsp index 8037263..2450c8b 100644 --- a/msvc/ctsim/ctsim.dsp +++ b/msvc/ctsim/ctsim.dsp @@ -43,11 +43,11 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /GR /GX /O2 /I "." /I "..\..\include" /I "..\..\getopt" /I "..\..\..\lpng108" /I "..\..\..\zlib" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2\include" /D "NDEBUG" /D "__WXWIN__" /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.0beta1\" /FR /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GR /GX /O2 /I "...\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\include" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /D "NDEBUG" /D "__WXWIN__" /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.0beta1\" /FR /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /i "\wx2.2.1\include" /d "NDEBUG" +# ADD RSC /l 0x409 /i "\wx2.2.5\include" /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -69,17 +69,17 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /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.0beta1\" /FR /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /D VERSION=\"3.0.0beta1\" /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.0beta1\" /FR /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /i "\wx2.2.1\include" /d "_DEBUG" +# ADD RSC /l 0x409 /i "\wx2.2.5\include" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 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 pngd.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 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 libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib pngd.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"\wx2.2.5\lib" # SUBTRACT LINK32 /nodefaultlib !ENDIF diff --git a/msvc/ctsim/ctsim.plg b/msvc/ctsim/ctsim.plg index 0e8c2c5..aaf56f3 100644 --- a/msvc/ctsim/ctsim.plg +++ b/msvc/ctsim/ctsim.plg @@ -3,16 +3,59 @@
 

Build Log

---------------------Configuration: ctsim - Win32 Debug-------------------- +--------------------Configuration: libctsim - Win32 Debug--------------------

Command Lines

-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP786.tmp" with contents +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP7C4.tmp" with contents +[ +/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "..\..\..\wx2.2.5\src\png" /I "..\..\..\wx2.2.5\src\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2.2.5\include" /D "_DEBUG" /D "HAVE_WXWIN" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /FR"Debug/" /Fp"Debug/libctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c +"C:\ctsim\libctsupport\syserror.cpp" +] +Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP7C4.tmp" +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP7C5.tmp" with contents [ -/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /D VERSION=\"3.0.0beta1\" /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 -"C:\ctsim\src\views.cpp" +/nologo /out:"Debug\libctsim.lib" +.\Debug\array2dfile.obj +.\Debug\backprojectors.obj +.\Debug\clip.obj +.\Debug\consoleio.obj +.\Debug\dlgezplot.obj +.\Debug\ezplot.obj +.\Debug\ezset.obj +.\Debug\ezsupport.obj +.\Debug\filter.obj +.\Debug\fnetorderstream.obj +.\Debug\fourier.obj +.\Debug\getopt.obj +.\Debug\getopt1.obj +.\Debug\globalvars.obj +.\Debug\hashtable.obj +.\Debug\imagefile.obj +.\Debug\mathfuncs.obj +.\Debug\phantom.obj +.\Debug\plotfile.obj +.\Debug\pol.obj +.\Debug\procsignal.obj +.\Debug\projections.obj +.\Debug\reconstruct.obj +.\Debug\scanner.obj +.\Debug\sgp.obj +.\Debug\strfuncs.obj +.\Debug\syserror.obj +.\Debug\trace.obj +.\Debug\transformmatrix.obj +.\Debug\xform.obj ] -Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP786.tmp" -Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP787.tmp" with contents +Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP7C5.tmp" +

Output Window

+Compiling... +syserror.cpp +Creating library... +

+--------------------Configuration: ctsim - Win32 Debug-------------------- +

+

Command Lines

+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP7C6.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 libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib pngd.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"\wx2.2.5\lib" .\Debug\ctsim.obj @@ -32,10 +75,8 @@ comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib w \wx2.2.5\lib\xpmd.lib \wx2.2.5\lib\zlibd.lib ] -Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP787.tmp" +Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP7C6.tmp"

Output Window

-Compiling... -views.cpp Linking... diff --git a/msvc/ctsim225.dsw b/msvc/ctsim225.dsw new file mode 100644 index 0000000..5755408 --- /dev/null +++ b/msvc/ctsim225.dsw @@ -0,0 +1,182 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "FFTW2st"="..\..\fftw-2.1.3\Win32\FFTW2st\FFTW2st.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "RFFTW2st"="..\..\fftw-2.1.3\Win32\RFFTW2st\RFFTW2st.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "ctsim"=.\ctsim\ctsim.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libctsim + End Project Dependency + Begin Project Dependency + Project_Dep_Name FFTW2st + End Project Dependency + Begin Project Dependency + Project_Dep_Name RFFTW2st + End Project Dependency + Begin Project Dependency + Project_Dep_Name jpeg + End Project Dependency + Begin Project Dependency + Project_Dep_Name png + End Project Dependency + Begin Project Dependency + Project_Dep_Name tiff + End Project Dependency + Begin Project Dependency + Project_Dep_Name wxvc + End Project Dependency + Begin Project Dependency + Project_Dep_Name xpm + End Project Dependency + Begin Project Dependency + Project_Dep_Name zlib + End Project Dependency +}}} + +############################################################################### + +Project: "ctsimtext"=.\ctsimtext\ctsimtext.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libctsim + End Project Dependency + Begin Project Dependency + Project_Dep_Name RFFTW2st + End Project Dependency +}}} + +############################################################################### + +Project: "jpeg"=..\..\wx2.2.5\src\jpeg\JpegVC.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "libctsim"=.\libctsim\libctsim.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "png"=..\..\wx2.2.5\src\png\PngVC.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "tiff"=..\..\wx2.2.5\src\tiff\TiffVC.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "wxvc"=..\..\wx2.2.5\src\wxvc.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "xpm"=..\..\wx2.2.5\src\xpm\XpmVC.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "zlib"=..\..\wx2.2.5\src\zlib\ZlibVC.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/msvc/ctsimtext/ctsimtext.dsp b/msvc/ctsimtext/ctsimtext.dsp index 30464d9..3b6c324 100644 --- a/msvc/ctsimtext/ctsimtext.dsp +++ b/msvc/ctsimtext/ctsimtext.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /GR /GX /O2 /I "../../include" /I "../../getopt" /I "..\..\..\lpng108" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\zlib" /I "..\..\..\wx2\include" /D "NDEBUG" /D "HAVE_GETOPT_H" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "MSVC" /D "HAVE_STRING_H" /D "HAVE_PNG" /D "NO_MAIN" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GR /GX /O2 /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "../../include" /I "../../getopt" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2.2.5\include" /D VERSION=\"3.0.0beta1\" /D "NDEBUG" /D "HAVE_GETOPT_H" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "MSVC" /D "HAVE_STRING_H" /D "HAVE_PNG" /D "NO_MAIN" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -50,7 +50,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.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 /nologo /subsystem:console /machine:I386 -# ADD LINK32 wx.lib libctsim.lib zlib.lib comctl32.lib wsock32.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 tiff.lib jpeg.lib png.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Release\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Release\RFFTW2st.lib xpmd.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 wx.lib libctsim.lib zlib.lib comctl32.lib wsock32.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 tiff.lib jpeg.lib png.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Release\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Release\RFFTW2st.lib xpmd.lib /nologo /subsystem:console /machine:I386 /libpath:"\wx2.2.5\lib" !ELSEIF "$(CFG)" == "ctsimtext - Win32 Debug" @@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "../../include" /I "../../getopt" /I "..\..\..\lpng108" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\zlib" /I "..\..\..\wx2\include" /D "_DEBUG" /D "HAVE_GETOPT_H" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "MSVC" /D "HAVE_STRING_H" /D "HAVE_PNG" /D "NO_MAIN" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /FR /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "../../include" /I "../../getopt" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2.2.5\include" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "HAVE_GETOPT_H" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "MSVC" /D "HAVE_STRING_H" /D "HAVE_PNG" /D "NO_MAIN" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -74,7 +74,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib pngd.lib zlibd.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:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib pngd.lib zlibd.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"\wx2.2.5\lib" # SUBTRACT LINK32 /verbose /incremental:no /nodefaultlib !ENDIF diff --git a/msvc/libctsim/libctsim.dsp b/msvc/libctsim/libctsim.dsp index b17a3e0..b2d359e 100644 --- a/msvc/libctsim/libctsim.dsp +++ b/msvc/libctsim/libctsim.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Target_Dir "" MTL=midl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /GR /GX /O2 /I "..\..\..\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\lpng108" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2\include" /D "NDEBUG" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GR /GX /O2 /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2.2.5\include" /D "NDEBUG" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /YX /FD /c # SUBTRACT CPP /X # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -67,7 +67,7 @@ LIB32=link.exe -lib # PROP Target_Dir "" MTL=midl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "..\..\..\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\lpng108" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2\include" /D "_DEBUG" /D "HAVE_WXWIN" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /FR /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "..\..\..\wx2.2.5\src\png" /I "..\..\..\wx2.2.5\src\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2.2.5\include" /D "_DEBUG" /D "HAVE_WXWIN" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /FR /YX /FD /GZ /c # SUBTRACT CPP /X # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" diff --git a/src/docs.cpp b/src/docs.cpp index daef2f4..88e6ba5 100644 --- a/src/docs.cpp +++ b/src/docs.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: docs.cpp,v 1.16 2001/01/28 19:10:18 kevin Exp $ +** $Id: docs.cpp,v 1.17 2001/01/30 02:20:50 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 @@ -68,17 +68,21 @@ bool ImageFileDocument::OnSaveDocument(const wxString& filename) bool ImageFileDocument::OnOpenDocument(const wxString& filename) { + if (! OnSaveModified()) + return false; + if (! m_imageFile.fileRead (filename.c_str())) { *theApp->getLog() << "Unable to read image file " << filename << "\n"; + m_bBadFileOpen = true; return false; } *theApp->getLog() << "Read image file " << filename << "\n"; - SetFilename(filename, true); - + SetFilename(filename, true); Modify(false); UpdateAllViews(); GetFirstView()->OnUpdate (GetFirstView(), NULL); - + m_bBadFileOpen = false; + return true; } @@ -115,8 +119,12 @@ bool ProjectionFileDocument::OnSaveDocument(const wxString& filename) bool ProjectionFileDocument::OnOpenDocument(const wxString& filename) { + if (! OnSaveModified()) + return false; + if (! m_projectionFile.read (filename.c_str())) { *theApp->getLog() << "Unable to read projection file " << filename << "\n"; + m_bBadFileOpen = true; return false; } *theApp->getLog() << "Read projection file " << filename << "\n"; @@ -124,6 +132,7 @@ bool ProjectionFileDocument::OnOpenDocument(const wxString& filename) Modify(false); UpdateAllViews(); GetFirstView()->OnUpdate (GetFirstView(), NULL); + m_bBadFileOpen = false; return true; } @@ -151,6 +160,9 @@ IMPLEMENT_DYNAMIC_CLASS(PhantomFileDocument, wxDocument) bool PhantomFileDocument::OnOpenDocument(const wxString& filename) { + if (! OnSaveModified()) + return false; + wxString myFilename = filename; if (wxFile::Exists (myFilename)) { m_phantom.createFromFile (myFilename); @@ -163,12 +175,14 @@ bool PhantomFileDocument::OnOpenDocument(const wxString& filename) SetFilename (myFilename, true); if (m_phantom.fail()) { *theApp->getLog() << "Failure creating phantom " << myFilename << "\n"; + m_bBadFileOpen = true; return false; } m_idPhantom = m_phantom.id(); Modify(false); UpdateAllViews(); GetFirstView()->OnUpdate (GetFirstView(), NULL); + m_bBadFileOpen = false; return true; } @@ -219,8 +233,12 @@ bool PlotFileDocument::OnSaveDocument(const wxString& filename) bool PlotFileDocument::OnOpenDocument(const wxString& filename) { + if (! OnSaveModified()) + return false; + if (! m_plot.fileRead (filename.c_str())) { *theApp->getLog() << "Unable to read plot file " << filename << "\n"; + m_bBadFileOpen = true; return false; } *theApp->getLog() << "Read plot file " << filename << "\n"; @@ -229,6 +247,7 @@ bool PlotFileDocument::OnOpenDocument(const wxString& filename) Modify (false); UpdateAllViews(); GetFirstView()->OnUpdate (NULL, NULL); + m_bBadFileOpen = false; return true; } @@ -273,12 +292,15 @@ bool TextFileDocument::OnOpenDocument(const wxString& filename) { TextFileView *view = getView(); - if (! view->getTextCtrl()->LoadFile(filename)) + if (! view->getTextCtrl()->LoadFile(filename)) { + m_bBadFileOpen = true; return false; + } SetFilename (filename, true); Modify (false); UpdateAllViews(); + m_bBadFileOpen = false; return true; } @@ -300,3 +322,10 @@ TextFileDocument::getView() const { return dynamic_cast(GetFirstView()); } + +wxTextCtrl* +TextFileDocument::getTextCtrl() +{ + return dynamic_cast(GetFirstView())->getTextCtrl(); +} + diff --git a/src/docs.h b/src/docs.h index 6db9568..9d09e87 100644 --- a/src/docs.h +++ b/src/docs.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: docs.h,v 1.15 2001/01/28 19:10:18 kevin Exp $ +** $Id: docs.h,v 1.16 2001/01/30 02:20:50 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 @@ -51,6 +51,7 @@ class ImageFileDocument: public wxDocument private: DECLARE_DYNAMIC_CLASS(ImageFileDocument) ImageFile m_imageFile; + bool m_bBadFileOpen; public: virtual bool OnSaveDocument (const wxString& filename); @@ -58,13 +59,17 @@ public: virtual bool IsModified () const; virtual void Modify (bool mod); - ImageFileDocument () {} + ImageFileDocument () + : m_bBadFileOpen(false) + {} + virtual ~ImageFileDocument () {} const ImageFile& getImageFile() const { return m_imageFile; } ImageFile& getImageFile() { return m_imageFile; } ImageFileView* getView() const; + bool getBadFileOpen() const { return m_bBadFileOpen; } }; @@ -73,6 +78,7 @@ class ProjectionFileDocument: public wxDocument private: DECLARE_DYNAMIC_CLASS(ProjectionFileDocument) Projections m_projectionFile; + bool m_bBadFileOpen; public: virtual bool OnSaveDocument (const wxString& filename); @@ -80,13 +86,17 @@ public: virtual bool IsModified () const; virtual void Modify (bool mod); - ProjectionFileDocument () {} + ProjectionFileDocument () + : m_bBadFileOpen(false) + {} + virtual ~ProjectionFileDocument () {} const Projections& getProjections () const { return m_projectionFile; } Projections& getProjections () { return m_projectionFile; } ProjectionFileView* getView() const; + bool getBadFileOpen() const { return m_bBadFileOpen; } }; @@ -97,10 +107,11 @@ private: Phantom m_phantom; int m_idPhantom; wxString m_namePhantom; + bool m_bBadFileOpen; public: PhantomFileDocument () - : m_idPhantom(Phantom::PHM_INVALID) + : m_idPhantom(Phantom::PHM_INVALID), m_bBadFileOpen(false) {} virtual ~PhantomFileDocument () @@ -119,6 +130,7 @@ public: virtual bool IsModified () const; virtual void Modify (bool mod); PhantomFileView* getView() const; + bool getBadFileOpen() const { return m_bBadFileOpen; } }; @@ -128,10 +140,12 @@ private: DECLARE_DYNAMIC_CLASS(PlotFileDocument) PlotFile m_plot; wxString m_namePlot; + bool m_bBadFileOpen; public: PlotFileDocument () - {} + : m_bBadFileOpen(false) + {} virtual ~PlotFileDocument () {} @@ -150,27 +164,31 @@ public: virtual bool IsModified () const; virtual void Modify (bool mod); PlotFileView* getView() const; + bool getBadFileOpen() const { return m_bBadFileOpen; } }; -#include "views.h" class TextFileDocument: public wxDocument { private: DECLARE_DYNAMIC_CLASS(TextFileDocument) + bool m_bBadFileOpen; public: - TextFileDocument(void) {} + TextFileDocument(void) + : m_bBadFileOpen(false) + {} + virtual ~TextFileDocument(void) {} virtual bool OnSaveDocument(const wxString& filename); virtual bool OnOpenDocument(const wxString& filename); virtual bool IsModified(void) const; - wxTextCtrl* getTextCtrl() - { return dynamic_cast(GetFirstView())->getTextCtrl(); } + wxTextCtrl* getTextCtrl(); TextFileView* getView() const; + bool getBadFileOpen() const { return m_bBadFileOpen; } }; diff --git a/src/views.cpp b/src/views.cpp index 713733b..2e0f78a 100644 --- a/src/views.cpp +++ b/src/views.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: views.cpp,v 1.89 2001/01/30 01:21:37 kevin Exp $ +** $Id: views.cpp,v 1.90 2001/01/30 02:20:50 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 @@ -1008,7 +1008,7 @@ ImageFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) ) bool ImageFileView::OnClose (bool deleteWindow) { - GetDocumentManager()->ActivateView (this, false, true); + //GetDocumentManager()->ActivateView (this, false, true); if (! GetDocument() || ! GetDocument()->Close()) return false; @@ -1026,8 +1026,10 @@ ImageFileView::OnClose (bool deleteWindow) if (deleteWindow) { m_pFrame->Destroy(); m_pFrame = NULL; + if (GetDocument() && GetDocument()->getBadFileOpen()) + ::wxYield(); // wxWindows bug workaround } - + return true; } @@ -2070,7 +2072,7 @@ PhantomFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) ) bool PhantomFileView::OnClose (bool deleteWindow) { - GetDocumentManager()->ActivateView (this, false, true); + //GetDocumentManager()->ActivateView (this, false, true); if (! GetDocument() || ! GetDocument()->Close()) return false; @@ -2088,8 +2090,9 @@ PhantomFileView::OnClose (bool deleteWindow) if (deleteWindow) { m_pFrame->Destroy(); m_pFrame = NULL; + if (GetDocument() && GetDocument()->getBadFileOpen()) + ::wxYield(); // wxWindows bug workaround } -// ::wxYield(); return true; } @@ -2547,7 +2550,7 @@ ProjectionFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) bool ProjectionFileView::OnClose (bool deleteWindow) { - GetDocumentManager()->ActivateView (this, false, true); + //GetDocumentManager()->ActivateView (this, false, true); if (! GetDocument() || ! GetDocument()->Close()) return false; @@ -2565,6 +2568,8 @@ ProjectionFileView::OnClose (bool deleteWindow) if (deleteWindow) { m_pFrame->Destroy(); m_pFrame = NULL; + if (GetDocument() && GetDocument()->getBadFileOpen()) + ::wxYield(); // wxWindows bug workaround } return true; @@ -2875,7 +2880,7 @@ PlotFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) ) bool PlotFileView::OnClose (bool deleteWindow) { - GetDocumentManager()->ActivateView (this, false, true); + //GetDocumentManager()->ActivateView (this, false, true); if (! GetDocument() || ! GetDocument()->Close()) return false; @@ -2893,7 +2898,9 @@ PlotFileView::OnClose (bool deleteWindow) if (deleteWindow) { m_pFrame->Destroy(); m_pFrame = NULL; - } + if (GetDocument() && GetDocument()->getBadFileOpen()) + ::wxYield(); // wxWindows bug workaround + } return true; } @@ -2949,7 +2956,7 @@ TextFileView::OnClose (bool deleteWindow) // if (m_pFrame && m_pFrame->GetTitle() == "Log") return false; - GetDocumentManager()->ActivateView (this, false, true); + //GetDocumentManager()->ActivateView (this, false, true); if (! GetDocument() || ! GetDocument()->Close()) return false; @@ -2959,7 +2966,8 @@ TextFileView::OnClose (bool deleteWindow) if (deleteWindow) { m_pFrame->Destroy(); m_pFrame = NULL; - + if (GetDocument() && GetDocument()->getBadFileOpen()) + ::wxYield(); // wxWindows bug workaround } return TRUE; diff --git a/src/views.h b/src/views.h index 1abe90d..ddc1d0a 100644 --- a/src/views.h +++ b/src/views.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: views.h,v 1.39 2001/01/30 01:21:37 kevin Exp $ +** $Id: views.h,v 1.40 2001/01/30 02:20:50 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 @@ -447,6 +447,9 @@ public: void OnUpdate (wxView *sender, wxObject *hint = (wxObject *) NULL); bool OnClose (bool deleteWindow = TRUE); + TextFileDocument* GetDocument() + { return dynamic_cast(wxView::GetDocument()); } + TextFileCanvas* getTextCtrl() { return m_pCanvas; } wxMenu* getFileMenu() { return m_pFileMenu; } #if CTSIM_MDI -- 2.34.1