From 67e0b59f7b40b2c2f1d0587b24b4ecf4881b3824 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sun, 2 Jun 2002 17:57:02 +0000 Subject: [PATCH] r2098: *** empty log message *** --- ChangeLog | 5 +++ debian/changelog | 9 +++-- src/ctsim.cpp | 15 +++++--- src/docs.cpp | 5 ++- src/views.cpp | 92 ++++++++++++++++++++++++------------------------ 5 files changed, 70 insertions(+), 56 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4438c4a..87c102d 100644 --- 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 diff --git a/debian/changelog b/debian/changelog index 5d695d8..a8bdd18 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,14 @@ +ctsim (3.5.3-2) unstable; urgency=low + + * New upstream version + + -- Kevin Rosenberg 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) diff --git a/src/ctsim.cpp b/src/ctsim.cpp index 2dbdec7..afdc4b3 100644 --- a/src/ctsim.cpp +++ b/src/ctsim.cpp @@ -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); diff --git a/src/docs.cpp b/src/docs.cpp index 47ca4dc..5a73fe8 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.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; diff --git a/src/views.cpp b/src/views.cpp index 1b54cbb..6f62220 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.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; } -- 2.34.1