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
This commit is contained in:
Jake.Stine 2009-04-02 11:54:19 +00:00
parent 2c3c5401e8
commit 00528b3be3
8 changed files with 114 additions and 96 deletions

View File

@ -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

View File

@ -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();
public:
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);
};
};
}

View File

@ -18,7 +18,7 @@
#include "PrecompiledHeader.h"
#include "DebugTools/Debug.h"
#include "frmLogging.h"
#include "LogOptionsDialog.h"
#include <wx/statline.h>
@ -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

View File

@ -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

View File

@ -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() );
}

View File

@ -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();

View File

@ -17,7 +17,7 @@
*/
#include "PrecompiledHeader.h"
#include "frmMain.h"
#include "MainFrame.h"
#include <wx/image.h>
@ -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();

View File

@ -52,7 +52,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
AdditionalIncludeDirectories="&quot;$(ProjectRootDir)/NewGUI&quot;"
ExceptionHandling="2"
SmallerTypeCheck="false"
UsePrecompiledHeader="2"
@ -133,7 +133,7 @@
Name="VCCLCompilerTool"
Optimization="3"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories=""
AdditionalIncludeDirectories="&quot;$(ProjectRootDir)/NewGUI&quot;"
PreprocessorDefinitions="NDEBUG"
StringPooling="true"
ExceptionHandling="2"
@ -220,7 +220,7 @@
Name="VCCLCompilerTool"
Optimization="3"
EnableFiberSafeOptimizations="true"
AdditionalIncludeDirectories=""
AdditionalIncludeDirectories="&quot;$(ProjectRootDir)/NewGUI&quot;"
PreprocessorDefinitions="NDEBUG"
ExceptionHandling="2"
SmallerTypeCheck="false"
@ -2906,34 +2906,18 @@
RelativePath="..\..\NewGUI\ConsoleLogger.cpp"
>
</File>
<File
RelativePath="..\..\NewGUI\frmGameFixes.cpp"
>
</File>
<File
RelativePath="..\..\NewGUI\frmGameFixes.h"
>
</File>
<File
RelativePath="..\..\NewGUI\frmLogging.cpp"
>
</File>
<File
RelativePath="..\..\NewGUI\frmLogging.h"
>
</File>
<File
RelativePath="..\..\NewGUI\frmMain.cpp"
>
</File>
<File
RelativePath="..\..\NewGUI\frmMain.h"
>
</File>
<File
RelativePath="..\..\NewGUI\main.cpp"
>
</File>
<File
RelativePath="..\..\NewGUI\MainFrame.cpp"
>
</File>
<File
RelativePath="..\..\NewGUI\MainFrame.h"
>
</File>
<File
RelativePath="..\..\NewGUI\wxHelpers.cpp"
>
@ -2942,6 +2926,26 @@
RelativePath="..\..\NewGUI\wxHelpers.h"
>
</File>
<Filter
Name="Dialogs"
>
<File
RelativePath="..\..\NewGUI\Dialogs\GameFixesDialog.cpp"
>
</File>
<File
RelativePath="..\..\NewGUI\Dialogs\GameFixesDialog.h"
>
</File>
<File
RelativePath="..\..\NewGUI\Dialogs\LogOptionsDialog.cpp"
>
</File>
<File
RelativePath="..\..\NewGUI\Dialogs\LogOptionsDialog.h"
>
</File>
</Filter>
</Filter>
<File
RelativePath="..\..\Common.h"