From: Kevin M. Rosenberg Date: Tue, 26 Dec 2000 21:13:15 +0000 (+0000) Subject: r314: ezplot fixes X-Git-Tag: debian-4.5.3-3~703 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=fd726516dd11fd37a675a94c1e7165c47d793b34 r314: ezplot fixes --- diff --git a/libctgraphics/ezplot.cpp b/libctgraphics/ezplot.cpp index 8c385e0..eab8cc3 100644 --- a/libctgraphics/ezplot.cpp +++ b/libctgraphics/ezplot.cpp @@ -6,7 +6,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ezplot.cpp,v 1.22 2000/12/25 21:54:26 kevin Exp $ +** $Id: ezplot.cpp,v 1.23 2000/12/26 21:13:15 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 @@ -441,8 +441,8 @@ EZPlot::plot () // adjust frame for title title_row = ya_max;; if (c_title.length() > 0) - ya_max -= 2 * charheight; - + ya_max -= 2 * charheight; + // calculate legend box boundaries int max_leg = 0; // longest legend in characters int num_leg = 0; // number of legend titles @@ -521,12 +521,19 @@ EZPlot::plot () // X-Label if (c_xlabel.length() > 0) - ya_min += 2.0 * charheight; + ya_min += 1.5 * charheight; xlbl_row = xp_min; // put x-label on bottom of plot frame // Y-Label - if (c_ylabel.length() > 0) - xa_min += 2.0 * charheight; + if (c_ylabel.length() > 0) { + rSGP.setTextAngle (HALFPI); + rSGP.setTextSize (1.5 * charheight); + double xExtent, yExtent; + rSGP.getTextExtent (c_ylabel.c_str(), &xExtent, &yExtent); + rSGP.setTextSize (charheight); + xa_min += xExtent; + rSGP.setTextAngle (0.0); + } ylbl_col = xp_min; /*------------------------------*/ @@ -776,9 +783,11 @@ EZPlot::drawAxes() rSGP.lineAbs (xt_min + xn_tickinc * i, ya_min); } } - rSGP.moveAbs (xa_min + (xa_max-xa_min)/2 - c_xlabel.length()*charwidth * 1.5, xlbl_row + charheight * 1.5); rSGP.setTextSize (charheight * 1.5); - rSGP.setTextColor (clr_label, -1); + rSGP.setTextColor (clr_label, -1); + double wText, hText; + rSGP.getTextExtent (c_xlabel.c_str(), &wText, &hText); + rSGP.moveAbs (xa_min + (xa_max-xa_min)/2 - wText / 2, xlbl_row + charheight * 1.5); rSGP.drawText (c_xlabel); rSGP.setTextSize (charheight); minorinc = xn_tickinc / (o_xminortick + 1); @@ -842,19 +851,13 @@ EZPlot::drawAxes() rSGP.lineAbs (xa_min, y); } } -#if 0 - rSGP.moveAbs(.5,.5); - char s[128]; - snprintf(s,sizeof(s),"%f, %f",charwidth, charheight); - rSGP.drawText(s); -#endif rSGP.setTextAngle (HALFPI); rSGP.setTextSize (1.5 * charheight); rSGP.setTextColor (clr_label, -1); double xExtent, yExtent; rSGP.getTextExtent (c_ylabel.c_str(), &xExtent, &yExtent); - rSGP.moveAbs (ylbl_col, ya_min + (ya_max-ya_min)/2 - yExtent); - rSGP.drawText (c_ylabel); + rSGP.moveAbs (ylbl_col, ya_min + (ya_max-ya_min)/2 - yExtent / 2); + rSGP.drawText (c_ylabel); rSGP.setTextAngle (0.0); rSGP.setTextSize (charheight); minorinc = yn_tickinc / (o_yminortick + 1); diff --git a/libctgraphics/sgp.cpp b/libctgraphics/sgp.cpp index 4b2d5dc..a745093 100644 --- a/libctgraphics/sgp.cpp +++ b/libctgraphics/sgp.cpp @@ -7,7 +7,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: sgp.cpp,v 1.23 2000/12/25 21:54:26 kevin Exp $ +** $Id: sgp.cpp,v 1.24 2000/12/26 21:13:15 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 @@ -532,7 +532,12 @@ SGP::getTextExtent (const char* szText, double* worldW, double* worldH) if (m_driver.isWX()) { wxString sText (szText); wxCoord deviceW, deviceH; - m_driver.idWX()->GetTextExtent (sText, &deviceW, &deviceH); + m_driver.idWX()->GetTextExtent (sText, &deviceW, &deviceH); + if (m_dTextAngle == 90 || m_dTextAngle == -90) { + wxCoord temp = deviceW; + deviceW = deviceH; + deviceH = temp; + } *worldW = (xw_max - xw_min) * deviceW / static_cast(m_iPhysicalXSize);; *worldH = (yw_max - yw_min) * deviceH / static_cast(m_iPhysicalYSize); } diff --git a/msvc/ctsim/ctsim.plg b/msvc/ctsim/ctsim.plg index 2f9de80..c6fc514 100644 --- a/msvc/ctsim/ctsim.plg +++ b/msvc/ctsim/ctsim.plg @@ -6,13 +6,13 @@ --------------------Configuration: libctsim - Win32 Debug--------------------

Command Lines

-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP26F.tmp" with contents +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2A3.tmp" with contents [ /nologo /G6 /MTd /W3 /Gm /GR /GX /ZI /Od /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__" /FR"Debug/" /Fp"Debug/libctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c "C:\ctsim-2.0.6\libctgraphics\ezplot.cpp" ] -Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP26F.tmp" -Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP270.tmp" with contents +Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2A3.tmp" +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2A4.tmp" with contents [ /nologo /out:"Debug\libctsim.lib" ".\Debug\array2dfile.obj" @@ -42,7 +42,7 @@ Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP270.tmp" with conten ".\Debug\transformmatrix.obj" ".\Debug\xform.obj" ] -Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP270.tmp" +Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2A4.tmp"

Output Window

Compiling... ezplot.cpp @@ -51,16 +51,7 @@ Creating library... --------------------Configuration: ctsim - Win32 Debug--------------------

Command Lines

-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP271.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=\"2.5.0\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c -"C:\ctsim-2.0.6\src\ctsim.cpp" -"C:\ctsim-2.0.6\src\dialogs.cpp" -"C:\ctsim-2.0.6\src\docs.cpp" -"C:\ctsim-2.0.6\src\views.cpp" -] -Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP271.tmp" -Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP272.tmp" with contents +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2A5.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 /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrtd.lib" /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"..\..\..\lpng108\msvc\win32\libpng\lib" /libpath:"..\..\..\lpng108\msvc\win32\zlib\lib" ".\Debug\ctsim.obj" @@ -75,24 +66,14 @@ comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib w "\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib" "\wx2\lib\wxd.lib" ] -Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP272.tmp" +Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2A5.tmp"

Output Window

-Compiling... -views.cpp -Skipping... (no relevant changes detected) -ctsim.cpp -dialogs.cpp -docs.cpp Linking... -Creating command line "bscmake.exe /nologo /o"Debug/ctsim.bsc" ".\Debug\ctsim.sbr" ".\Debug\dialogs.sbr" ".\Debug\dlgprojections.sbr" ".\Debug\dlgreconstruct.sbr" ".\Debug\docs.sbr" ".\Debug\views.sbr"" -Creating browse info file... -BSCMAKE: warning BK4503 : minor error in .SBR file '.\Debug\views.sbr' ignored -

Output Window

Results

-ctsim.exe - 0 error(s), 1 warning(s) +ctsim.exe - 0 error(s), 0 warning(s)