r184: *** empty log message ***
[ctsim.git] / src / ctsim.h
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **   Name:          ctsim.cpp
5 **   Purpose:       Top-level routines for CTSim program
6 **   Programmer:    Kevin Rosenberg
7 **   Date Started:  July 2000
8 **
9 **  This is part of the CTSim program
10 **  Copyright (C) 1983-2000 Kevin Rosenberg
11 **
12 **  $Id: ctsim.h,v 1.5 2000/08/25 15:59:13 kevin Exp $
13 **
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.
17 **
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.
22 **
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 ******************************************************************************/
27
28 #ifndef __CTSIMH__
29 #define __CTSIMH__
30
31 #include "wx/docview.h"
32 #ifdef HAVE_CONFIG_H
33 #include "config.h"
34 #endif
35 #ifdef HAVE_DMALLOC
36 #include <dmalloc.h>
37 #endif
38
39 // Define a new frame
40 class MainFrame: public wxDocParentFrame
41 {
42     DECLARE_CLASS(MainFrame)
43 private:
44     wxTextCtrl* m_pLog;
45
46 public:
47     MainFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long type);
48     
49     void OnAbout (wxCommandEvent& event);
50     void OnHelpContents (wxCommandEvent& event);
51     void OnCreatePhantom (wxCommandEvent& event);
52     void OnExit (wxCommandEvent& event);
53
54     wxTextCtrl* getLog() 
55         { return m_pLog; }
56
57     DECLARE_EVENT_TABLE()
58 };
59
60 class wxDocManager;
61 class CTSimApp: public wxApp
62 {
63 public:
64     CTSimApp(void);
65     bool OnInit(void);
66     int OnExit(void);
67     MainFrame* getMainFrame(void) const
68       { return m_pFrame; }
69     wxTextCtrl* getLog(void)
70       { return m_pFrame->getLog(); }
71     wxDocManager* getDocManager() 
72         { return m_docManager; }
73
74     wxString getUntitledFilename(void);
75
76 private:
77     wxDocManager* m_docManager;
78     MainFrame* m_pFrame;
79
80     void usage (const char* program);
81
82     static struct option ctsimOptions[];
83
84     enum { O_HELP, O_VERSION };
85 };
86
87 DECLARE_APP(CTSimApp)
88
89 extern class CTSimApp* theApp;
90
91
92 enum {
93     MAINMENU_HELP_ABOUT = 500,
94     MAINMENU_HELP_CONTENTS,
95     MAINMENU_FILE_CREATE_PHANTOM,
96     MAINMENU_FILE_EXIT,
97     IFMENU_FILE_PROPERTIES,
98     PJMENU_FILE_PROPERTIES,
99     PHMMENU_FILE_PROPERTIES,
100     PJMENU_PROCESS_RECONSTRUCT,
101     IFMENU_VIEW_SCALE_AUTO,
102     IFMENU_VIEW_SCALE_MINMAX,
103     PHMMENU_PROCESS_RASTERIZE,
104     PHMMENU_PROCESS_PROJECTIONS,
105 };
106
107 #endif