FS2_Open
Open source remastering of the Freespace 2 engine
frmfred2.h
Go to the documentation of this file.
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"
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 
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;
184  friend class dlgEventsEditor;
185  friend class frmTeamLoadoutEditor;
186  friend class dlgBackgroundEditor;
189  friend class dlgMissionSpecsEditor;
190  friend class frmBriefingEditor;
191  friend class frmDebriefingEditor;
193  friend class dlgFictionViewer;
194  friend class dlgShieldSystemEditor;
196  friend class dlgVoiceActingManager;
197  friend class frmCampaignEditor;
198  friend class dlgMissionStats;
199  friend class dlgAboutBox;
200  friend class dlgSexpHelp;
201 
203  {
204  // Tools
206 
207  // Editors
227 
228  // Misc.
230 
231  // Help frames and dialogs
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
void OnFileOpen(wxCommandEvent &event)
Definition: frmfred2.cpp:138
void OnEditorsEvents(wxCommandEvent &event)
Definition: frmfred2.cpp:448
void OnSpeedRotation(wxCommandEvent &event)
Definition: frmfred2.cpp:388
void SetFredTitle(void)
Definition: frmfred2.cpp:111
void OnEditorsMissionObjectives(wxCommandEvent &event)
Definition: frmfred2.cpp:437
void OnViewSaveCameraPos(wxCommandEvent &event)
Definition: frmfred2.cpp:368
void OnViewShowHiddenObjects(wxCommandEvent &event)
Definition: frmfred2.cpp:283
void OnHelpShowSexpHelp(wxCommandEvent &event)
Definition: frmfred2.cpp:694
void OnMiscNextObject(wxCommandEvent &event)
Definition: frmfred2.cpp:632
void OnEditDelete(wxCommandEvent &event)
Definition: frmfred2.cpp:210
void OnMiscAlignObject(wxCommandEvent &event)
Definition: frmfred2.cpp:617
void OnEditorsVoiceActingManager(wxCommandEvent &event)
Definition: frmfred2.cpp:580
void OnViewHideMarkedObjects(wxCommandEvent &event)
Definition: frmfred2.cpp:278
void OnFileImportFs1WeaponLoadouts(wxCommandEvent &event)
Definition: frmfred2.cpp:184
void OnEditorsObjects(wxCommandEvent &event)
Definition: frmfred2.cpp:415
void OnEditorsShips(wxCommandEvent &event)
Definition: frmfred2.cpp:393
void OnViewDisplayFilterShowPlayerStarts(wxCommandEvent &event)
Definition: frmfred2.cpp:258
void OnHelpAbout(wxCommandEvent &event)
Definition: frmfred2.cpp:683
void OnViewShowShipInfo(wxCommandEvent &event)
Definition: frmfred2.cpp:298
FREDWindowID
Definition: frmfred2.h:202
void OnEditorsDebriefing(wxCommandEvent &event)
Definition: frmfred2.cpp:525
void OnMiscErrorChecker(wxCommandEvent &event)
Definition: frmfred2.cpp:673
void OnViewShowBackground(wxCommandEvent &event)
Definition: frmfred2.cpp:353
void OnEditorsAsteroidField(wxCommandEvent &event)
Definition: frmfred2.cpp:492
void OnViewShowModelPaths(wxCommandEvent &event)
Definition: frmfred2.cpp:318
void OnMiscMarkWing(wxCommandEvent &event)
Definition: frmfred2.cpp:622
bool ChildIsOpen(const wxWindowID child_id)
Definition: frmfred2.cpp:706
void OnEditDeleteWing(wxCommandEvent &event)
Definition: frmfred2.cpp:215
void OnViewShowGridPositions(wxCommandEvent &event)
Definition: frmfred2.cpp:308
void OnEditorsBackground(wxCommandEvent &event)
Definition: frmfred2.cpp:470
void OnViewStatusbar(wxCommandEvent &event)
Definition: frmfred2.cpp:239
void OnMiscPreviousObject(wxCommandEvent &event)
Definition: frmfred2.cpp:637
void OnFileRunFs2(wxCommandEvent &event)
Definition: frmfred2.cpp:189
void OnViewAntiAliasedGridlines(wxCommandEvent &event)
Definition: frmfred2.cpp:343
void OnFileNew(wxCommandEvent &event)
Definition: frmfred2.cpp:133
void OnFileSaveAs(wxCommandEvent &event)
Definition: frmfred2.cpp:159
GLint GLsizei width
Definition: Gl.h:1505
void OnViewRestoreCameraPos(wxCommandEvent &event)
Definition: frmfred2.cpp:373
void OnViewToolbar(wxCommandEvent &event)
Definition: frmfred2.cpp:225
void OnMiscCancelSubsystem(wxCommandEvent &event)
Definition: frmfred2.cpp:657
void OnEditorsFictionViewer(wxCommandEvent &event)
Definition: frmfred2.cpp:547
void OnHelpHelpTopics(wxCommandEvent &event)
Definition: frmfred2.cpp:678
void OnViewShowCoordinates(wxCommandEvent &event)
Definition: frmfred2.cpp:303
void OnFileRevert(wxCommandEvent &event)
Definition: frmfred2.cpp:164
frmFRED2(void)
void OnViewShowDistances(wxCommandEvent &event)
Definition: frmfred2.cpp:313
void OnMiscAdjustGrid(wxCommandEvent &event)
Definition: frmfred2.cpp:642
void OnViewShowModelDockPoints(wxCommandEvent &event)
Definition: frmfred2.cpp:323
void OnViewDisplayFilterShowHostile(wxCommandEvent &event)
Definition: frmfred2.cpp:273
void OnFileSaveFormatFs2Retail(wxCommandEvent &event)
Definition: frmfred2.cpp:174
void OnMiscMissionStatistics(wxCommandEvent &event)
Definition: frmfred2.cpp:662
void OnFileExit(wxCommandEvent &event)
Definition: frmfred2.cpp:199
void OnChildClosed(wxWindow *child)
Definition: frmfred2.cpp:782
void OnEditorsWaypointPaths(wxCommandEvent &event)
Definition: frmfred2.cpp:426
void OnEditorsShieldSystem(wxCommandEvent &event)
Definition: frmfred2.cpp:558
void OnEditorsTeamLoadout(wxCommandEvent &event)
Definition: frmfred2.cpp:459
void OnFileRecentFiles(wxCommandEvent &event)
Definition: frmfred2.cpp:194
Class frmFRED.
Definition: wxfred_base.h:57
void OnFileImportFs1Mission(wxCommandEvent &event)
Definition: frmfred2.cpp:179
void OnGroupsGroup(wxCommandEvent &event)
Definition: frmfred2.cpp:602
void OnGroupsSetGroup(wxCommandEvent &event)
Definition: frmfred2.cpp:607
void OnMiscLevelObject(wxCommandEvent &event)
Definition: frmfred2.cpp:612
void OnEditorsCampaign(wxCommandEvent &event)
Definition: frmfred2.cpp:591
void OnViewShowOutlines(wxCommandEvent &event)
Definition: frmfred2.cpp:293
void OnViewViewpointCamera(wxCommandEvent &event)
Definition: frmfred2.cpp:358
void OnEditUndo(wxCommandEvent &event)
Definition: frmfred2.cpp:205
void OnEditDisableUndo(wxCommandEvent &event)
Definition: frmfred2.cpp:220
void OnEditorsSetGlobalShipFlags(wxCommandEvent &event)
Definition: frmfred2.cpp:569
void OnViewDoubleFineGridlines(wxCommandEvent &event)
Definition: frmfred2.cpp:338
void OnClose(wxCloseEvent &event)
Definition: frmfred2.cpp:122
void OnMiscControlObject(wxCommandEvent &event)
Definition: frmfred2.cpp:627
void OnViewShowHorizon(wxCommandEvent &event)
Definition: frmfred2.cpp:333
GLint GLsizei GLsizei height
Definition: Gl.h:1505
void OnMiscPrevSubsystem(wxCommandEvent &event)
Definition: frmfred2.cpp:652
void OnEditorsCommandBriefing(wxCommandEvent &event)
Definition: frmfred2.cpp:536
void OnSpeedMovement(wxCommandEvent &event)
Definition: frmfred2.cpp:383
void OnEditorsBriefing(wxCommandEvent &event)
Definition: frmfred2.cpp:514
void OnMiscNextSubsystem(wxCommandEvent &event)
Definition: frmfred2.cpp:647
void OnViewViewpointCurrentShip(wxCommandEvent &event)
Definition: frmfred2.cpp:363
struct _cl_event * event
Definition: Glext.h:7296
void OnEditorsMissionSpecs(wxCommandEvent &event)
Definition: frmfred2.cpp:503
void OnViewShow3DCompass(wxCommandEvent &event)
Definition: frmfred2.cpp:348
void OnViewShowGrid(wxCommandEvent &event)
Definition: frmfred2.cpp:328
void OnViewDisplayFilterShowWaypoints(wxCommandEvent &event)
Definition: frmfred2.cpp:263
void OnSize(wxSizeEvent &event)
Definition: frmfred2.cpp:128
void OnFileSaveFormatFs2Open(wxCommandEvent &event)
Definition: frmfred2.cpp:169
~frmFRED2(void)
Definition: frmfred2.cpp:97
void OnViewLightingFromSuns(wxCommandEvent &event)
Definition: frmfred2.cpp:378
void OnViewShowShipModels(wxCommandEvent &event)
Definition: frmfred2.cpp:288
void OnViewDisplayFilterShowFriendly(wxCommandEvent &event)
Definition: frmfred2.cpp:268
void OnViewDisplayFilterShowShips(wxCommandEvent &event)
Definition: frmfred2.cpp:253
void OnEditorsWings(wxCommandEvent &event)
Definition: frmfred2.cpp:404
void OnFileSave(wxCommandEvent &event)
Definition: frmfred2.cpp:154
void OnEditorsReinforcements(wxCommandEvent &event)
Definition: frmfred2.cpp:481