Fix log window display of some strings
[ctsim.git] / src / views.cpp
index 72ba35a88e8035dff3cb91044566a11ab9224a49..690ac223bccdd3226680817ab0287ba62ebefb62 100644 (file)
@@ -7,9 +7,7 @@
 **   Date Started:  July 2000
 **
 **  This is part of the CTSim program
-**  Copyright (c) 1983-2001 Kevin Rosenberg
-**
-**  $Id$
+**  Copyright (c) 1983-2009 Kevin Rosenberg
 **
 **  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
@@ -1415,7 +1413,7 @@ ImageFileView::OnPlotRow (wxCommandEvent& event)
     } else {
       PlotFile& rPlotFile = pPlotDoc->getPlotFile();
       std::ostringstream os;
-      os << "Row " << yCursor;
+      os << "Row " << yCursor << ": ";
       std::string title("title ");
       title += os.str();
       rPlotFile.addEzsetCommand (title.c_str());
@@ -1445,7 +1443,7 @@ ImageFileView::OnPlotRow (wxCommandEvent& event)
       }
       for (unsigned int iL = 0; iL < rIF.nLabels(); iL++)
         rPlotFile.addDescription (rIF.labelGet(iL).getLabelString().c_str());
-      os << " Plot of " << dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str();
+      os << " Plot of " << wxConvUTF8.cWX2MB(dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str());
       *theApp->getLog() << wxConvUTF8.cMB2WX(os.str().c_str()) << _T("\n");
       rPlotFile.addDescription (os.str().c_str());
     }
@@ -1501,7 +1499,7 @@ ImageFileView::OnPlotCol (wxCommandEvent& event)
     } else {
       PlotFile& rPlotFile = pPlotDoc->getPlotFile();
       std::ostringstream os;
-      os << "Column " << xCursor;
+      os << "Column " << xCursor << ": ";
       std::string title("title ");
       title += os.str();
       rPlotFile.addEzsetCommand (title.c_str());
@@ -1531,7 +1529,7 @@ ImageFileView::OnPlotCol (wxCommandEvent& event)
       }
       for (unsigned int iL = 0; iL < rIF.nLabels(); iL++)
         rPlotFile.addDescription (rIF.labelGet(iL).getLabelString().c_str());
-      os << " Plot of " << dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str();
+      os << " Plot of " << wxConvUTF8.cWX2MB(dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str());
       *theApp->getLog() << wxConvUTF8.cMB2WX(os.str().c_str()) << _T("\n");
       rPlotFile.addDescription (os.str().c_str());
     }
@@ -1967,7 +1965,7 @@ ImageFileView::OnPlotHistogram (wxCommandEvent& event)
 
       PlotFile& rPlotFile = pPlotDoc->getPlotFile();
       std::ostringstream os;
-      os << "Histogram";
+      os << "Histogram ";
       std::string title("title ");
       title += os.str();
       rPlotFile.addEzsetCommand (title.c_str());
@@ -1984,7 +1982,7 @@ ImageFileView::OnPlotHistogram (wxCommandEvent& event)
         os << ": " << rIF.labelGet(iL).getLabelString();
         rPlotFile.addDescription (os.str().c_str());
       }
-      os << "  plot of " << dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str();
+      os << " Plot of " << wxConvUTF8.cWX2MB(dynamic_cast<wxFrame*>(GetDocument()->GetFirstView()->GetFrame())->GetTitle().c_str());
       *theApp->getLog() << wxConvUTF8.cMB2WX(os.str().c_str()) << _T("\n");
       rPlotFile.addDescription (os.str().c_str());
       delete pX;
@@ -2145,18 +2143,18 @@ PhantomFileView::OnProjections (wxCommandEvent& event)
   }
 
   std::ostringstream os;
-  os << "Projections for " << rPhantom.name()
-        << ": nDet=" << m_iDefaultNDet
-    << ", nView=" << m_iDefaultNView
-        << ", gantry offset=" << m_iDefaultOffsetView
-        << ", nSamples=" << m_iDefaultNSample
-    << ", RotAngle=" << m_dDefaultRotation
-        << ", FocalLengthRatio=" << m_dDefaultFocalLength
-    << ", CenterDetectorLengthRatio=" << m_dDefaultCenterDetectorLength
-    << ", ViewRatio=" << m_dDefaultViewRatio
-        << ", ScanRatio=" << m_dDefaultScanRatio
-    << ", Geometry=" << sGeometry.c_str()
-        << ", FanBeamAngle=" << convertRadiansToDegrees (theScanner.fanBeamAngle());
+  os << "Projections for " << rPhantom.name().c_str()
+     << ": nDet=" << m_iDefaultNDet
+     << ", nView=" << m_iDefaultNView
+     << ", gantry offset=" << m_iDefaultOffsetView
+     << ", nSamples=" << m_iDefaultNSample
+     << ", RotAngle=" << m_dDefaultRotation
+     << ", FocalLengthRatio=" << m_dDefaultFocalLength
+     << ", CenterDetectorLengthRatio=" << m_dDefaultCenterDetectorLength
+     << ", ViewRatio=" << m_dDefaultViewRatio
+     << ", ScanRatio=" << m_dDefaultScanRatio
+     << ", Geometry=" << sGeometry.mb_str(wxConvUTF8)
+     << ", FanBeamAngle=" << convertRadiansToDegrees (theScanner.fanBeamAngle());
 
   Timer timer;
   Projections* pProj = NULL;
@@ -2309,8 +2307,9 @@ PhantomFileView::OnRasterize (wxCommandEvent& event)
 PhantomCanvas*
 PhantomFileView::CreateCanvas (wxFrame *parent)
 {
-  PhantomCanvas* pCanvas = new PhantomCanvas (this, parent, wxPoint(-1,-1),
-                                              wxSize(-1,-1), 0);
+  PhantomCanvas* pCanvas =
+    new PhantomCanvas (this, parent, wxPoint(-1,-1),
+                       wxSize(-1,-1), wxFULL_REPAINT_ON_RESIZE);
   pCanvas->SetBackgroundColour(*wxWHITE);
   pCanvas->ClearBackground();
 
@@ -3391,7 +3390,8 @@ PlotFileView::CreateCanvas (wxFrame* parent)
 {
   PlotFileCanvas* pCanvas;
 
-  pCanvas = new PlotFileCanvas (this, parent, wxPoint(-1,-1), wxSize(-1,-1), 0);
+  pCanvas = new PlotFileCanvas (this, parent, wxPoint(-1,-1), wxSize(-1,-1),
+                                wxFULL_REPAINT_ON_RESIZE);
   pCanvas->SetBackgroundColour(*wxWHITE);
   pCanvas->ClearBackground();