r148: *** 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.2 2000/07/15 08:36: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
33 // Define a new frame
34 class MainFrame: public wxDocParentFrame
35 {
36     DECLARE_CLASS(MainFrame)
37 private:
38     wxTextCtrl* m_pLog;
39
40 public:
41     MainFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long type);
42     
43     void OnAbout (wxCommandEvent& event);
44     void OnHelpContents (wxCommandEvent& event);
45     void OnCreatePhantom (wxCommandEvent& event);
46     void OnExit (wxCommandEvent& event);
47
48     wxTextCtrl* getLog() 
49         { return m_pLog; }
50
51     DECLARE_EVENT_TABLE()
52 };
53
54 class wxDocManager;
55 class CTSimApp: public wxApp
56 {
57 public:
58     CTSimApp(void);
59     bool OnInit(void);
60     int OnExit(void);
61     MainFrame* getMainFrame(void) const
62       { return m_pFrame; }
63     wxTextCtrl* getLog(void)
64       { return m_pFrame->getLog(); }
65     wxDocManager* getDocManager() 
66         { return m_docManager; }
67
68     wxString getUntitledFilename(void);
69
70 private:
71     wxDocManager* m_docManager;
72     MainFrame* m_pFrame;
73
74     void usage (const char* program);
75
76     static struct option ctsimOptions[];
77
78     enum { O_HELP };
79 };
80
81 DECLARE_APP(CTSimApp)
82
83 extern class CTSimApp* theApp;
84
85
86 enum {
87     MAINMENU_HELP_ABOUT = 500,
88     MAINMENU_HELP_CONTENTS,
89     MAINMENU_FILE_CREATE_PHANTOM,
90     MAINMENU_FILE_EXIT,
91     IFMENU_FILE_PROPERTIES,
92     PJMENU_FILE_PROPERTIES,
93     PHMMENU_FILE_PROPERTIES,
94     PJMENU_PROCESS_RECONSTRUCT,
95     IFMENU_VIEW_WINDOW_AUTO,
96     PHMMENU_PROCESS_RASTERIZE,
97     PHMMENU_PROCESS_PROJECTIONS,
98 };
99
100 #endif