From 00528b3be3ed20afd00ecd9adfa8e2369e7be5a2 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Thu, 2 Apr 2009 11:54:19 +0000 Subject: [PATCH] wxGui branch: Moved and renamed some files and classes. I'm quite a bit more fond of the C# / Java naming schemes for forms and dialogs over the wxGlade frm/dlg prefixes. Namespaced all dialogs into Dialogs::. (all two of them at this point, but many more will come! .. someday) git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@882 96395faa-99c1-11dd-bbfe-3dabce05a288 --- .../GameFixesDialog.cpp} | 18 +++-- .../GameFixesDialog.h} | 27 ++++---- .../LogOptionsDialog.cpp} | 23 ++++--- .../LogOptionsDialog.h} | 8 ++- pcsx2/NewGUI/{frmMain.cpp => MainFrame.cpp} | 68 ++++++++++--------- pcsx2/NewGUI/{frmMain.h => MainFrame.h} | 4 +- pcsx2/NewGUI/main.cpp | 4 +- pcsx2/windows/VCprojects/pcsx2_2008.vcproj | 58 ++++++++-------- 8 files changed, 114 insertions(+), 96 deletions(-) rename pcsx2/NewGUI/{frmGameFixes.cpp => Dialogs/GameFixesDialog.cpp} (82%) rename pcsx2/NewGUI/{frmGameFixes.h => Dialogs/GameFixesDialog.h} (63%) rename pcsx2/NewGUI/{frmLogging.cpp => Dialogs/LogOptionsDialog.cpp} (84%) rename pcsx2/NewGUI/{frmLogging.h => Dialogs/LogOptionsDialog.h} (87%) rename pcsx2/NewGUI/{frmMain.cpp => MainFrame.cpp} (86%) rename pcsx2/NewGUI/{frmMain.h => MainFrame.h} (96%) diff --git a/pcsx2/NewGUI/frmGameFixes.cpp b/pcsx2/NewGUI/Dialogs/GameFixesDialog.cpp similarity index 82% rename from pcsx2/NewGUI/frmGameFixes.cpp rename to pcsx2/NewGUI/Dialogs/GameFixesDialog.cpp index 88e0b990d0..b0c59524fa 100644 --- a/pcsx2/NewGUI/frmGameFixes.cpp +++ b/pcsx2/NewGUI/Dialogs/GameFixesDialog.cpp @@ -18,13 +18,15 @@ #include "PrecompiledHeader.h" #include "Misc.h" -#include "frmGameFixes.h" +#include "GameFixesDialog.h" #include "wxHelpers.h" using namespace wxHelpers; -frmGameFixes::frmGameFixes(wxWindow* parent, int id, const wxPoint& pos, const wxSize& size, long style): -wxDialog( parent, id, _T("Game Special Fixes"), pos, size ) +namespace Dialogs { + +GameFixesDialog::GameFixesDialog(wxWindow* parent, int id, const wxPoint& pos, const wxSize& size, long style): + wxDialog( parent, id, _T("Game Special Fixes"), pos, size ) { wxStaticBox* groupbox = new wxStaticBox( this, -1, _T("PCSX2 Gamefixes")); wxStaticText* label_Title = new wxStaticText( @@ -55,26 +57,28 @@ wxDialog( parent, id, _T("Game Special Fixes"), pos, size ) } -BEGIN_EVENT_TABLE(frmGameFixes, wxDialog) +BEGIN_EVENT_TABLE(GameFixesDialog, wxDialog) EVT_CHECKBOX(wxID_ANY, FPUCompareHack_Click) EVT_CHECKBOX(wxID_ANY, TriAce_Click) EVT_CHECKBOX(wxID_ANY, GodWar_Click) END_EVENT_TABLE(); -void frmGameFixes::FPUCompareHack_Click(wxCommandEvent &event) +void GameFixesDialog::FPUCompareHack_Click(wxCommandEvent &event) { event.Skip(); } -void frmGameFixes::TriAce_Click(wxCommandEvent &event) +void GameFixesDialog::TriAce_Click(wxCommandEvent &event) { event.Skip(); } -void frmGameFixes::GodWar_Click(wxCommandEvent &event) +void GameFixesDialog::GodWar_Click(wxCommandEvent &event) { event.Skip(); } + +} // end namespace Dialogs \ No newline at end of file diff --git a/pcsx2/NewGUI/frmGameFixes.h b/pcsx2/NewGUI/Dialogs/GameFixesDialog.h similarity index 63% rename from pcsx2/NewGUI/frmGameFixes.h rename to pcsx2/NewGUI/Dialogs/GameFixesDialog.h index 94a224f4a5..e606e9804b 100644 --- a/pcsx2/NewGUI/frmGameFixes.h +++ b/pcsx2/NewGUI/Dialogs/GameFixesDialog.h @@ -21,20 +21,23 @@ #pragma once -class frmGameFixes: public wxDialog +namespace Dialogs { -public: + class GameFixesDialog: public wxDialog + { + public: - frmGameFixes(wxWindow* parent, int id, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE); + GameFixesDialog(wxWindow* parent, int id, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE); -protected: + protected: - DECLARE_EVENT_TABLE(); + DECLARE_EVENT_TABLE(); -public: - void FPUCompareHack_Click(wxCommandEvent &event); - void TriAce_Click(wxCommandEvent &event); - void GodWar_Click(wxCommandEvent &event); - void Ok_Click(wxCommandEvent &event); - void Cancel_Click(wxCommandEvent &event); -}; + public: + void FPUCompareHack_Click(wxCommandEvent &event); + void TriAce_Click(wxCommandEvent &event); + void GodWar_Click(wxCommandEvent &event); + void Ok_Click(wxCommandEvent &event); + void Cancel_Click(wxCommandEvent &event); + }; +} diff --git a/pcsx2/NewGUI/frmLogging.cpp b/pcsx2/NewGUI/Dialogs/LogOptionsDialog.cpp similarity index 84% rename from pcsx2/NewGUI/frmLogging.cpp rename to pcsx2/NewGUI/Dialogs/LogOptionsDialog.cpp index 418db2c31d..6308649238 100644 --- a/pcsx2/NewGUI/frmLogging.cpp +++ b/pcsx2/NewGUI/Dialogs/LogOptionsDialog.cpp @@ -18,7 +18,7 @@ #include "PrecompiledHeader.h" #include "DebugTools/Debug.h" -#include "frmLogging.h" +#include "LogOptionsDialog.h" #include @@ -35,9 +35,11 @@ void ConnectChildrenRecurse( wxWindow* parent, int eventType, wxObjectEventFunct } } +namespace Dialogs +{ ////////////////////////////////////////////////////////////////////////////////////////// // -frmLogging::eeLogOptionsPanel::eeLogOptionsPanel( wxWindow* parent ) : +LogOptionsDialog::eeLogOptionsPanel::eeLogOptionsPanel( wxWindow* parent ) : CheckedStaticBox( parent, wxHORIZONTAL, wxT( "EE Logs" ), LogID_EEBox ) { wxBoxSizer& eeMisc = *new wxBoxSizer( wxVERTICAL ); @@ -57,7 +59,7 @@ frmLogging::eeLogOptionsPanel::eeLogOptionsPanel( wxWindow* parent ) : Fit(); } -frmLogging::eeLogOptionsPanel::DisasmPanel::DisasmPanel( wxWindow* parent ) : +LogOptionsDialog::eeLogOptionsPanel::DisasmPanel::DisasmPanel( wxWindow* parent ) : CheckedStaticBox( parent, wxVERTICAL, wxT( "Disasm" ), LogID_Disasm ) { AddCheckBox( _T("Core"), LogID_CPU ); @@ -70,7 +72,7 @@ frmLogging::eeLogOptionsPanel::DisasmPanel::DisasmPanel( wxWindow* parent ) : Fit(); } -frmLogging::eeLogOptionsPanel::HwPanel::HwPanel( wxWindow* parent ) : +LogOptionsDialog::eeLogOptionsPanel::HwPanel::HwPanel( wxWindow* parent ) : CheckedStaticBox( parent, wxVERTICAL, wxT( "Hardware" ), LogID_Hardware ) { AddCheckBox( _T("Registers"),LogID_Registers ); @@ -86,7 +88,7 @@ frmLogging::eeLogOptionsPanel::HwPanel::HwPanel( wxWindow* parent ) : Fit(); } -void frmLogging::eeLogOptionsPanel::OnLogChecked(wxCommandEvent &event) +void LogOptionsDialog::eeLogOptionsPanel::OnLogChecked(wxCommandEvent &event) { LogChecks checkId = (LogChecks)(int)event.m_callbackUserData; //ToggleLogOption( checkId ); @@ -95,7 +97,7 @@ void frmLogging::eeLogOptionsPanel::OnLogChecked(wxCommandEvent &event) ////////////////////////////////////////////////////////////////////////////////////////// // -frmLogging::iopLogOptionsPanel::iopLogOptionsPanel( wxWindow* parent ) : +LogOptionsDialog::iopLogOptionsPanel::iopLogOptionsPanel( wxWindow* parent ) : CheckedStaticBox( parent, wxVERTICAL, wxT( "IOP Logs" ), LogID_IopBox ) { AddCheckBox( _T("Disasm"), LogID_Disasm); @@ -113,7 +115,7 @@ frmLogging::iopLogOptionsPanel::iopLogOptionsPanel( wxWindow* parent ) : ////////////////////////////////////////////////////////////////////////////////////////// // -frmLogging::frmLogging(wxWindow* parent, int id, const wxPoint& pos, const wxSize& size): +LogOptionsDialog::LogOptionsDialog(wxWindow* parent, int id, const wxPoint& pos, const wxSize& size): wxDialogWithHelpers( parent, id, _T("Logging"), true, pos, size ) { eeLogOptionsPanel& eeBox = *new eeLogOptionsPanel( this ); @@ -136,11 +138,11 @@ frmLogging::frmLogging(wxWindow* parent, int id, const wxPoint& pos, const wxSiz SetSizerAndFit( &mainsizer, true ); - ConnectChildrenRecurse( this, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(frmLogging::LogChecked) ); + ConnectChildrenRecurse( this, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(LogOptionsDialog::LogChecked) ); } -void frmLogging::LogChecked(wxCommandEvent &evt) +void LogOptionsDialog::LogChecked(wxCommandEvent &evt) { // Anything going here should be a checkbox, unless non-checkbox controls send CheckBox_Clicked commands // (which would seem bad). @@ -154,5 +156,4 @@ void frmLogging::LogChecked(wxCommandEvent &evt) evt.Skip(); } - - +} // End Namespace Dialogs \ No newline at end of file diff --git a/pcsx2/NewGUI/frmLogging.h b/pcsx2/NewGUI/Dialogs/LogOptionsDialog.h similarity index 87% rename from pcsx2/NewGUI/frmLogging.h rename to pcsx2/NewGUI/Dialogs/LogOptionsDialog.h index 71925bcf0a..3d8345fffd 100644 --- a/pcsx2/NewGUI/frmLogging.h +++ b/pcsx2/NewGUI/Dialogs/LogOptionsDialog.h @@ -24,10 +24,12 @@ #include "wxHelpers.h" #include "CheckedStaticBox.h" -class frmLogging: public wxDialogWithHelpers +namespace Dialogs { + +class LogOptionsDialog: public wxDialogWithHelpers { public: - frmLogging( wxWindow* parent, int id, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize ); + LogOptionsDialog( wxWindow* parent, int id, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize ); protected: enum LogChecks @@ -120,3 +122,5 @@ protected: //DECLARE_EVENT_TABLE() }; + +}; // end namespace Dialogs \ No newline at end of file diff --git a/pcsx2/NewGUI/frmMain.cpp b/pcsx2/NewGUI/MainFrame.cpp similarity index 86% rename from pcsx2/NewGUI/frmMain.cpp rename to pcsx2/NewGUI/MainFrame.cpp index 21f33a2729..cc7d57e3ec 100644 --- a/pcsx2/NewGUI/frmMain.cpp +++ b/pcsx2/NewGUI/MainFrame.cpp @@ -17,13 +17,15 @@ */ #include "PrecompiledHeader.h" -#include "frmMain.h" -#include "frmGameFixes.h" -#include "frmLogging.h" +#include "MainFrame.h" +#include "Dialogs/GameFixesDialog.h" +#include "Dialogs/LogOptionsDialog.h" + +using namespace Dialogs; ////////////////////////////////////////////////////////////////////////////////////////// // -wxMenu* frmMain::MakeLanguagesMenu() const +wxMenu* MainEmuFrame::MakeLanguagesMenu() const { wxMenu* menuLangs = new wxMenu(); @@ -34,7 +36,7 @@ wxMenu* frmMain::MakeLanguagesMenu() const return menuLangs; } -wxMenu* frmMain::MakeStatesMenu() +wxMenu* MainEmuFrame::MakeStatesMenu() { wxMenu* mnuStates = new wxMenu(); @@ -46,7 +48,7 @@ wxMenu* frmMain::MakeStatesMenu() return mnuStates; } -wxMenu* frmMain::MakeStatesSubMenu( int baseid ) const +wxMenu* MainEmuFrame::MakeStatesSubMenu( int baseid ) const { wxMenu* mnuSubstates = new wxMenu(); wxString slot( _T("Slot") ); @@ -59,7 +61,7 @@ wxMenu* frmMain::MakeStatesSubMenu( int baseid ) const return mnuSubstates; } -void frmMain::PopulateVideoMenu() +void MainEmuFrame::PopulateVideoMenu() { m_menuVideo.Append( Menu_Video_Basics, _T("Basic Settings..."), wxEmptyString, wxITEM_CHECK ); m_menuVideo.AppendSeparator(); @@ -69,14 +71,14 @@ void frmMain::PopulateVideoMenu() m_menuVideo.Append( Menu_Video_Advanced, _T("Advanced..."), wxEmptyString, wxITEM_NORMAL ); } -void frmMain::PopulateAudioMenu() +void MainEmuFrame::PopulateAudioMenu() { // Populate options from the plugin here. m_menuAudio.Append( Menu_Audio_Advanced, _T("Advanced..."), wxEmptyString, wxITEM_NORMAL ); } -void frmMain::PopulatePadMenu() +void MainEmuFrame::PopulatePadMenu() { // Populate options from the plugin here. @@ -84,9 +86,9 @@ void frmMain::PopulatePadMenu() } #define ConnectMenu( id, handler ) \ - Connect( id, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::handler) ) + Connect( id, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainEmuFrame::handler) ) -void frmMain::OnMoveAround( wxMoveEvent& evt ) +void MainEmuFrame::OnMoveAround( wxMoveEvent& evt ) { if( Conf().ConLogBox.AutoDock ) m_logbox.SetPosition( Conf().ConLogBox.DisplayPos = GetPosition() + wxSize( GetSize().x, 0 ) ); @@ -94,9 +96,9 @@ void frmMain::OnMoveAround( wxMoveEvent& evt ) //evt.Skip(); } -void frmMain::ConnectMenus() +void MainEmuFrame::ConnectMenus() { - Connect( wxEVT_MOVE, wxMoveEventHandler(frmMain::OnMoveAround) ); + Connect( wxEVT_MOVE, wxMoveEventHandler(MainEmuFrame::OnMoveAround) ); // This just seems a bit more flexible & intuitive to me, if overly verbose. @@ -123,19 +125,19 @@ void frmMain::ConnectMenus() ConnectMenu( Menu_Console, Menu_ShowConsole ); } -void frmMain::OnLogBoxShown() +void MainEmuFrame::OnLogBoxShown() { Conf().ConLogBox.Show = true; m_MenuItem_Console.Check( true ); } -void frmMain::OnLogBoxHidden() +void MainEmuFrame::OnLogBoxHidden() { Conf().ConLogBox.Show = false; m_MenuItem_Console.Check( false ); } -frmMain::frmMain(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): +MainEmuFrame::MainEmuFrame(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): wxFrame(parent, id, title, pos, size, wxCAPTION|wxCLOSE_BOX|wxSYSTEM_MENU|wxBORDER_THEME), m_logbox( *new ConsoleLogFrame( this, "Pcsx2 Log" ) ), @@ -290,69 +292,69 @@ frmMain::frmMain(wxWindow* parent, int id, const wxString& title, const wxPoint& m_MenuItem_Console.Check( Conf().ConLogBox.Show ); } -void frmMain::Menu_QuickBootCD_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_QuickBootCD_Click(wxCommandEvent &event) { } -void frmMain::Menu_BootCD_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_BootCD_Click(wxCommandEvent &event) { } -void frmMain::Menu_BootNoCD_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_BootNoCD_Click(wxCommandEvent &event) { } -void frmMain::Menu_OpenELF_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_OpenELF_Click(wxCommandEvent &event) { } -void frmMain::Menu_LoadStateOther_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_LoadStateOther_Click(wxCommandEvent &event) { } -void frmMain::Menu_SaveStateOther_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_SaveStateOther_Click(wxCommandEvent &event) { } -void frmMain::Menu_Exit_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_Exit_Click(wxCommandEvent &event) { Close(); } -void frmMain::Menu_Suspend_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_Suspend_Click(wxCommandEvent &event) { } -void frmMain::Menu_Resume_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_Resume_Click(wxCommandEvent &event) { } -void frmMain::Menu_Reset_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_Reset_Click(wxCommandEvent &event) { } -void frmMain::Menu_Gamefixes_Click( wxCommandEvent& event ) +void MainEmuFrame::Menu_Gamefixes_Click( wxCommandEvent& event ) { - frmGameFixes joe( NULL, wxID_ANY ); + GameFixesDialog joe( NULL, wxID_ANY ); joe.ShowModal(); } -void frmMain::Menu_Debug_Open_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_Debug_Open_Click(wxCommandEvent &event) { } -void frmMain::Menu_Debug_MemoryDump_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_Debug_MemoryDump_Click(wxCommandEvent &event) { } -void frmMain::Menu_Debug_Logging_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_Debug_Logging_Click(wxCommandEvent &event) { - frmLogging joe( NULL, wxID_ANY ); + LogOptionsDialog joe( NULL, wxID_ANY ); joe.ShowModal(); } -void frmMain::Menu_ShowConsole(wxCommandEvent &event) +void MainEmuFrame::Menu_ShowConsole(wxCommandEvent &event) { m_logbox.Show( event.IsChecked() ); } \ No newline at end of file diff --git a/pcsx2/NewGUI/frmMain.h b/pcsx2/NewGUI/MainFrame.h similarity index 96% rename from pcsx2/NewGUI/frmMain.h rename to pcsx2/NewGUI/MainFrame.h index 93c4d341f7..a030b3d3c1 100644 --- a/pcsx2/NewGUI/frmMain.h +++ b/pcsx2/NewGUI/MainFrame.h @@ -25,10 +25,10 @@ ////////////////////////////////////////////////////////////////////////////////////////// // -class frmMain: public wxFrame +class MainEmuFrame: public wxFrame { public: - frmMain(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE); + MainEmuFrame(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE); void OnLogBoxShown(); void OnLogBoxHidden(); diff --git a/pcsx2/NewGUI/main.cpp b/pcsx2/NewGUI/main.cpp index 8ae0b53718..3ddc6e6978 100644 --- a/pcsx2/NewGUI/main.cpp +++ b/pcsx2/NewGUI/main.cpp @@ -17,7 +17,7 @@ */ #include "PrecompiledHeader.h" -#include "frmMain.h" +#include "MainFrame.h" #include @@ -117,7 +117,7 @@ bool Pcsx2App::OnInit() // Allow wx to use our config, and enforces auto-cleanup as well - frmMain* frameMain = new frmMain( NULL, wxID_ANY, wxEmptyString ); + MainEmuFrame* frameMain = new MainEmuFrame( NULL, wxID_ANY, wxEmptyString ); SetTopWindow( frameMain ); frameMain->Show(); diff --git a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj index a65b559e99..d166f7c48f 100644 --- a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj +++ b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj @@ -52,7 +52,7 @@ /> - - - - - - - - - - - - + + + + @@ -2942,6 +2926,26 @@ RelativePath="..\..\NewGUI\wxHelpers.h" > + + + + + + + + + +