From a36e4b039279f96f7698a27f49ec1f99e18306a9 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Tue, 30 Apr 2002 03:37:12 +0000 Subject: [PATCH] r1835: fixed loss of frame with rastered phantom with wxGTK --- src/views.cpp | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/views.cpp b/src/views.cpp index 7ae2293..b7934f1 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.147 2001/09/27 02:11:29 kevin Exp $ +** $Id: views.cpp,v 1.148 2002/04/30 03:37:12 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 @@ -2225,14 +2225,15 @@ PhantomFileView::OnRasterize (wxCommandEvent& event) #endif { ImageFile* pImageFile = new ImageFile (m_iDefaultRasterNX, m_iDefaultRasterNY); + wxProgressDialog dlgProgress (wxString("Rasterize"), wxString("Rasterization Progress"), - pImageFile->nx() + 1, getFrameForChild(), wxPD_CAN_ABORT ); + pImageFile->nx() + 1, getFrameForChild(), wxPD_CAN_ABORT ); Timer timer; for (unsigned int i = 0; i < pImageFile->nx(); i++) { rPhantom.convertToImagefile (*pImageFile, m_dDefaultRasterViewRatio, m_iDefaultRasterNSamples, Trace::TRACE_NONE, i, 1, true); if (! dlgProgress.Update (i+1)) { - delete pImageFile; - return; + delete pImageFile; + return; } } @@ -2244,16 +2245,17 @@ PhantomFileView::OnRasterize (wxCommandEvent& event) pRasterDoc->setImageFile (pImageFile); if (theApp->getAskDeleteNewDocs()) pRasterDoc->Modify (true); - pRasterDoc->UpdateAllViews (this); - pRasterDoc->getView()->getFrame()->Show(true); *theApp->getLog() << os.str().c_str() << "\n"; pImageFile->labelAdd (os.str().c_str(), timer.timerEnd()); - ImageFileView* rasterView = pRasterDoc->getView(); - if (rasterView) { + + if (ImageFileView* rasterView = pRasterDoc->getView()) { + rasterView->getFrame()->Show(true); rasterView->getFrame()->SetFocus(); rasterView->OnUpdate (rasterView, NULL); } - pRasterDoc->Activate(); + // Causes loss of frame in wxGTK + // pRasterDoc->UpdateAllViews (this); + // pRasterDoc->Activate(); } } @@ -2457,7 +2459,7 @@ EVT_MENU(PJMENU_CONVERT_FFT_POLAR, ProjectionFileView::OnConvertFFTPolar) EVT_MENU(PJMENU_CONVERT_PARALLEL, ProjectionFileView::OnConvertParallel) EVT_MENU(PJMENU_PLOT_TTHETA_SAMPLING, ProjectionFileView::OnPlotTThetaSampling) EVT_MENU(PJMENU_PLOT_HISTOGRAM, ProjectionFileView::OnPlotHistogram) -EVT_MENU(PJMENU_ARTIFACT_REDUCTION, ProjectionFileView::OnArtifactReduction) + // EVT_MENU(PJMENU_ARTIFACT_REDUCTION, ProjectionFileView::OnArtifactReduction) END_EVENT_TABLE() @@ -2951,16 +2953,18 @@ ProjectionFileView::doReconstructFBP (const Projections& rProj, bool bRebinToPar pReconDoc->setImageFile (pImageFile); if (theApp->getAskDeleteNewDocs()) pReconDoc->Modify (true); - pReconDoc->UpdateAllViews (this); - pReconDoc->Activate(); - if (ImageFileView* rasterView = pReconDoc->getView()) { - rasterView->OnUpdate (rasterView, NULL); - rasterView->getFrame()->SetFocus(); - rasterView->getFrame()->Show(true); - } *theApp->getLog() << os.str().c_str() << "\n"; pImageFile->labelAdd (rProj.getLabel()); pImageFile->labelAdd (os.str().c_str(), timerRecon.timerEnd()); + + if (ImageFileView* rasterView = pReconDoc->getView()) { + rasterView->getFrame()->Show(true); + rasterView->getFrame()->SetFocus(); + rasterView->OnUpdate (rasterView, NULL); + } + // causes loss of frame in wxGTK + //pReconDoc->UpdateAllViews (this); + // pReconDoc->Activate(); } @@ -3033,8 +3037,8 @@ ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view) convert_menu->AppendSeparator(); convert_menu->Append (PJMENU_CONVERT_PARALLEL, "&Interpolate to Parallel"); - wxMenu* filter_menu = new wxMenu; - filter_menu->Append (PJMENU_ARTIFACT_REDUCTION, "&Artifact Reduction"); + // wxMenu* filter_menu = new wxMenu; + // filter_menu->Append (PJMENU_ARTIFACT_REDUCTION, "&Artifact Reduction"); wxMenu* analyze_menu = new wxMenu; analyze_menu->Append (PJMENU_PLOT_HISTOGRAM, "&Plot Histogram"); @@ -3055,7 +3059,7 @@ ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view) menu_bar->Append (m_pFileMenu, "&File"); menu_bar->Append (convert_menu, "&Convert"); - menu_bar->Append (filter_menu, "Fi<er"); + // menu_bar->Append (filter_menu, "Fi<er"); menu_bar->Append (analyze_menu, "&Analyze"); menu_bar->Append (reconstruct_menu, "&Reconstruct"); menu_bar->Append (help_menu, "&Help"); -- 2.34.1