1 #ifndef _FRMFRED2_H
2 #define _FRMFRED2_H
3 /*
4  * Created by Ian "Goober5000" Warfield and "z64555" for the FreeSpace2 Source
5  * Code Project.
6  *
7  * You may not sell or otherwise commercially exploit the source or things you
8  * create based on the source.
9  */
10 
11 /*
12  * Child Window closing procedure:
13  *  frmFRED2 contains a number of child windows that can edit the mission in real time (vs. changing some settings, and
14  * then clicking OK). These windows have a special way of being dismissed because of this, and can be quite confusing
15  * to understand. Here is a checklist of what happens when a child window closes:
16  *
17  *  1. The child window is closed, and its OnClose() handler is called.
18  *  2. The child window's OnClose() handler sends a message via OnChildClosed() to its parent window (frmFRED2) to say
19  *     that it is closing.
20  *  3. The parent window (frmFRED2) nullifies its internal pointer to the child.
21  *  4. The child window's destructor is called.
22  *
23  *  The reason for this madness is so that we can select the child window if it is already created, instead of creating
24  * a new child window every time. Future versions of wxFRED may have the ability to have multiple instances of an
25  * editor type (like 2 ships editors working on two different ships), in which case this housekeeping method should
26  * age well.
27  */
28 
29 // Child windows and dialogs:
30 #include "editors/frmshipseditor.h"
31 #include "editors/frmwingeditor.h"
32 #include "editors/dlgobjecteditor.h"
33 #include "editors/frmwaypointeditor.h"
34 #include "editors/dlgmissionobjectiveseditor.h"
35 #include "editors/dlgeventseditor.h"
36 #include "editors/frmteamloadouteditor.h"
37 #include "editors/dlgbackgroundeditor.h"
38 #include "editors/dlgreinforcementseditor.h"
39 #include "editors/dlgasteroidfieldeditor.h"
40 #include "editors/dlgmissionspecseditor.h"
41 #include "editors/frmbriefingeditor.h"
42 #include "editors/frmdebriefingeditor.h"
43 #include "editors/frmcommandbriefingeditor.h"
44 #include "editors/dlgfictionviewer.h"
45 #include "editors/dlgshieldsystemeditor.h"
46 #include "editors/dlgsetglobalshipflagseditor.h"
47 #include "editors/dlgvoiceactingmanager.h"
48 #include "editors/frmcampaigneditor.h"
49 
50 #include "misc/dlgmissionstats.h"
51 
52 #include "help/dlgaboutbox.h"
53 #include "help/dlgsexphelp.h"
54 
55 // RAD tool generated includes:
56 #include "base/wxfred_base.h"
57 
58 // Libs
59 #include <wx/wx.h>
60 
61 
62 class frmFRED2 : public fredBase::frmFRED
63 {
64 public:
65 	frmFRED2( const wxChar *title, int xpos, int ypos, int width, int height );
66 	~frmFRED2( void );
67 
68 	// member variables
69 	//wxFREDMission* the_Mission;
70 
71 protected:
72 	frmFRED2( void );
73 	frmFRED2( const frmFRED2 &otherFRED );
74 
75 	// Helpers.
76 	void SetFredTitle( void );
77 
78 	// Handlers for frmFRED events.
79 	//  The event table for frmFRED events (the base class) is tucked away in wxFRED_base and shouldn't be manually
80 	// modified.
81 		// Checks to see if the user has made any modifications since the last save, and prompts them if they would like to save their changes before closing.Called by File->Exit and the Close button.
82 	void OnClose( wxCloseEvent &event );
83 	void OnSize( wxSizeEvent &event );
84 
85 	void OnFileNew( wxCommandEvent &event );
86 	void OnFileOpen( wxCommandEvent &event );
87 	void OnFileSave( wxCommandEvent &event );
88 	void OnFileSaveAs( wxCommandEvent &event );
89 	void OnFileRevert( wxCommandEvent &event );
90 	void OnFileSaveFormatFs2Open( wxCommandEvent &event );
91 	void OnFileSaveFormatFs2Retail( wxCommandEvent &event );
92 	void OnFileImportFs1Mission( wxCommandEvent &event );
93 	void OnFileImportFs1WeaponLoadouts( wxCommandEvent &event );
94 	void OnFileRunFs2( wxCommandEvent &event );
95 	void OnFileRecentFiles( wxCommandEvent &event );
96 	void OnFileExit( wxCommandEvent &event );
97 	void OnEditUndo( wxCommandEvent &event );
98 	void OnEditDelete( wxCommandEvent &event );
99 	void OnEditDeleteWing( wxCommandEvent &event );
100 	void OnEditDisableUndo( wxCommandEvent &event );
101 
102 	void OnViewToolbar( wxCommandEvent &event );
103 	void OnViewStatusbar( wxCommandEvent &event );
104 	void OnViewDisplayFilterShowShips( wxCommandEvent &event );
105 	void OnViewDisplayFilterShowPlayerStarts( wxCommandEvent &event );
106 	void OnViewDisplayFilterShowWaypoints( wxCommandEvent &event );
107 	void OnViewDisplayFilterShowFriendly( wxCommandEvent &event );
108 	void OnViewDisplayFilterShowHostile( wxCommandEvent &event );
109 	void OnViewHideMarkedObjects( wxCommandEvent &event );
110 	void OnViewShowHiddenObjects( wxCommandEvent &event );
111 	void OnViewShowShipModels( wxCommandEvent &event );
112 	void OnViewShowOutlines( wxCommandEvent &event );
113 	void OnViewShowShipInfo( wxCommandEvent &event );
114 	void OnViewShowCoordinates( wxCommandEvent &event );
115 	void OnViewShowGridPositions( wxCommandEvent &event );
116 	void OnViewShowDistances( wxCommandEvent &event );
117 	void OnViewShowModelPaths( wxCommandEvent &event );
118 	void OnViewShowModelDockPoints( wxCommandEvent &event );
119 	void OnViewShowGrid( wxCommandEvent &event );
120 	void OnViewShowHorizon( wxCommandEvent &event );
121 	void OnViewDoubleFineGridlines( wxCommandEvent &event );
122 	void OnViewAntiAliasedGridlines( wxCommandEvent &event );
123 	void OnViewShow3DCompass( wxCommandEvent &event );
124 	void OnViewShowBackground( wxCommandEvent &event );
125 	void OnViewViewpointCamera( wxCommandEvent &event );
126 	void OnViewViewpointCurrentShip( wxCommandEvent &event );
127 	void OnViewSaveCameraPos( wxCommandEvent &event );
128 	void OnViewRestoreCameraPos( wxCommandEvent &event );
129 	void OnViewLightingFromSuns( wxCommandEvent &event );
130 
131 	void OnSpeedMovement( wxCommandEvent &event );
132 	void OnSpeedRotation( wxCommandEvent &event );
133 
134 	void OnEditorsShips( wxCommandEvent &event );
135 	void OnEditorsWings( wxCommandEvent &event );
136 	void OnEditorsObjects( wxCommandEvent &event );
137 	void OnEditorsWaypointPaths( wxCommandEvent &event );
138 	void OnEditorsMissionObjectives( wxCommandEvent &event );
139 	void OnEditorsEvents( wxCommandEvent &event );
140 	void OnEditorsTeamLoadout( wxCommandEvent &event );
141 	void OnEditorsBackground( wxCommandEvent &event );
142 	void OnEditorsReinforcements( wxCommandEvent &event );
143 	void OnEditorsAsteroidField( wxCommandEvent &event );
144 	void OnEditorsMissionSpecs( wxCommandEvent &event );
145 	void OnEditorsBriefing( wxCommandEvent &event );
146 	void OnEditorsDebriefing( wxCommandEvent &event );
147 	void OnEditorsFictionViewer( wxCommandEvent &event );
148 	void OnEditorsShieldSystem( wxCommandEvent &event );
149 	void OnEditorsCommandBriefing( wxCommandEvent &event );
150 	void OnEditorsSetGlobalShipFlags( wxCommandEvent &event );
151 	void OnEditorsVoiceActingManager( wxCommandEvent &event );
152 	void OnEditorsCampaign( wxCommandEvent &event );
153 
154 	void OnGroupsGroup( wxCommandEvent &event );
155 	void OnGroupsSetGroup( wxCommandEvent &event );
156 
157 	void OnMiscLevelObject( wxCommandEvent &event );
158 	void OnMiscAlignObject( wxCommandEvent &event );
159 	void OnMiscMarkWing( wxCommandEvent &event );
160 	void OnMiscControlObject( wxCommandEvent &event );
161 	void OnMiscNextObject( wxCommandEvent &event );
162 	void OnMiscPreviousObject( wxCommandEvent &event );
163 	void OnMiscAdjustGrid( wxCommandEvent &event );
164 	void OnMiscNextSubsystem( wxCommandEvent &event );
165 	void OnMiscPrevSubsystem( wxCommandEvent &event );
166 	void OnMiscCancelSubsystem( wxCommandEvent &event );
167 	void OnMiscMissionStatistics( wxCommandEvent &event );
168 	void OnMiscErrorChecker( wxCommandEvent &event );
169 
170 	void OnHelpHelpTopics( wxCommandEvent &event );
171 	void OnHelpAbout( wxCommandEvent &event );
172 	void OnHelpShowSexpHelp( wxCommandEvent &event );
173 
174 	// Handlers for child dialogs & frames
175 	bool ChildIsOpen( const wxWindowID child_id );
176 	void OnChildClosed( wxWindow *child );
177 
178 	// Child windows and dialogs
179 	friend class frmShipsEditor;
180 	friend class frmWingEditor;
181 	friend class dlgObjectEditor;
182 	friend class frmWaypointEditor;
183 	friend class dlgMissionObjectivesEditor;
184 	friend class dlgEventsEditor;
185 	friend class frmTeamLoadoutEditor;
186 	friend class dlgBackgroundEditor;
187 	friend class dlgReinforcementsEditor;
188 	friend class dlgAsteroidFieldEditor;
189 	friend class dlgMissionSpecsEditor;
190 	friend class frmBriefingEditor;
191 	friend class frmDebriefingEditor;
192 	friend class frmCommandBriefingEditor;
193 	friend class dlgFictionViewer;
194 	friend class dlgShieldSystemEditor;
195 	friend class dlgSetGlobalShipFlagsEditor;
196 	friend class dlgVoiceActingManager;
197 	friend class frmCampaignEditor;
198 	friend class dlgMissionStats;
199 	friend class dlgAboutBox;
200 	friend class dlgSexpHelp;
201 
202 	enum FREDWindowID
203 	{
204 		// Tools
205 		ID_TOOL_NEWOBJECTLIST = 2000,
206 
207 		// Editors
208 		ID_frmShipsEditor,
209 		ID_frmWingEditor,
210 		ID_dlgObjectEditor,
211 		ID_frmWaypointEditor,
212 		ID_dlgMissionObjectivesEditor,
213 		ID_dlgEventsEditor,
214 		ID_frmTeamLoadoutEditor,
215 		ID_dlgBackgroundEditor,
216 		ID_dlgReinforcementsEditor,
217 		ID_dlgAsteroidFieldEditor,
218 		ID_dlgMissionSpecsEditor,
219 		ID_frmBriefingEditor,
220 		ID_frmDebriefingEditor,
221 		ID_frmCommandBriefingEditor,
222 		ID_dlgFictionViewer,
223 		ID_dlgShieldSystemEditor,
224 		ID_dlgSetGlobalShipFlagsEditor,
225 		ID_dlgVoiceActingManager,
226 		ID_frmCampaignEditor,
227 
228 		// Misc.
229 		ID_dlgMissionStats,
230 
231 		// Help frames and dialogs
232 		ID_dlgAboutBox,
233 		ID_dlgSexpHelp
234 	};
235 
236 private:
237 //	void InitMods();
238 	// Widgets
239 	wxChoice* cbNewObject;
240 	wxStatusBar* sbFRED;
241 
242 	// Frames and Dialogs
243 	frmShipsEditor* frmShipsEditor_p;
244 	frmWingEditor* frmWingEditor_p;
245 	dlgObjectEditor* dlgObjectEditor_p;
246 	frmWaypointEditor* frmWaypointEditor_p;
247 	dlgMissionObjectivesEditor* dlgMissionObjectivesEditor_p;
248 	dlgEventsEditor* dlgEventsEditor_p;
249 	frmTeamLoadoutEditor* frmTeamLoadoutEditor_p;
250 	dlgBackgroundEditor* dlgBackgroundEditor_p;
251 	dlgReinforcementsEditor* dlgReinforcementsEditor_p;
252 	dlgAsteroidFieldEditor* dlgAsteroidFieldEditor_p;
253 	dlgMissionSpecsEditor* dlgMissionSpecsEditor_p;
254 	frmBriefingEditor* frmBriefingEditor_p;
255 	frmDebriefingEditor* frmDebriefingEditor_p;
256 	frmCommandBriefingEditor* frmCommandBriefingEditor_p;
257 	dlgFictionViewer* dlgFictionViewer_p;
258 	dlgShieldSystemEditor* dlgShieldSystemEditor_p;
259 	dlgSetGlobalShipFlagsEditor* dlgSetGlobalShipFlagsEditor_p;
260 	dlgVoiceActingManager* dlgVoiceActingManager_p;
261 	frmCampaignEditor* frmCampaignEditor_p;
262 	dlgMissionStats* dlgMissionStats_p;
263 	dlgAboutBox* dlgAboutBox_p;
264 	dlgSexpHelp* dlgSexpHelp_p;
265 
266 	// Viewports and Rendering
267 //	wxGLContext mission_state;
268 //	wxGLCanvas viewport;
269 
270 	// member variables
271 	wxChar version[32];
272 	wxString currentFilename;
273 	const wxString fredName;
274 };
275 #endif