r418: no message
[ctsim.git] / src / views.cpp
index 85860d0dcd991d2867106a281b5c1c055a6b9e23..393e5f4f37fa1f046b03141a95866cccd5f91739 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: views.cpp,v 1.59 2001/01/12 16:41:56 kevin Exp $
+**  $Id: views.cpp,v 1.66 2001/01/18 21:30:22 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
@@ -765,17 +765,18 @@ wxFrame*
 ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view)
 {
 #if CTSIM_MDI
-  wxMDIChildFrame *subframe = new wxMDIChildFrame(theApp->getMainFrame(), -1, "ImageFile Frame", wxPoint(-1, -1), wxSize(0, 0), wxDEFAULT_FRAME_STYLE);
+  wxMDIChildFrame *subframe = new wxMDIChildFrame (theApp->getMainFrame(), -1, "ImageFile Frame", wxPoint(-1, -1), 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(-1, -1), wxSize(0, 0), wxDEFAULT_FRAME_STYLE);
 #endif
-  
+  theApp->setIconForFrame (subframe);
+
   wxMenu *file_menu = new wxMenu;
   
-  file_menu->Append(MAINMENU_FILE_CREATE_PHANTOM, "Cr&eate Phantom...");
-  file_menu->Append(MAINMENU_FILE_CREATE_FILTER, "Create &Filter...");
-  file_menu->Append(wxID_OPEN, "&Open...");
-  file_menu->Append(wxID_SAVE, "&Save");
+  file_menu->Append(MAINMENU_FILE_CREATE_PHANTOM, "Cr&eate Phantom...\tCtrl-P");
+  file_menu->Append(MAINMENU_FILE_CREATE_FILTER, "Create &Filter...\tCtrl-F");
+  file_menu->Append(wxID_OPEN, "&Open...\tCtrl-O");
+  file_menu->Append(wxID_SAVE, "&Save\tCtrl-S");
   file_menu->Append(wxID_SAVEAS, "Save &As...");
   file_menu->Append(wxID_CLOSE, "&Close");
   
@@ -789,9 +790,9 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view)
   file_menu->Append(wxID_PREVIEW, "Print Pre&view");
   
   wxMenu *view_menu = new wxMenu;
-  view_menu->Append(IFMENU_VIEW_SCALE_MINMAX, "Display Scale &Set...");
-  view_menu->Append(IFMENU_VIEW_SCALE_AUTO, "Display Scale &Auto...");
-  view_menu->Append(IFMENU_VIEW_SCALE_FULL, "Display &Full Scale");
+  view_menu->Append(IFMENU_VIEW_SCALE_MINMAX, "Display Scale S&et...\tCtrl-E");
+  view_menu->Append(IFMENU_VIEW_SCALE_AUTO, "Display Scale &Auto...\tCtrl-A");
+  view_menu->Append(IFMENU_VIEW_SCALE_FULL, "Display F&ull Scale\tCtrl-U");
   
   wxMenu* filter_menu = new wxMenu;
   filter_menu->Append (IFMENU_FILTER_INVERTVALUES, "&Invert Values");
@@ -839,6 +840,8 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view)
   analyze_menu->Append (IFMENU_COMPARE_COL, "Compare &Column");
   
   wxMenu *help_menu = new wxMenu;
+  help_menu->Append(MAINMENU_HELP_CONTENTS, "&Contents\tF1");
+  help_menu->Append(MAINMENU_HELP_TOPICS, "&Topics\tCtrl-T");
   help_menu->Append(MAINMENU_HELP_ABOUT, "&About");
   
   wxMenuBar *menu_bar = new wxMenuBar;
@@ -854,6 +857,19 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view)
   
   subframe->Centre(wxBOTH);
   
+  wxAcceleratorEntry accelEntries[9];
+  accelEntries[0].Set (wxACCEL_CTRL, static_cast<int>('O'), wxID_OPEN);
+  accelEntries[1].Set (wxACCEL_CTRL, static_cast<int>('S'), wxID_SAVE);
+  accelEntries[2].Set (wxACCEL_CTRL, static_cast<int>('T'), MAINMENU_HELP_TOPICS);
+  accelEntries[3].Set (wxACCEL_CTRL, static_cast<int>('P'), MAINMENU_FILE_CREATE_PHANTOM);
+  accelEntries[4].Set (wxACCEL_CTRL, static_cast<int>('F'), MAINMENU_FILE_CREATE_FILTER);
+  accelEntries[5].Set (wxACCEL_NORMAL, WXK_F1, MAINMENU_HELP_CONTENTS);
+  accelEntries[6].Set (wxACCEL_CTRL, static_cast<int>('A'), IFMENU_VIEW_SCALE_AUTO);
+  accelEntries[7].Set (wxACCEL_CTRL, static_cast<int>('U'), IFMENU_VIEW_SCALE_FULL);
+  accelEntries[8].Set (wxACCEL_CTRL, static_cast<int>('E'), IFMENU_VIEW_SCALE_MINMAX);
+  wxAcceleratorTable accelTable (9, accelEntries);
+  subframe->SetAcceleratorTable (accelTable);
+
   return subframe;
 }
 
@@ -1868,6 +1884,7 @@ PhantomView::CreateChildFrame(wxDocument *doc, wxView *view)
 #else
   wxDocChildFrame *subframe = new wxDocChildFrame(doc, view, theApp->getMainFrame(), -1, "Phantom Frame", wxPoint(10, 10), wxSize(256, 256), wxDEFAULT_FRAME_STYLE);
 #endif
+  theApp->setIconForFrame (subframe);
 
   wxMenu *file_menu = new wxMenu;
   
@@ -1891,6 +1908,7 @@ PhantomView::CreateChildFrame(wxDocument *doc, wxView *view)
   
   wxMenu *help_menu = new wxMenu;
   help_menu->Append(MAINMENU_HELP_CONTENTS, "&Contents");
+  help_menu->Append(MAINMENU_HELP_TOPICS, "&Topics");
   help_menu->Append(MAINMENU_HELP_ABOUT, "&About");
   
   wxMenuBar *menu_bar = new wxMenuBar;
@@ -2009,7 +2027,7 @@ ProjectionFileView::ProjectionFileView(void)
   m_dDefaultFilterParam = 1.;
 #if HAVE_FFTW
   m_iDefaultFilterMethod = ProcessSignal::FILTER_METHOD_RFFTW;
-  m_iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT;
+  m_iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_INVERSE_FOURIER;
 #else
   m_iDefaultFilterMethod = ProcessSignal::FILTER_METHOD_CONVOLUTION;
   m_iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT;
@@ -2147,13 +2165,6 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event)
       const Projections& rProj = GetDocument()->getProjections();
       imageFile.setArraySize (m_iDefaultNX, m_iDefaultNY);
       
-      if (m_iDefaultFilterMethod != ProcessSignal::FILTER_METHOD_CONVOLUTION && 
-                 m_iDefaultFilterGeneration == ProcessSignal::FILTER_GENERATION_INVERSE_FOURIER && 
-                 rProj.geometry() == Scanner::GEOMETRY_EQUIANGULAR) {
-        wxMessageBox ("Sorry!\nCurrently, frequency-based filtering with inverse_fourier filter generation is not supported equiangular geometry.\nAborting command.", "Not Supported", wxOK | wxICON_WARNING, m_frame);
-     //   return;
-      }
-
       Reconstructor* pReconstruct = new Reconstructor (rProj, imageFile, optFilterName.c_str(), m_dDefaultFilterParam, optFilterMethodName.c_str(), m_iDefaultZeropad, optFilterGenerationName.c_str(), optInterpName.c_str(), m_iDefaultInterpParam, optBackprojectName.c_str(), m_iDefaultTrace);
 
       Timer timerRecon;
@@ -2230,6 +2241,7 @@ ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view)
 #else
   wxDocChildFrame *subframe = new wxDocChildFrame(doc, view, theApp->getMainFrame(), -1, "Projection Frame", wxPoint(10, 10), wxSize(0, 0), wxDEFAULT_FRAME_STYLE);
 #endif
+  theApp->setIconForFrame (subframe);
 
   wxMenu *file_menu = new wxMenu;
   
@@ -2258,7 +2270,7 @@ ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view)
 
   wxMenu *help_menu = new wxMenu;
   help_menu->Append(MAINMENU_HELP_CONTENTS, "&Contents");
-  help_menu->AppendSeparator();
+  help_menu->Append(MAINMENU_HELP_TOPICS, "&Topics");
   help_menu->Append(MAINMENU_HELP_ABOUT, "&About");
   
   wxMenuBar *menu_bar = new wxMenuBar;
@@ -2518,6 +2530,7 @@ PlotFileView::CreateChildFrame(wxDocument *doc, wxView *view)
 #else
   wxDocChildFrame *subframe = new wxDocChildFrame(doc, view, theApp->getMainFrame(), -1, "Plot Frame", wxPoint(10, 10), wxSize(500, 300), wxDEFAULT_FRAME_STYLE);
 #endif
+  theApp->setIconForFrame (subframe);
 
   wxMenu *file_menu = new wxMenu;
   
@@ -2543,7 +2556,7 @@ PlotFileView::CreateChildFrame(wxDocument *doc, wxView *view)
   
   wxMenu *help_menu = new wxMenu;
   help_menu->Append(MAINMENU_HELP_CONTENTS, "&Contents");
-  help_menu->AppendSeparator();
+  help_menu->Append(MAINMENU_HELP_TOPICS, "&Topics");
   help_menu->Append(MAINMENU_HELP_ABOUT, "&About");
   
   wxMenuBar *menu_bar = new wxMenuBar;