1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884
|
/*
* Created by Ian "Goober5000" Warfield and "z64555" for the FreeSpace2 Source
* Code Project.
*
* You may not sell or otherwise commercially exploit the source or things you
* create based on the source.
*/
// Note: wxFormBuilder 3.3beta has a tendancy to use the ADJUST_MINSIZE macro (no longer existing)
// Just do a search&replace of "|wxADJUST_MINSIZE" and "|wxTE_LINEWRAP" to "" to delete all instances, and it'll work fine
#include "frmfred2.h"
#include "res/fred_app.xpm"
#include "res/fred_debug.xpm"
#include "editors/frmshipseditor.h"
#include "editors/frmwingeditor.h"
#include "editors/dlgobjecteditor.h"
#include "editors/frmwaypointeditor.h"
#include "editors/dlgmissionobjectiveseditor.h"
#include "editors/dlgeventseditor.h"
#include "editors/frmteamloadouteditor.h"
#include "editors/dlgbackgroundeditor.h"
#include "editors/dlgreinforcementseditor.h"
#include "editors/dlgasteroidfieldeditor.h"
#include "editors/dlgmissionspecseditor.h"
#include "editors/frmbriefingeditor.h"
#include "editors/frmdebriefingeditor.h"
#include "editors/frmcommandbriefingeditor.h"
#include "editors/dlgfictionviewer.h"
#include "editors/dlgshieldsystemeditor.h"
#include "editors/dlgsetglobalshipflagseditor.h"
#include "editors/dlgvoiceactingmanager.h"
#include "editors/frmcampaigneditor.h"
#include "misc/dlgmissionstats.h"
#include "help/dlgaboutbox.h"
#include "help/dlgsexphelp.h"
#include "base/wxfred_base.h"
#include <globalincs/version.h>
#include <globalincs/pstypes.h>
#include <wx/msgdlg.h>
#include <wx/wx.h>
#include <wx/glcanvas.h>
// Public:
frmFRED2::frmFRED2( const wxChar *title, int xpos, int ypos, int width, int height )
: fredBase::frmFRED( NULL, wxID_ANY, wxEmptyString, wxPoint(xpos, ypos), wxSize(width, height) ),
currentFilename("Untitled"), fredName("FreeSpace 2 Mission Editor"),
frmShipsEditor_p(NULL), frmWingEditor_p(NULL), dlgObjectEditor_p(NULL),
frmWaypointEditor_p(NULL), dlgMissionObjectivesEditor_p(NULL), dlgEventsEditor_p(NULL),
frmTeamLoadoutEditor_p(NULL), dlgBackgroundEditor_p(NULL), dlgReinforcementsEditor_p(NULL),
dlgAsteroidFieldEditor_p(NULL), dlgMissionSpecsEditor_p(NULL), frmBriefingEditor_p(NULL),
frmDebriefingEditor_p(NULL), frmCommandBriefingEditor_p(NULL), dlgFictionViewer_p(NULL),
dlgShieldSystemEditor_p(NULL), dlgSetGlobalShipFlagsEditor_p(NULL), dlgVoiceActingManager_p(NULL),
frmCampaignEditor_p(NULL), dlgMissionStats_p(NULL), dlgAboutBox_p(NULL), dlgSexpHelp_p(NULL)
{
// Title bar setup
// z64: somewhat roundabout way to include the FS2 Open version number in the form title.
wxSprintf( version, "v%i.%i.%i", FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD );
this->SetFredTitle();
// New Object Selection ListBox
cbNewObject = new wxChoice( tbrFRED, ID_TOOL_NEWOBJECTLIST, wxDefaultPosition, wxSize(193,-1), 0, NULL, wxCB_SORT );
// TODO: Auto-size the choice box to the longest string in the list.
// TODO: Grab the actual list of object classes
cbNewObject->Append(_T("GTF Ulysses"));
cbNewObject->SetSelection(0);
tbrFRED->AddControl( cbNewObject );
tbrFRED->Realize();
// Status Bar
sbFRED = this->CreateStatusBar( 5, wxSTB_DEFAULT_STYLE, wxID_ANY, "wxFRED2" );
// The Viewport
wxBoxSizer* bSizerView = new wxBoxSizer( wxVERTICAL );
wxGLCanvas *TheViewport = new wxGLCanvas(this, wxID_ANY, NULL, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE);
bSizerView->Add( TheViewport );
this->SetSizer( bSizerView );
this->Layout();
// Set the icon to use for the taskbar and titlebar of this frame
#ifdef NDEBUG
this->SetIcon(wxIcon(fred_app_xpm));
#else
this->SetIcon(wxIcon(fred_debug_xpm));
#endif
}
frmFRED2::~frmFRED2( void )
{
if( sbFRED != NULL )
{
delete sbFRED;
}
}
// Protected:
// Helpers.
/*
* Sets the string on the titlebar of frmFRED2.
* wxChar version[] and wxString fredName are initialized during the constructor, and shouldn't be altered elsewhere.
*/
void frmFRED2::SetFredTitle( void )
{
this->SetTitle( currentFilename + " - " + version + " - " + fredName );
}
// Handlers for frmFRED events.
/*
* 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.
*/
void frmFRED2::OnClose( wxCloseEvent &event )
{
// TODO: Implement OnClose
this->Destroy();
}
void frmFRED2::OnSize( wxSizeEvent &event )
{
// TODO: Implement OnSize
}
void frmFRED2::OnFileNew( wxCommandEvent &event )
{
// TODO: Implement OnFileNew
}
void frmFRED2::OnFileOpen( wxCommandEvent &event )
{
wxFileDialog *dlg =
new wxFileDialog( this, "Open FreeSpace 2 Mission", wxGetCwd(), wxEmptyString, "FreeSpace2 Missions (*.fs2)|*.fs2| All Files (*.*)|*.*");
if( dlg->ShowModal() != wxID_OK )
{
// User didn't click OK
return;
}
currentFilename = dlg->GetFilename();
// TODO: actually (attempt) to open the file
SetFredTitle();
}
void frmFRED2::OnFileSave( wxCommandEvent &event )
{
// TODO: Implement OnFileSave
}
void frmFRED2::OnFileSaveAs( wxCommandEvent &event )
{
// TODO: Implement OnFileSaveAs
}
void frmFRED2::OnFileRevert( wxCommandEvent &event )
{
// TODO: Implement OnFileRevert
}
void frmFRED2::OnFileSaveFormatFs2Open( wxCommandEvent &event )
{
// TODO: Implement OnFileSaveFormatFs2Open
}
void frmFRED2::OnFileSaveFormatFs2Retail( wxCommandEvent &event )
{
// TODO: Implement OnFileSaveFormatFs2Retail
}
void frmFRED2::OnFileImportFs1Mission( wxCommandEvent &event )
{
// TODO: Implement OnFileImportFs1Mission
}
void frmFRED2::OnFileImportFs1WeaponLoadouts( wxCommandEvent &event )
{
// TODO: Implement OnFileImportFs1WeaponLoadouts
}
void frmFRED2::OnFileRunFs2( wxCommandEvent &event )
{
// TODO: Implement OnFileRunFs2
}
void frmFRED2::OnFileRecentFiles( wxCommandEvent &event )
{
// TODO: Implement OnFileRecentFiles
}
void frmFRED2::OnFileExit( wxCommandEvent &event )
{
// TODO: Implement OnFileExit
this->Close();
}
void frmFRED2::OnEditUndo( wxCommandEvent &event )
{
// TODO: Implement OnEditUndo
}
void frmFRED2::OnEditDelete( wxCommandEvent &event )
{
// TODO: Implement OnEditDelete
}
void frmFRED2::OnEditDeleteWing( wxCommandEvent &event )
{
// TODO: Implement OnEditDeleteWing
}
void frmFRED2::OnEditDisableUndo( wxCommandEvent &event )
{
// TODO: Implement OnEditDisableUndo
}
void frmFRED2::OnViewToolbar( wxCommandEvent &event )
{
if( event.IsChecked() == false )
{
// Control is cleared: User does not want to view the status bar
tbrFRED->Hide();
}
else
{
// Else, control is filled: User wants to view the status bar
tbrFRED->Show();
}
}
void frmFRED2::OnViewStatusbar( wxCommandEvent &event )
{
if( event.IsChecked() == false )
{
// Control is cleared: User does not want to view the status bar
sbFRED->Hide();
}
else
{
// Else, control is filled: User wants to view the status bar
sbFRED->Show();
}
}
void frmFRED2::OnViewDisplayFilterShowShips( wxCommandEvent &event )
{
// TODO: Implement OnViewDisplayFilterShowShips
}
void frmFRED2::OnViewDisplayFilterShowPlayerStarts( wxCommandEvent &event )
{
// TODO: Implement OnViewDisplayFilterShowPlayerStarts
}
void frmFRED2::OnViewDisplayFilterShowWaypoints( wxCommandEvent &event )
{
// TODO: Implement OnViewDisplayFilterShowWaypoints
}
void frmFRED2::OnViewDisplayFilterShowFriendly( wxCommandEvent &event )
{
// TODO: Implement OnViewDisplayFilterShowFriendly
}
void frmFRED2::OnViewDisplayFilterShowHostile( wxCommandEvent &event )
{
// TODO: Implement OnViewDisplayFilterShowHostile
}
void frmFRED2::OnViewHideMarkedObjects( wxCommandEvent &event )
{
// TODO: Implement OnViewHideMarkedObjects
}
void frmFRED2::OnViewShowHiddenObjects( wxCommandEvent &event )
{
// TODO: Implement OnViewShowHiddenObjects
}
void frmFRED2::OnViewShowShipModels( wxCommandEvent &event )
{
// TODO: Implement OnViewShowShipModels
}
void frmFRED2::OnViewShowOutlines( wxCommandEvent &event )
{
// TODO: Implement OnViewShowOutlines
}
void frmFRED2::OnViewShowShipInfo( wxCommandEvent &event )
{
// TODO: Implement OnViewShowShipInfo
}
void frmFRED2::OnViewShowCoordinates( wxCommandEvent &event )
{
// TODO: Implement OnViewShowCoordinates
}
void frmFRED2::OnViewShowGridPositions( wxCommandEvent &event )
{
// TODO: Implement OnViewShowGridPositions
}
void frmFRED2::OnViewShowDistances( wxCommandEvent &event )
{
// TODO: Implement OnViewShowDistances
}
void frmFRED2::OnViewShowModelPaths( wxCommandEvent &event )
{
// TODO: Implement OnViewShowModelPaths
}
void frmFRED2::OnViewShowModelDockPoints( wxCommandEvent &event )
{
// TODO: Implement OnViewShowModelDockPoints
}
void frmFRED2::OnViewShowGrid( wxCommandEvent &event )
{
// TODO: Implement OnViewShowGrid
}
void frmFRED2::OnViewShowHorizon( wxCommandEvent &event )
{
// TODO: Implement OnViewShowHorizon
}
void frmFRED2::OnViewDoubleFineGridlines( wxCommandEvent &event )
{
// TODO: Implement OnViewDoubleFineGridlines
}
void frmFRED2::OnViewAntiAliasedGridlines( wxCommandEvent &event )
{
// TODO: Implement OnViewAntiAliasedGridlines
}
void frmFRED2::OnViewShow3DCompass( wxCommandEvent &event )
{
// TODO: Implement OnViewShow3DCompass
}
void frmFRED2::OnViewShowBackground( wxCommandEvent &event )
{
// TODO: Implement OnViewShowBackground
}
void frmFRED2::OnViewViewpointCamera( wxCommandEvent &event )
{
// TODO: Implement OnViewViewpointCamera
}
void frmFRED2::OnViewViewpointCurrentShip( wxCommandEvent &event )
{
// TODO: Implement OnViewViewpointCurrentShip
}
void frmFRED2::OnViewSaveCameraPos( wxCommandEvent &event )
{
// TODO: Implement OnViewSaveCameraPos
}
void frmFRED2::OnViewRestoreCameraPos( wxCommandEvent &event )
{
// TODO: Implement OnViewRestoreCameraPos
}
void frmFRED2::OnViewLightingFromSuns( wxCommandEvent &event )
{
// TODO: Implement OnViewLightingFromSuns
}
void frmFRED2::OnSpeedMovement( wxCommandEvent &event )
{
// TODO: Implement OnViewSpeedMovement
}
void frmFRED2::OnSpeedRotation( wxCommandEvent &event )
{
// TODO: Implement OnSpeedRotation
}
void frmFRED2::OnEditorsShips( wxCommandEvent &event )
{
if( frmShipsEditor_p == NULL )
{
frmShipsEditor_p = new class frmShipsEditor( this, ID_frmShipsEditor );
}
frmShipsEditor_p->Show();
frmShipsEditor_p->SetFocus();
}
void frmFRED2::OnEditorsWings( wxCommandEvent &event )
{
if( frmWingEditor_p == NULL )
{
frmWingEditor_p = new class frmWingEditor( this, ID_frmWingEditor );
}
frmWingEditor_p->Show();
frmWingEditor_p->SetFocus();
}
void frmFRED2::OnEditorsObjects( wxCommandEvent &event )
{
if( dlgObjectEditor_p == NULL )
{
dlgObjectEditor_p = new class dlgObjectEditor( this, ID_dlgObjectEditor );
}
dlgObjectEditor_p->Show();
dlgObjectEditor_p->SetFocus();
}
void frmFRED2::OnEditorsWaypointPaths( wxCommandEvent &event )
{
if( frmWaypointEditor_p == NULL )
{
frmWaypointEditor_p = new class frmWaypointEditor( this, ID_frmWaypointEditor );
}
frmWaypointEditor_p->Show();
frmWaypointEditor_p->SetFocus();
}
void frmFRED2::OnEditorsMissionObjectives( wxCommandEvent &event )
{
if( dlgMissionObjectivesEditor_p == NULL )
{
dlgMissionObjectivesEditor_p = new class dlgMissionObjectivesEditor( this, ID_dlgMissionObjectivesEditor );
}
dlgMissionObjectivesEditor_p->Show();
dlgMissionObjectivesEditor_p->SetFocus();
}
void frmFRED2::OnEditorsEvents( wxCommandEvent &event )
{
if( dlgEventsEditor_p == NULL )
{
dlgEventsEditor_p = new class dlgEventsEditor( this, ID_dlgEventsEditor );
}
dlgEventsEditor_p->Show();
dlgEventsEditor_p->SetFocus();
}
void frmFRED2::OnEditorsTeamLoadout( wxCommandEvent &event )
{
if( frmTeamLoadoutEditor_p == NULL )
{
frmTeamLoadoutEditor_p = new class frmTeamLoadoutEditor( this, ID_frmTeamLoadoutEditor );
}
frmTeamLoadoutEditor_p->Show();
frmTeamLoadoutEditor_p->SetFocus();
}
void frmFRED2::OnEditorsBackground( wxCommandEvent &event )
{
if( dlgBackgroundEditor_p == NULL )
{
dlgBackgroundEditor_p = new class dlgBackgroundEditor( this, ID_dlgBackgroundEditor );
}
dlgBackgroundEditor_p->Show();
dlgBackgroundEditor_p->SetFocus();
}
void frmFRED2::OnEditorsReinforcements( wxCommandEvent &event )
{
if( dlgReinforcementsEditor_p == NULL )
{
dlgReinforcementsEditor_p = new class dlgReinforcementsEditor( this, ID_dlgReinforcementsEditor );
}
dlgReinforcementsEditor_p->Show();
dlgReinforcementsEditor_p->SetFocus();
}
void frmFRED2::OnEditorsAsteroidField( wxCommandEvent &event )
{
if( dlgAsteroidFieldEditor_p == NULL )
{
dlgAsteroidFieldEditor_p = new class dlgAsteroidFieldEditor( this, ID_dlgAsteroidFieldEditor );
}
dlgAsteroidFieldEditor_p->Show();
dlgAsteroidFieldEditor_p->SetFocus();
}
void frmFRED2::OnEditorsMissionSpecs( wxCommandEvent &event )
{
if( dlgMissionSpecsEditor_p == NULL )
{
dlgMissionSpecsEditor_p = new class dlgMissionSpecsEditor( this, ID_dlgMissionSpecsEditor );
}
dlgMissionSpecsEditor_p->Show();
dlgMissionSpecsEditor_p->SetFocus();
}
void frmFRED2::OnEditorsBriefing( wxCommandEvent &event )
{
if( frmBriefingEditor_p == NULL )
{
frmBriefingEditor_p = new class frmBriefingEditor( this, ID_frmBriefingEditor );
}
frmBriefingEditor_p->Show();
frmBriefingEditor_p->SetFocus();
}
void frmFRED2::OnEditorsDebriefing( wxCommandEvent &event )
{
if( frmDebriefingEditor_p == NULL )
{
frmDebriefingEditor_p = new class frmDebriefingEditor( this, ID_frmDebriefingEditor );
}
frmDebriefingEditor_p->Show();
frmDebriefingEditor_p->SetFocus();
}
void frmFRED2::OnEditorsCommandBriefing( wxCommandEvent &event )
{
if( frmCommandBriefingEditor_p == NULL )
{
frmCommandBriefingEditor_p = new class frmCommandBriefingEditor( this, ID_frmCommandBriefingEditor );
}
frmCommandBriefingEditor_p->Show();
frmCommandBriefingEditor_p->SetFocus();
}
void frmFRED2::OnEditorsFictionViewer( wxCommandEvent &event )
{
if( dlgFictionViewer_p == NULL )
{
dlgFictionViewer_p = new class dlgFictionViewer( this, ID_dlgFictionViewer );
}
dlgFictionViewer_p->Show();
dlgFictionViewer_p->SetFocus();
}
void frmFRED2::OnEditorsShieldSystem( wxCommandEvent &event )
{
if( dlgShieldSystemEditor_p == NULL )
{
dlgShieldSystemEditor_p = new class dlgShieldSystemEditor( this, ID_dlgShieldSystemEditor );
}
dlgShieldSystemEditor_p->Show();
dlgShieldSystemEditor_p->SetFocus();
}
void frmFRED2::OnEditorsSetGlobalShipFlags( wxCommandEvent &event )
{
if( dlgSetGlobalShipFlagsEditor_p == NULL )
{
dlgSetGlobalShipFlagsEditor_p = new class dlgSetGlobalShipFlagsEditor( this, ID_dlgSetGlobalShipFlagsEditor );
}
dlgSetGlobalShipFlagsEditor_p->Show();
dlgSetGlobalShipFlagsEditor_p->SetFocus();
}
void frmFRED2::OnEditorsVoiceActingManager( wxCommandEvent &event )
{
if( dlgVoiceActingManager_p == NULL )
{
dlgVoiceActingManager_p = new class dlgVoiceActingManager( this, ID_dlgVoiceActingManager );
}
dlgVoiceActingManager_p->Show();
dlgVoiceActingManager_p->SetFocus();
}
void frmFRED2::OnEditorsCampaign( wxCommandEvent &event )
{
if( frmCampaignEditor_p == NULL )
{
frmCampaignEditor_p = new class frmCampaignEditor( this, ID_frmCampaignEditor );
}
frmCampaignEditor_p->Show();
frmCampaignEditor_p->SetFocus();
}
void frmFRED2::OnGroupsGroup( wxCommandEvent &event )
{
// TODO: Implement OnGroupsGroup
}
void frmFRED2::OnGroupsSetGroup( wxCommandEvent &event )
{
// TODO: Implement OnGroupsSetGroup
}
void frmFRED2::OnMiscLevelObject( wxCommandEvent &event )
{
// TODO: Implement OnMiscLevelObject
}
void frmFRED2::OnMiscAlignObject( wxCommandEvent &event )
{
// TODO: Implement OnMiscAlignObject
}
void frmFRED2::OnMiscMarkWing( wxCommandEvent &event )
{
// TODO: Implement OnMiscMarkWing
}
void frmFRED2::OnMiscControlObject( wxCommandEvent &event )
{
// TODO: Implement OnMiscControlObject
}
void frmFRED2::OnMiscNextObject( wxCommandEvent &event )
{
// TODO: Implement OnMiscNextObject
}
void frmFRED2::OnMiscPreviousObject( wxCommandEvent &event )
{
// TODO: Implement OnMiscPreviousObject
}
void frmFRED2::OnMiscAdjustGrid( wxCommandEvent &event )
{
// TODO: Implement OnMiscAdjustGrid
}
void frmFRED2::OnMiscNextSubsystem( wxCommandEvent &event )
{
// TODO: Implement OnMiscNextSubsystem
}
void frmFRED2::OnMiscPrevSubsystem( wxCommandEvent &event )
{
// TODO: Implement OnMiscPrevSubsystem
}
void frmFRED2::OnMiscCancelSubsystem( wxCommandEvent &event )
{
// TODO: Implement OnMiscCancelSubsystem
}
void frmFRED2::OnMiscMissionStatistics( wxCommandEvent &event )
{
if( dlgMissionStats_p == NULL )
{
dlgMissionStats_p = new class dlgMissionStats( this, ID_dlgMissionStats );
}
dlgMissionStats_p->Show();
dlgMissionStats_p->SetFocus();
}
void frmFRED2::OnMiscErrorChecker( wxCommandEvent &event )
{
// TODO: Implement OnMiscErrorChecker
}
void frmFRED2::OnHelpHelpTopics( wxCommandEvent &event )
{
// TODO: Implement OnMiscHelpHelpTopics
}
void frmFRED2::OnHelpAbout( wxCommandEvent &event )
{
if( dlgAboutBox_p == NULL )
{
dlgAboutBox_p = new class dlgAboutBox( this, ID_dlgAboutBox );
}
dlgAboutBox_p->Show();
dlgAboutBox_p->SetFocus();
}
void frmFRED2::OnHelpShowSexpHelp( wxCommandEvent &event )
{
if( dlgSexpHelp_p == NULL )
{
dlgSexpHelp_p = new class dlgSexpHelp( this, ID_dlgSexpHelp );
}
dlgSexpHelp_p->Show();
dlgSexpHelp_p->SetFocus();
}
// Handlers for child dialogs & frames
bool frmFRED2::ChildIsOpen( const wxWindowID child_id )
{
switch( child_id )
{
case ID_frmShipsEditor:
return ( frmShipsEditor_p != NULL ) ? frmShipsEditor_p->IsShown() : false;
case ID_frmWingEditor:
return ( frmWingEditor_p != NULL ) ? frmWingEditor_p->IsShown() : false;
case ID_dlgObjectEditor:
return ( dlgObjectEditor_p != NULL ) ? dlgObjectEditor_p->IsShown() : false;
case ID_frmWaypointEditor:
return ( frmWaypointEditor_p != NULL ) ? frmWaypointEditor_p->IsShown() : false;
case ID_dlgMissionObjectivesEditor:
return ( dlgMissionObjectivesEditor_p != NULL ) ? dlgMissionObjectivesEditor_p->IsShown() : false;
case ID_dlgEventsEditor:
return ( dlgEventsEditor_p != NULL ) ? dlgEventsEditor_p->IsShown() : false;
case ID_frmTeamLoadoutEditor:
return ( frmTeamLoadoutEditor_p != NULL ) ? frmTeamLoadoutEditor_p->IsShown() : false;
case ID_dlgBackgroundEditor:
return ( dlgBackgroundEditor_p != NULL ) ? dlgBackgroundEditor_p->IsShown() : false;
case ID_dlgReinforcementsEditor:
return ( dlgReinforcementsEditor_p != NULL ) ? dlgReinforcementsEditor_p->IsShown() : false;
case ID_dlgAsteroidFieldEditor:
return ( dlgAsteroidFieldEditor_p != NULL ) ? dlgAsteroidFieldEditor_p->IsShown() : false;
case ID_dlgMissionSpecsEditor:
return ( dlgMissionSpecsEditor_p != NULL ) ? dlgMissionSpecsEditor_p->IsShown() : false;
case ID_frmBriefingEditor:
return ( frmBriefingEditor_p != NULL ) ? frmBriefingEditor_p->IsShown() : false;
case ID_frmDebriefingEditor:
return ( frmDebriefingEditor_p != NULL ) ? frmDebriefingEditor_p->IsShown() : false;
case ID_frmCommandBriefingEditor:
return ( frmCommandBriefingEditor_p != NULL ) ? frmCommandBriefingEditor_p->IsShown() : false;
case ID_dlgFictionViewer:
return ( dlgFictionViewer_p != NULL ) ? dlgFictionViewer_p->IsShown() : false;
case ID_dlgShieldSystemEditor:
return ( dlgShieldSystemEditor_p != NULL ) ? dlgShieldSystemEditor_p->IsShown() : false;
case ID_dlgSetGlobalShipFlagsEditor:
return ( dlgSetGlobalShipFlagsEditor_p != NULL ) ? dlgSetGlobalShipFlagsEditor_p->IsShown() : false;
case ID_dlgVoiceActingManager:
return ( dlgVoiceActingManager_p != NULL ) ? dlgVoiceActingManager_p->IsShown() : false;
case ID_frmCampaignEditor:
return ( frmCampaignEditor_p != NULL ) ? frmCampaignEditor_p->IsShown() : false;
case ID_dlgMissionStats:
return ( dlgMissionStats_p != NULL ) ? dlgMissionStats_p->IsShown() : false;
case ID_dlgAboutBox:
return ( dlgAboutBox_p != NULL ) ? dlgAboutBox_p->IsShown() : false;
case ID_dlgSexpHelp:
return ( dlgSexpHelp_p != NULL ) ? dlgSexpHelp_p->IsShown() : false;
default:
// Maybe return debug dialog. "Unknown child id"
return false;
}
}
void frmFRED2::OnChildClosed( wxWindow* const child )
{
wxWindowID child_id = child->GetId();
switch( child_id )
{
case ID_frmShipsEditor:
frmShipsEditor_p = NULL;
break;
case ID_frmWingEditor:
frmWingEditor_p = NULL;
break;
case ID_dlgObjectEditor:
dlgObjectEditor_p = NULL;
break;
case ID_frmWaypointEditor:
frmWaypointEditor_p = NULL;
break;
case ID_dlgMissionObjectivesEditor:
dlgMissionObjectivesEditor_p = NULL;
break;
case ID_dlgEventsEditor:
dlgEventsEditor_p = NULL;
break;
case ID_frmTeamLoadoutEditor:
frmTeamLoadoutEditor_p = NULL;
break;
case ID_dlgBackgroundEditor:
dlgBackgroundEditor_p = NULL;
break;
case ID_dlgReinforcementsEditor:
dlgReinforcementsEditor_p = NULL;
break;
case ID_dlgAsteroidFieldEditor:
dlgAsteroidFieldEditor_p = NULL;
break;
case ID_dlgMissionSpecsEditor:
dlgMissionSpecsEditor_p = NULL;
break;
case ID_frmBriefingEditor:
frmBriefingEditor_p = NULL;
break;
case ID_frmDebriefingEditor:
frmDebriefingEditor_p = NULL;
break;
case ID_frmCommandBriefingEditor:
frmCommandBriefingEditor_p = NULL;
break;
case ID_dlgFictionViewer:
dlgFictionViewer_p = NULL;
break;
case ID_dlgShieldSystemEditor:
dlgShieldSystemEditor_p = NULL;
break;
case ID_dlgSetGlobalShipFlagsEditor:
dlgSetGlobalShipFlagsEditor_p = NULL;
break;
case ID_dlgVoiceActingManager:
dlgVoiceActingManager_p = NULL;
break;
case ID_frmCampaignEditor:
frmCampaignEditor_p = NULL;
break;
case ID_dlgMissionStats:
dlgMissionStats_p = NULL;
break;
case ID_dlgAboutBox:
dlgAboutBox_p = NULL;
break;
case ID_dlgSexpHelp:
dlgSexpHelp_p = NULL;
break;
default:
// wxFRED must close in order to prevent anything from exploding.
// TODO: determine if any changes were made prior to the crash. If so, try to save the changes so the user's work won't be lost
wxChar message[255];
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 );
wxMessageBox( message, _T("Unknown child window closed"));
Close();
}
}
|