]> icculus.org git repositories - taylor/freespace2.git/blob - src/helped/helped.cpp
modify gameseq such that we can process an event with an unset state
[taylor/freespace2.git] / src / helped / helped.cpp
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell 
5  * or otherwise commercially exploit the source or things you created based on
6  * the source.
7  */
8
9 // HelpEd.cpp : Defines the class behaviors for the application.
10 //
11
12 #include "stdafx.h"
13 #include "helped.h"
14
15 #include "mainfrm.h"
16 #include "helpeddoc.h"
17 #include "helpedview.h"
18
19 #ifdef _DEBUG
20 #define new DEBUG_NEW
21 #undef THIS_FILE
22 static char THIS_FILE[] = __FILE__;
23 #endif
24
25 /////////////////////////////////////////////////////////////////////////////
26 // CHelpEdApp
27
28 BEGIN_MESSAGE_MAP(CHelpEdApp, CWinApp)
29         //{{AFX_MSG_MAP(CHelpEdApp)
30         ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
31                 // NOTE - the ClassWizard will add and remove mapping macros here.
32                 //    DO NOT EDIT what you see in these blocks of generated code!
33         //}}AFX_MSG_MAP
34         // Standard file based document commands
35         ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
36         ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
37 END_MESSAGE_MAP()
38
39 /////////////////////////////////////////////////////////////////////////////
40 // CHelpEdApp construction
41
42 CHelpEdApp::CHelpEdApp()
43 {
44         // TODO: add construction code here,
45         // Place all significant initialization in InitInstance
46 }
47
48 /////////////////////////////////////////////////////////////////////////////
49 // The one and only CHelpEdApp object
50
51 CHelpEdApp theApp;
52
53 /////////////////////////////////////////////////////////////////////////////
54 // CHelpEdApp initialization
55
56 BOOL CHelpEdApp::InitInstance()
57 {
58         // Standard initialization
59         // If you are not using these features and wish to reduce the size
60         //  of your final executable, you should remove from the following
61         //  the specific initialization routines you do not need.
62
63 #ifdef _AFXDLL
64         Enable3dControls();                     // Call this when using MFC in a shared DLL
65 #else
66         Enable3dControlsStatic();       // Call this when linking to MFC statically
67 #endif
68
69         // Change the registry key under which our settings are stored.
70         // TODO: You should modify this string to be something appropriate
71         // such as the name of your company or organization.
72         SetRegistryKey(_T("Local AppWizard-Generated Applications"));
73
74         LoadStdProfileSettings();  // Load standard INI file options (including MRU)
75
76         // Register the application's document templates.  Document templates
77         //  serve as the connection between documents, frame windows and views.
78
79         CSingleDocTemplate* pDocTemplate;
80         pDocTemplate = new CSingleDocTemplate(
81                 IDR_MAINFRAME,
82                 RUNTIME_CLASS(CHelpEdDoc),
83                 RUNTIME_CLASS(CMainFrame),       // main SDI frame window
84                 RUNTIME_CLASS(CHelpEdView));
85         AddDocTemplate(pDocTemplate);
86
87         // Enable DDE Execute open
88         EnableShellOpen();
89         RegisterShellFileTypes(TRUE);
90
91         // Parse command line for standard shell commands, DDE, file open
92         CCommandLineInfo cmdInfo;
93         ParseCommandLine(cmdInfo);
94
95         // Dispatch commands specified on the command line
96         if (!ProcessShellCommand(cmdInfo))
97                 return FALSE;
98
99         // The one and only window has been initialized, so show and update it.
100         m_pMainWnd->ShowWindow(SW_SHOW);
101         m_pMainWnd->UpdateWindow();
102
103         // Enable drag/drop open
104         m_pMainWnd->DragAcceptFiles();
105
106         return TRUE;
107 }
108
109
110 /////////////////////////////////////////////////////////////////////////////
111 // CAboutDlg dialog used for App About
112
113 class CAboutDlg : public CDialog
114 {
115 public:
116         CAboutDlg();
117
118 // Dialog Data
119         //{{AFX_DATA(CAboutDlg)
120         enum { IDD = IDD_ABOUTBOX };
121         //}}AFX_DATA
122
123         // ClassWizard generated virtual function overrides
124         //{{AFX_VIRTUAL(CAboutDlg)
125         protected:
126         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
127         //}}AFX_VIRTUAL
128
129 // Implementation
130 protected:
131         //{{AFX_MSG(CAboutDlg)
132                 // No message handlers
133         //}}AFX_MSG
134         DECLARE_MESSAGE_MAP()
135 };
136
137 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
138 {
139         //{{AFX_DATA_INIT(CAboutDlg)
140         //}}AFX_DATA_INIT
141 }
142
143 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
144 {
145         CDialog::DoDataExchange(pDX);
146         //{{AFX_DATA_MAP(CAboutDlg)
147         //}}AFX_DATA_MAP
148 }
149
150 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
151         //{{AFX_MSG_MAP(CAboutDlg)
152                 // No message handlers
153         //}}AFX_MSG_MAP
154 END_MESSAGE_MAP()
155
156 // App command to run the dialog
157 void CHelpEdApp::OnAppAbout()
158 {
159         CAboutDlg aboutDlg;
160         aboutDlg.DoModal();
161 }
162
163 /////////////////////////////////////////////////////////////////////////////
164 // CHelpEdApp message handlers
165