r2098: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 2 Jun 2002 17:57:02 +0000 (17:57 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 2 Jun 2002 17:57:02 +0000 (17:57 +0000)
ChangeLog
debian/changelog
src/ctsim.cpp
src/docs.cpp
src/views.cpp

index 4438c4a9ae6dbdbeba6cf8bd34ece8bda670b782..87c102d7d0c500bbda8b63aa6a1c9b471281c71b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Jun 1, 2002  Version 3.5.4
+       * Print version number in log window with About command
+       * Work around problem with Enlightedment Window Manager
+       not showing captions on image and projection windows.
+       
 May 29, 2002  Version 3.5.3
        * Added support for g++ 3.04 compiler
        
index 5d695d8aaf3e299118c49a961b06745ae54cf3a6..a8bdd18ecc37448581b0a1188e1967de0eba8945 100644 (file)
@@ -1,9 +1,14 @@
+ctsim (3.5.3-2) unstable; urgency=low
+
+  * New upstream version
+
+ -- Kevin Rosenberg <kevin@pal.med-info.com>  Sun,  2 Jun 2002 11:56:32 -0600
+
 ctsim (3.5.3-1) unstable; urgency=low
 
   * Split online help into ctsim-help package
 
-  * Split pdf and html documentation into ctsim-doc and ctsim-doc-pdf
-  packages
+  * Split pdf and html documentation into ctsim-doc package
 
   * Added X-windows menu (Thanks Andreas Tille)
   
index 2dbdec7cd51b8f90a0f6fc6c5338de0f4a46fd03..afdc4b354c273190b77ee57bd9dffb4e1ac6b3c9 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: ctsim.cpp,v 1.111 2002/05/08 08:55:45 kevin Exp $
+**  $Id: ctsim.cpp,v 1.112 2002/06/02 17:57:02 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.111 2002/05/08 08:55:45 kevin Exp $";
+static const char* rcsindent = "$Id: ctsim.cpp,v 1.112 2002/06/02 17:57:02 kevin Exp $";
 
 struct option CTSimApp::ctsimOptions[] = 
 {
@@ -1026,11 +1026,16 @@ MainFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
   *theApp->getLog() << ", Build Date: " << __TIMESTAMP__;
 #endif
 #if defined(DEBUG)
-  *theApp->getLog() << ", CTSim Debug version";
+  *theApp->getLog() << ", CTSim Debug version" << "\n";
 #else
-  *theApp->getLog() << ", CTSim Release version";
+  *theApp->getLog() << ", CTSim Release version" << "\n";
+#endif
+#ifdef CTSIMVERSION
+  *theApp->getLog() << "Version ";
+  *theApp->getLog() << CTSIMVERSION;
+#elif defined(VERSION)
+    *theApp->getLog() << "Version: " <<  VERSION;
 #endif
-
   *theApp->getLog() << "\n";
   
   wxBitmap bmp (splash);
index 47ca4dcb160a706aeac56bff77626ffbf765dc00..5a73fe819f39ed0c337e040d64e0aeaf8b4c5b83 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: docs.cpp,v 1.38 2002/05/03 00:40:30 kevin Exp $
+**  $Id: docs.cpp,v 1.39 2002/06/02 17:57:02 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
@@ -79,8 +79,8 @@ bool ImageFileDocument::OnOpenDocument(const wxString& filename)
     *theApp->getLog() << "Read image file " << filename << "\n";
   SetFilename(filename, true);  
   Modify(false);
-  UpdateAllViews();
   getView()->setInitialClientSize();
+  UpdateAllViews();
   m_bBadFileOpen = false;
 
   return true;
@@ -293,7 +293,6 @@ PhantomFileDocument::OnOpenDocument(const wxString& filename)
   m_idPhantom = m_phantom.id();
   Modify(false);
   UpdateAllViews();
-  //GetFirstView()->OnUpdate (GetFirstView(), NULL);
   m_bBadFileOpen = false;
   
   return true;
index 1b54cbb93ef99314a0e0780fa7b42e552ebc6ca6..6f6222086c7bf72adb8cabdf0391656dcb8cedc9 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: views.cpp,v 1.156 2002/05/30 17:02:32 kevin Exp $
+**  $Id: views.cpp,v 1.157 2002/06/02 17:57:02 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
@@ -75,9 +75,7 @@ ImageFileCanvas::ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoin
 }
 
 ImageFileCanvas::~ImageFileCanvas()
-{
-  m_pView = NULL;
-}
+{}
 
 void 
 ImageFileCanvas::OnDraw(wxDC& dc)
@@ -192,11 +190,26 @@ ImageFileCanvas::OnChar (wxKeyEvent& event)
 wxSize
 ImageFileCanvas::GetBestSize() const
 {
-  if (! m_pView)
-    return wxSize(0,0);
+  const int iMinX = 50;
+  const int iMinY = 20;
+  wxSize bestSize (iMinX,iMinY);
+
+  if (m_pView) {
+    const ImageFile& rIF = m_pView->GetDocument()->getImageFile();
+    bestSize.Set  (rIF.nx(), rIF.ny());
+  }
+
+  if (bestSize.x > 800)
+    bestSize.x = 800;
+  if (bestSize.y > 800)
+    bestSize.y = 800;
   
-  const ImageFile& rIF = m_pView->GetDocument()->getImageFile();
-  return wxSize (rIF.nx(), rIF.ny());
+  if (bestSize.y < iMinY)
+    bestSize.y = iMinY;
+  if (bestSize.x < iMinX)
+    bestSize.x = iMinX;
+  
+  return bestSize;
 }
 
 
@@ -854,13 +867,8 @@ ImageFileView::OnImaginary (wxCommandEvent& event)
 ImageFileCanvas* 
 ImageFileView::CreateCanvas (wxFrame* parent)
 {
-  ImageFileCanvas* pCanvas;
-  int width, height;
-  parent->GetClientSize(&width, &height);
-  
-  pCanvas = new ImageFileCanvas (this, parent, wxPoint(0, 0), wxSize(width, height), 0);
-  
-  pCanvas->SetScrollbars(20, 20, 50, 50);
+  ImageFileCanvas* pCanvas = new ImageFileCanvas (this, parent, wxPoint(0, 0), 
+                                                 wxSize(0,0), 0);
   pCanvas->SetBackgroundColour(*wxWHITE);
   pCanvas->Clear();
   
@@ -875,12 +883,12 @@ wxDocChildFrame*
 ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view)
 {
 #if CTSIM_MDI
-  wxDocMDIChildFrame* subframe = new wxDocMDIChildFrame (doc, view, theApp->getMainFrame(), -1, "ImageFile Frame", wxPoint(-1, -1), wxSize(0, 0), wxDEFAULT_FRAME_STYLE);
+  wxDocMDIChildFrame* subframe = new wxDocMDIChildFrame (doc, view, theApp->getMainFrame(), -1, "ImageFile Frame", wxPoint(10,10), wxSize(0, 0), wxDEFAULT_FRAME_STYLE);
 #else
-  wxDocChildFrame* subframe = new wxDocChildFrame (doc, view, theApp->getMainFrame(), -1, "ImageFile Frame", wxPoint(-1, -1), wxSize(0, 0), wxDEFAULT_FRAME_STYLE);
+  wxDocChildFrame* subframe = new wxDocChildFrame (doc, view, theApp->getMainFrame(), -1, "ImageFile Frame", wxPoint(10, 10), wxSize(0, 0), wxDEFAULT_FRAME_STYLE);
 #endif
   theApp->setIconForFrame (subframe);
-  
+
   m_pFileMenu = new wxMenu;
   m_pFileMenu->Append(MAINMENU_FILE_CREATE_PHANTOM, "Cr&eate Phantom...\tCtrl-P");
   m_pFileMenu->Append(MAINMENU_FILE_CREATE_FILTER, "Create &Filter...\tCtrl-F");
@@ -1022,23 +1030,19 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view)
 bool 
 ImageFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) )
 {
-  m_pFrame = CreateChildFrame(doc, this);
-  
   m_bMinSpecified = false;
   m_bMaxSpecified = false;
   m_dAutoScaleFactor = 1.;
   
-  //  int width, height;
-  //  m_pFrame->GetClientSize (&width, &height);
-  m_pFrame->SetTitle("ImageFileView");
+  m_pFrame = CreateChildFrame(doc, this);
+  SetFrame (m_pFrame);
   m_pCanvas = CreateCanvas (m_pFrame);
-  
-  //  int x, y;  // X requires a forced resize
-  //  m_pFrame->GetSize(&x, &y);
-  //  m_pFrame->SetSize(-1, -1, x, y);
-  m_pFrame->SetFocus();
+  m_pFrame->SetClientSize (m_pCanvas->GetBestSize());
+  m_pCanvas->SetClientSize (m_pCanvas->GetBestSize());
+  m_pFrame->SetTitle("ImageFileView");
+
   m_pFrame->Show(true);
-  //  Activate(true);
+  Activate(true);
   
   return true;
 }
@@ -1048,11 +1052,6 @@ ImageFileView::setInitialClientSize ()
 {
   if (m_pFrame && m_pCanvas) {
     wxSize bestSize = m_pCanvas->GetBestSize();
-
-    if (bestSize.x > 800)
-      bestSize.x = 800;
-    if (bestSize.y > 800)
-      bestSize.y = 800;
     
     m_pFrame->SetClientSize (bestSize);
     m_pFrame->Show (true);
@@ -1127,7 +1126,6 @@ ImageFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) )
 bool 
 ImageFileView::OnClose (bool deleteWindow)
 {
-  //GetDocumentManager()->ActivateView (this, false, true);
   if (! GetDocument() || ! GetDocument()->Close())
     return false;
   
@@ -1958,9 +1956,8 @@ ImageFileView::OnPlotHistogram (wxCommandEvent& event)
 // PhantomCanvas
 
 PhantomCanvas::PhantomCanvas (PhantomFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style)
-: wxScrolledWindow(frame, -1, pos, size, style)
+  : wxScrolledWindow(frame, -1, pos, size, style), m_pView(v)
 {
-  m_pView = v;
 }
 
 PhantomCanvas::~PhantomCanvas ()
@@ -2264,9 +2261,8 @@ PhantomFileView::OnRasterize (wxCommandEvent& event)
 PhantomCanvas* 
 PhantomFileView::CreateCanvas (wxFrame *parent)
 {
-  PhantomCanvas* pCanvas;
-  
-  pCanvas = new PhantomCanvas (this, parent, wxPoint(0, 0), wxSize(0,0), 0);
+  PhantomCanvas* pCanvas = new PhantomCanvas (this, parent, wxPoint(0, 0), 
+                                             wxSize(0,0), 0);
   pCanvas->SetBackgroundColour(*wxWHITE);
   pCanvas->Clear();
   
@@ -2368,7 +2364,6 @@ PhantomFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) )
 bool 
 PhantomFileView::OnClose (bool deleteWindow)
 {
-  //GetDocumentManager()->ActivateView (this, false, true);
   if (! GetDocument() || ! GetDocument()->Close())
     return false;
   
@@ -2428,16 +2423,21 @@ ProjectionFileCanvas::OnDraw(wxDC& dc)
 wxSize
 ProjectionFileCanvas::GetBestSize () const
 {
-  wxSize best (0, 0);
-  if (! m_pView)
-    return best;
+  const int iMinX = 50;
+  const int iMinY = 20;
+  wxSize bestSize (iMinX,iMinY);
 
   if (m_pView) {
     Projections& rProj = m_pView->GetDocument()->getProjections();
-    best.Set (rProj.nDet(), rProj.nView());
+    bestSize.Set (rProj.nDet(), rProj.nView());
   }
   
-  return best;
+  if (bestSize.y < iMinY)
+    bestSize.y = iMinY;
+  if (bestSize.x < iMinX)
+    bestSize.x = iMinX;
+
+  return bestSize;
 }