14 #include "res/fred_app.xpm"
15 #include "res/fred_debug.xpm"
47 #include <wx/msgdlg.h>
49 #include <wx/glcanvas.h>
53 :
fredBase::frmFRED( NULL, wxID_ANY, wxEmptyString, wxPoint(xpos, ypos), wxSize(width, height) ),
54 currentFilename(
"Untitled"), fredName(
"FreeSpace 2 Mission Editor"),
55 frmShipsEditor_p(NULL), frmWingEditor_p(NULL), dlgObjectEditor_p(NULL),
56 frmWaypointEditor_p(NULL), dlgMissionObjectivesEditor_p(NULL), dlgEventsEditor_p(NULL),
57 frmTeamLoadoutEditor_p(NULL), dlgBackgroundEditor_p(NULL), dlgReinforcementsEditor_p(NULL),
58 dlgAsteroidFieldEditor_p(NULL), dlgMissionSpecsEditor_p(NULL), frmBriefingEditor_p(NULL),
59 frmDebriefingEditor_p(NULL), frmCommandBriefingEditor_p(NULL), dlgFictionViewer_p(NULL),
60 dlgShieldSystemEditor_p(NULL), dlgSetGlobalShipFlagsEditor_p(NULL), dlgVoiceActingManager_p(NULL),
61 frmCampaignEditor_p(NULL), dlgMissionStats_p(NULL), dlgAboutBox_p(NULL), dlgSexpHelp_p(NULL)
73 cbNewObject->Append(_T(
"GTF Ulysses"));
74 cbNewObject->SetSelection(0);
76 tbrFRED->AddControl( cbNewObject );
80 sbFRED = this->CreateStatusBar( 5, wxSTB_DEFAULT_STYLE, wxID_ANY,
"wxFRED2" );
83 wxBoxSizer* bSizerView =
new wxBoxSizer( wxVERTICAL );
84 wxGLCanvas *TheViewport =
new wxGLCanvas(
this, wxID_ANY, NULL, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE);
85 bSizerView->Add( TheViewport );
86 this->SetSizer( bSizerView );
91 this->SetIcon(wxIcon(fred_app_xpm));
93 this->SetIcon(wxIcon(fred_debug_xpm));
113 this->SetTitle( currentFilename +
" - " +
version +
" - " + fredName );
141 new wxFileDialog(
this,
"Open FreeSpace 2 Mission", wxGetCwd(), wxEmptyString,
"FreeSpace2 Missions (*.fs2)|*.fs2| All Files (*.*)|*.*");
143 if( dlg->ShowModal() != wxID_OK )
149 currentFilename = dlg->GetFilename();
227 if( event.IsChecked() ==
false )
241 if( event.IsChecked() ==
false )
395 if( frmShipsEditor_p == NULL )
397 frmShipsEditor_p =
new class frmShipsEditor( this, ID_frmShipsEditor );
400 frmShipsEditor_p->Show();
401 frmShipsEditor_p->SetFocus();
406 if( frmWingEditor_p == NULL )
408 frmWingEditor_p =
new class frmWingEditor( this, ID_frmWingEditor );
411 frmWingEditor_p->Show();
412 frmWingEditor_p->SetFocus();
417 if( dlgObjectEditor_p == NULL )
419 dlgObjectEditor_p =
new class dlgObjectEditor( this, ID_dlgObjectEditor );
422 dlgObjectEditor_p->Show();
423 dlgObjectEditor_p->SetFocus();
428 if( frmWaypointEditor_p == NULL )
433 frmWaypointEditor_p->Show();
434 frmWaypointEditor_p->SetFocus();
439 if( dlgMissionObjectivesEditor_p == NULL )
444 dlgMissionObjectivesEditor_p->Show();
445 dlgMissionObjectivesEditor_p->SetFocus();
450 if( dlgEventsEditor_p == NULL )
452 dlgEventsEditor_p =
new class dlgEventsEditor( this, ID_dlgEventsEditor );
455 dlgEventsEditor_p->Show();
456 dlgEventsEditor_p->SetFocus();
461 if( frmTeamLoadoutEditor_p == NULL )
466 frmTeamLoadoutEditor_p->Show();
467 frmTeamLoadoutEditor_p->SetFocus();
472 if( dlgBackgroundEditor_p == NULL )
477 dlgBackgroundEditor_p->Show();
478 dlgBackgroundEditor_p->SetFocus();
483 if( dlgReinforcementsEditor_p == NULL )
488 dlgReinforcementsEditor_p->Show();
489 dlgReinforcementsEditor_p->SetFocus();
494 if( dlgAsteroidFieldEditor_p == NULL )
499 dlgAsteroidFieldEditor_p->Show();
500 dlgAsteroidFieldEditor_p->SetFocus();
505 if( dlgMissionSpecsEditor_p == NULL )
510 dlgMissionSpecsEditor_p->Show();
511 dlgMissionSpecsEditor_p->SetFocus();
516 if( frmBriefingEditor_p == NULL )
521 frmBriefingEditor_p->Show();
522 frmBriefingEditor_p->SetFocus();
527 if( frmDebriefingEditor_p == NULL )
532 frmDebriefingEditor_p->Show();
533 frmDebriefingEditor_p->SetFocus();
538 if( frmCommandBriefingEditor_p == NULL )
543 frmCommandBriefingEditor_p->Show();
544 frmCommandBriefingEditor_p->SetFocus();
549 if( dlgFictionViewer_p == NULL )
551 dlgFictionViewer_p =
new class dlgFictionViewer( this, ID_dlgFictionViewer );
554 dlgFictionViewer_p->Show();
555 dlgFictionViewer_p->SetFocus();
560 if( dlgShieldSystemEditor_p == NULL )
565 dlgShieldSystemEditor_p->Show();
566 dlgShieldSystemEditor_p->SetFocus();
571 if( dlgSetGlobalShipFlagsEditor_p == NULL )
576 dlgSetGlobalShipFlagsEditor_p->Show();
577 dlgSetGlobalShipFlagsEditor_p->SetFocus();
582 if( dlgVoiceActingManager_p == NULL )
587 dlgVoiceActingManager_p->Show();
588 dlgVoiceActingManager_p->SetFocus();
593 if( frmCampaignEditor_p == NULL )
598 frmCampaignEditor_p->Show();
599 frmCampaignEditor_p->SetFocus();
664 if( dlgMissionStats_p == NULL )
666 dlgMissionStats_p =
new class dlgMissionStats( this, ID_dlgMissionStats );
669 dlgMissionStats_p->Show();
670 dlgMissionStats_p->SetFocus();
685 if( dlgAboutBox_p == NULL )
687 dlgAboutBox_p =
new class dlgAboutBox( this, ID_dlgAboutBox );
690 dlgAboutBox_p->Show();
691 dlgAboutBox_p->SetFocus();
696 if( dlgSexpHelp_p == NULL )
698 dlgSexpHelp_p =
new class dlgSexpHelp( this, ID_dlgSexpHelp );
701 dlgSexpHelp_p->Show();
702 dlgSexpHelp_p->SetFocus();
711 return ( frmShipsEditor_p != NULL ) ? frmShipsEditor_p->IsShown() :
false;
714 return ( frmWingEditor_p != NULL ) ? frmWingEditor_p->IsShown() :
false;
717 return ( dlgObjectEditor_p != NULL ) ? dlgObjectEditor_p->IsShown() :
false;
720 return ( frmWaypointEditor_p != NULL ) ? frmWaypointEditor_p->IsShown() :
false;
723 return ( dlgMissionObjectivesEditor_p != NULL ) ? dlgMissionObjectivesEditor_p->IsShown() :
false;
726 return ( dlgEventsEditor_p != NULL ) ? dlgEventsEditor_p->IsShown() :
false;
729 return ( frmTeamLoadoutEditor_p != NULL ) ? frmTeamLoadoutEditor_p->IsShown() :
false;
732 return ( dlgBackgroundEditor_p != NULL ) ? dlgBackgroundEditor_p->IsShown() :
false;
735 return ( dlgReinforcementsEditor_p != NULL ) ? dlgReinforcementsEditor_p->IsShown() :
false;
738 return ( dlgAsteroidFieldEditor_p != NULL ) ? dlgAsteroidFieldEditor_p->IsShown() :
false;
741 return ( dlgMissionSpecsEditor_p != NULL ) ? dlgMissionSpecsEditor_p->IsShown() :
false;
744 return ( frmBriefingEditor_p != NULL ) ? frmBriefingEditor_p->IsShown() :
false;
747 return ( frmDebriefingEditor_p != NULL ) ? frmDebriefingEditor_p->IsShown() :
false;
750 return ( frmCommandBriefingEditor_p != NULL ) ? frmCommandBriefingEditor_p->IsShown() :
false;
753 return ( dlgFictionViewer_p != NULL ) ? dlgFictionViewer_p->IsShown() :
false;
756 return ( dlgShieldSystemEditor_p != NULL ) ? dlgShieldSystemEditor_p->IsShown() :
false;
759 return ( dlgSetGlobalShipFlagsEditor_p != NULL ) ? dlgSetGlobalShipFlagsEditor_p->IsShown() :
false;
762 return ( dlgVoiceActingManager_p != NULL ) ? dlgVoiceActingManager_p->IsShown() :
false;
765 return ( frmCampaignEditor_p != NULL ) ? frmCampaignEditor_p->IsShown() :
false;
768 return ( dlgMissionStats_p != NULL ) ? dlgMissionStats_p->IsShown() :
false;
771 return ( dlgAboutBox_p != NULL ) ? dlgAboutBox_p->IsShown() :
false;
774 return ( dlgSexpHelp_p != NULL ) ? dlgSexpHelp_p->IsShown() :
false;
784 wxWindowID child_id = child->GetId();
789 frmShipsEditor_p = NULL;
793 frmWingEditor_p = NULL;
797 dlgObjectEditor_p = NULL;
801 frmWaypointEditor_p = NULL;
805 dlgMissionObjectivesEditor_p = NULL;
809 dlgEventsEditor_p = NULL;
813 frmTeamLoadoutEditor_p = NULL;
817 dlgBackgroundEditor_p = NULL;
821 dlgReinforcementsEditor_p = NULL;
825 dlgAsteroidFieldEditor_p = NULL;
829 dlgMissionSpecsEditor_p = NULL;
833 frmBriefingEditor_p = NULL;
837 frmDebriefingEditor_p = NULL;
841 frmCommandBriefingEditor_p = NULL;
845 dlgFictionViewer_p = NULL;
849 dlgShieldSystemEditor_p = NULL;
853 dlgSetGlobalShipFlagsEditor_p = NULL;
857 dlgVoiceActingManager_p = NULL;
861 frmCampaignEditor_p = NULL;
865 dlgMissionStats_p = NULL;
869 dlgAboutBox_p = NULL;
873 dlgSexpHelp_p = NULL;
880 wxSprintf( message,
"Child ID: %i \n\nwxFRED must now close, due to an unknown child window closing.\nPlease inform an SCP member of the Child ID number listed above.", child_id );
881 wxMessageBox( message, _T(
"Unknown child window closed"));
void OnFileOpen(wxCommandEvent &event)
void OnEditorsEvents(wxCommandEvent &event)
void OnSpeedRotation(wxCommandEvent &event)
void OnEditorsMissionObjectives(wxCommandEvent &event)
void OnViewSaveCameraPos(wxCommandEvent &event)
void OnViewShowHiddenObjects(wxCommandEvent &event)
void OnHelpShowSexpHelp(wxCommandEvent &event)
void OnMiscNextObject(wxCommandEvent &event)
void OnEditDelete(wxCommandEvent &event)
void OnMiscAlignObject(wxCommandEvent &event)
void OnEditorsVoiceActingManager(wxCommandEvent &event)
void OnViewHideMarkedObjects(wxCommandEvent &event)
void OnFileImportFs1WeaponLoadouts(wxCommandEvent &event)
void OnEditorsObjects(wxCommandEvent &event)
void OnEditorsShips(wxCommandEvent &event)
void OnViewDisplayFilterShowPlayerStarts(wxCommandEvent &event)
void OnHelpAbout(wxCommandEvent &event)
void OnViewShowShipInfo(wxCommandEvent &event)
void OnEditorsDebriefing(wxCommandEvent &event)
void OnMiscErrorChecker(wxCommandEvent &event)
void OnViewShowBackground(wxCommandEvent &event)
void OnEditorsAsteroidField(wxCommandEvent &event)
void OnViewShowModelPaths(wxCommandEvent &event)
void OnMiscMarkWing(wxCommandEvent &event)
bool ChildIsOpen(const wxWindowID child_id)
void OnEditDeleteWing(wxCommandEvent &event)
GLenum GLuint GLenum GLsizei const GLchar * message
void OnViewShowGridPositions(wxCommandEvent &event)
void OnEditorsBackground(wxCommandEvent &event)
void OnViewStatusbar(wxCommandEvent &event)
void OnMiscPreviousObject(wxCommandEvent &event)
void OnFileRunFs2(wxCommandEvent &event)
void OnViewAntiAliasedGridlines(wxCommandEvent &event)
void OnFileNew(wxCommandEvent &event)
void OnFileSaveAs(wxCommandEvent &event)
void OnViewRestoreCameraPos(wxCommandEvent &event)
void OnViewToolbar(wxCommandEvent &event)
void OnMiscCancelSubsystem(wxCommandEvent &event)
void OnEditorsFictionViewer(wxCommandEvent &event)
void OnHelpHelpTopics(wxCommandEvent &event)
void OnViewShowCoordinates(wxCommandEvent &event)
void OnFileRevert(wxCommandEvent &event)
void OnViewShowDistances(wxCommandEvent &event)
void OnMiscAdjustGrid(wxCommandEvent &event)
void OnViewShowModelDockPoints(wxCommandEvent &event)
void OnViewDisplayFilterShowHostile(wxCommandEvent &event)
void OnFileSaveFormatFs2Retail(wxCommandEvent &event)
void OnMiscMissionStatistics(wxCommandEvent &event)
void OnFileExit(wxCommandEvent &event)
void OnChildClosed(wxWindow *child)
void OnEditorsWaypointPaths(wxCommandEvent &event)
void OnEditorsShieldSystem(wxCommandEvent &event)
void OnEditorsTeamLoadout(wxCommandEvent &event)
void OnFileRecentFiles(wxCommandEvent &event)
void OnFileImportFs1Mission(wxCommandEvent &event)
void OnGroupsGroup(wxCommandEvent &event)
void OnGroupsSetGroup(wxCommandEvent &event)
void OnMiscLevelObject(wxCommandEvent &event)
void OnEditorsCampaign(wxCommandEvent &event)
void OnViewShowOutlines(wxCommandEvent &event)
void OnViewViewpointCamera(wxCommandEvent &event)
void OnEditUndo(wxCommandEvent &event)
void OnEditDisableUndo(wxCommandEvent &event)
void OnEditorsSetGlobalShipFlags(wxCommandEvent &event)
void OnViewDoubleFineGridlines(wxCommandEvent &event)
void OnClose(wxCloseEvent &event)
void OnMiscControlObject(wxCommandEvent &event)
void OnViewShowHorizon(wxCommandEvent &event)
GLint GLsizei GLsizei height
void OnMiscPrevSubsystem(wxCommandEvent &event)
void OnEditorsCommandBriefing(wxCommandEvent &event)
void OnSpeedMovement(wxCommandEvent &event)
void OnEditorsBriefing(wxCommandEvent &event)
void OnMiscNextSubsystem(wxCommandEvent &event)
void OnViewViewpointCurrentShip(wxCommandEvent &event)
void OnEditorsMissionSpecs(wxCommandEvent &event)
void OnViewShow3DCompass(wxCommandEvent &event)
void OnViewShowGrid(wxCommandEvent &event)
void OnViewDisplayFilterShowWaypoints(wxCommandEvent &event)
void OnSize(wxSizeEvent &event)
void OnFileSaveFormatFs2Open(wxCommandEvent &event)
void OnViewLightingFromSuns(wxCommandEvent &event)
void OnViewShowShipModels(wxCommandEvent &event)
void OnViewDisplayFilterShowFriendly(wxCommandEvent &event)
void OnViewDisplayFilterShowShips(wxCommandEvent &event)
void OnEditorsWings(wxCommandEvent &event)
void OnFileSave(wxCommandEvent &event)
void OnEditorsReinforcements(wxCommandEvent &event)