1 /*****************************************************************************
5 ** Purpose: Top-level routines for CTSim program
6 ** Programmer: Kevin Rosenberg
7 ** Date Started: July 2000
9 ** This is part of the CTSim program
10 ** Copyright (C) 1983-2000 Kevin Rosenberg
12 ** $Id: ctsim.h,v 1.28 2001/01/20 02:25:45 kevin Exp $
14 ** This program is free software; you can redistribute it and/or modify
15 ** it under the terms of the GNU General Public License (version 2) as
16 ** published by the Free Software Foundation.
18 ** This program is distributed in the hope that it will be useful,
19 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ** GNU General Public License for more details.
23 ** You should have received a copy of the GNU General Public License
24 ** along with this program; if not, write to the Free Software
25 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 ******************************************************************************/
39 // #define CTSIM_MDI 1
46 class ImageFileDocument;
54 #include "wx/docview.h"
55 #include "wx/textctrl.h"
58 #include "wx/html/helpctrl.h"
59 #include "dlgezplot.h"
62 #if defined(__WXMSW__)
63 #define CTSIM_WINHELP 1
66 // Define a new frame for main window
68 class MainFrame: public wxMDIParentFrame
70 class MainFrame: public wxDocParentFrame
73 DECLARE_CLASS(MainFrame)
76 wxMenu* m_pWindowMenu;
78 enum { MAX_WINDOW_MENUITEMS = 20 };
79 wxMenuItem* m_apWindowMenuItems[MAX_WINDOW_MENUITEMS];
80 wxDocument* m_apWindowMenuData[MAX_WINDOW_MENUITEMS];
82 int m_iDefaultPhantomID;
83 int m_iDefaultFilterID;
84 int m_iDefaultFilterDomainID;
85 unsigned int m_iDefaultFilterXSize;
86 unsigned int m_iDefaultFilterYSize;
87 double m_dDefaultFilterParam;
88 double m_dDefaultFilterBandwidth;
89 double m_dDefaultFilterInputScale;
90 double m_dDefaultFilterOutputScale;
93 wxWinHelpController m_winHelp;
95 wxHtmlHelpController m_htmlHelp;
98 MainFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long type);
101 wxWinHelpController& getWinHelpController()
104 wxHtmlHelpController& getHtmlHelpController()
105 { return m_htmlHelp; }
107 void showHelp (int commandID);
109 void OnAbout (wxCommandEvent& event);
110 void OnHelpTopics (wxCommandEvent& event);
111 void OnHelpContents (wxCommandEvent& event);
112 void OnCreatePhantom (wxCommandEvent& event);
114 #if defined(CTSIM_WINHELP) && (defined(DEBUG) || defined(_DEBUG))
115 void OnHelpSecondary (wxCommandEvent& event);
118 void OnCreateFilter (wxCommandEvent& event);
119 void OnExit (wxCommandEvent& event);
121 void OnUpdateUI (wxUpdateUIEvent& event);
126 void OnWindowMenu0 (wxCommandEvent& event);
127 void OnWindowMenu1 (wxCommandEvent& event);
128 void OnWindowMenu2 (wxCommandEvent& event);
129 void OnWindowMenu3 (wxCommandEvent& event);
130 void OnWindowMenu4 (wxCommandEvent& event);
131 void OnWindowMenu5 (wxCommandEvent& event);
132 void OnWindowMenu6 (wxCommandEvent& event);
133 void OnWindowMenu7 (wxCommandEvent& event);
134 void OnWindowMenu8 (wxCommandEvent& event);
135 void OnWindowMenu9 (wxCommandEvent& event);
136 void OnWindowMenu10 (wxCommandEvent& event);
137 void OnWindowMenu11 (wxCommandEvent& event);
138 void OnWindowMenu12 (wxCommandEvent& event);
139 void OnWindowMenu13 (wxCommandEvent& event);
140 void OnWindowMenu14 (wxCommandEvent& event);
141 void OnWindowMenu15 (wxCommandEvent& event);
142 void OnWindowMenu16 (wxCommandEvent& event);
143 void OnWindowMenu17 (wxCommandEvent& event);
144 void OnWindowMenu18 (wxCommandEvent& event);
145 void OnWindowMenu19 (wxCommandEvent& event);
147 void DoWindowMenu (int iMenuPosition, wxCommandEvent& event);
149 DECLARE_EVENT_TABLE()
154 class CTSimApp: public wxApp
160 MainFrame* getMainFrame() const
163 { return m_pFrame->getLog(); }
164 wxDocManager* getDocManager()
165 { return m_docManager; }
167 wxString getUntitledFilename();
169 EZPlotDialog* makeEZPlotDialog()
170 { return new EZPlotDialog (m_pFrame); }
172 void getCompatibleImages (const ImageFileDocument* pIFDoc, std::vector<ImageFileDocument*>& vecIF);
174 bool getSetModifyNewDocs() const
177 void setIconForFrame (wxFrame* pFrame);
180 wxDocManager* m_docManager;
183 void usage (const char* program);
185 static struct option ctsimOptions[];
187 enum { O_HELP, O_VERSION };
190 DECLARE_APP(CTSimApp)
192 extern class CTSimApp* theApp;
195 MAINMENU_WINDOW_BASE = 500,
196 MAINMENU_HELP_ABOUT = 600,
197 MAINMENU_HELP_CONTENTS,
198 MAINMENU_HELP_TOPICS,
199 MAINMENU_HELP_SECONDARY,
200 MAINMENU_FILE_CREATE_PHANTOM,
202 MAINMENU_FILE_CREATE_FILTER,
205 PJMENU_FILE_PROPERTIES,
206 PJMENU_RECONSTRUCT_FBP,
207 PJMENU_RECONSTRUCT_FOURIER,
208 PJMENU_CONVERT_POLAR,
209 PJMENU_CONVERT_FFT_POLAR,
212 IFMENU_FILE_PROPERTIES,
218 IFMENU_PLOT_HISTOGRAM,
220 IFMENU_VIEW_SCALE_AUTO,
221 IFMENU_VIEW_SCALE_MINMAX,
222 IFMENU_VIEW_SCALE_FULL,
224 IFMENU_COMPARE_IMAGES,
227 IFMENU_IMAGE_SCALESIZE,
229 IFMENU_IMAGE_SUBTRACT,
230 IFMENU_IMAGE_MULTIPLY,
233 IFMENU_FILTER_INVERTVALUES,
235 IFMENU_FILTER_SQUARE,
238 IFMENU_FILTER_FOURIER,
239 IFMENU_FILTER_INVERSE_FOURIER,
242 IFMENU_FILTER_FFT_ROWS,
243 IFMENU_FILTER_FFT_COLS,
244 IFMENU_FILTER_IFFT_ROWS,
245 IFMENU_FILTER_IFFT_COLS,
246 IFMENU_FILTER_MAGNITUDE,
248 IFMENU_FILTER_SHUFFLENATURALTOFOURIERORDER,
249 IFMENU_FILTER_SHUFFLEFOURIERTONATURALORDER,
251 PHMMENU_FILE_PROPERTIES,
252 PHMMENU_PROCESS_RASTERIZE,
253 PHMMENU_PROCESS_PROJECTIONS,
255 PLOTMENU_VIEW_SCALE_MINMAX,
256 PLOTMENU_VIEW_SCALE_AUTO,
257 PLOTMENU_VIEW_SCALE_FULL,