More work on making dialogs close when escape is pressed, and some general GUI code clean up.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7360 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2011-03-16 22:22:21 +00:00
parent 2692ba2697
commit bca4f94b47
16 changed files with 305 additions and 420 deletions

View File

@ -19,11 +19,6 @@
#include "AboutDolphin.h" #include "AboutDolphin.h"
#include "../resources/dolphin_logo.cpp" #include "../resources/dolphin_logo.cpp"
BEGIN_EVENT_TABLE(AboutDolphin, wxDialog)
EVT_CLOSE(AboutDolphin::OnClose)
EVT_BUTTON(wxID_OK, AboutDolphin::CloseClick)
END_EVENT_TABLE()
AboutDolphin::AboutDolphin(wxWindow *parent, wxWindowID id, AboutDolphin::AboutDolphin(wxWindow *parent, wxWindowID id,
const wxString &title, const wxPoint &position, const wxString &title, const wxPoint &position,
const wxSize& size, long style) const wxSize& size, long style)
@ -66,34 +61,17 @@ AboutDolphin::AboutDolphin(wxWindow *parent, wxWindowID id,
Message->Wrap(GetSize().GetWidth()); Message->Wrap(GetSize().GetWidth());
wxBoxSizer* const sInfo = new wxBoxSizer(wxVERTICAL); wxBoxSizer* const sInfo = new wxBoxSizer(wxVERTICAL);
sInfo->Add(Message, 1, wxEXPAND|wxALL, 5); sInfo->Add(Message, 1, wxEXPAND | wxALL, 5);
wxBoxSizer* const sMainHor = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* const sMainHor = new wxBoxSizer(wxHORIZONTAL);
sMainHor->Add(sbDolphinLogo); sMainHor->Add(sbDolphinLogo, 0, wxEXPAND | wxALL, 5);
sMainHor->Add(sInfo); sMainHor->Add(sInfo);
wxBoxSizer* const sButtons = new wxBoxSizer(wxHORIZONTAL);
sButtons->AddStretchSpacer();
sButtons->Add(new wxButton(this, wxID_OK, _("Close")), 0, wxALL, 5);
wxBoxSizer* const sMain = new wxBoxSizer(wxVERTICAL); wxBoxSizer* const sMain = new wxBoxSizer(wxVERTICAL);
sMain->Add(sMainHor, 1, wxEXPAND); sMain->Add(sMainHor, 1, wxEXPAND);
sMain->Add(sButtons, 0, wxEXPAND); sMain->Add(CreateButtonSizer(wxOK), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
SetSizer(sMain); SetSizerAndFit(sMain);
Layout();
Fit();
Center(); Center();
SetFocus(); SetFocus();
} }
void AboutDolphin::OnClose(wxCloseEvent& WXUNUSED(event))
{
EndModal(wxID_CLOSE);
}
void AboutDolphin::CloseClick(wxCommandEvent& WXUNUSED(event))
{
Close();
}

View File

@ -34,12 +34,6 @@ class AboutDolphin : public wxDialog
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE); long style = wxDEFAULT_DIALOG_STYLE);
private:
DECLARE_EVENT_TABLE();
void CloseClick(wxCommandEvent& event);
void OnClose(wxCloseEvent& event);
}; };
#endif //_ABOUTDOLPHIN_H_ #endif //_ABOUTDOLPHIN_H_

View File

@ -927,32 +927,23 @@ void CConfigMain::CreateGUIControls()
sPathsPage->Add(sOtherPaths, 0, wxEXPAND|wxALL, 5); sPathsPage->Add(sOtherPaths, 0, wxEXPAND|wxALL, 5);
PathsPage->SetSizer(sPathsPage); PathsPage->SetSizer(sPathsPage);
m_Ok = new wxButton(this, wxID_OK);
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
sButtons->Add(0, 0, 1, wxEXPAND, 5);
sButtons->Add(m_Ok, 0, wxALL, 5);
wxBoxSizer* sMain = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sMain = new wxBoxSizer(wxVERTICAL);
sMain->Add(Notebook, 1, wxEXPAND|wxALL, 5); sMain->Add(Notebook, 1, wxEXPAND|wxALL, 5);
sMain->Add(sButtons, 0, wxEXPAND, 5); sMain->Add(CreateButtonSizer(wxOK), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
InitializeGUIValues(); InitializeGUIValues();
InitializeGUITooltips(); InitializeGUITooltips();
UpdateGUI(); UpdateGUI();
SetSizer(sMain); SetSizerAndFit(sMain);
Layout();
Fit();
Center(); Center();
Notebook->SetSelection(0); SetFocus();
} }
void CConfigMain::OnClose(wxCloseEvent& WXUNUSED (event)) void CConfigMain::OnClose(wxCloseEvent& WXUNUSED (event))
{ {
EndModal((bRefreshList) ? wxID_OK : wxID_CLOSE); EndModal((bRefreshList) ? wxID_OK : wxID_CANCEL);
} }
void CConfigMain::OnOk(wxCommandEvent& WXUNUSED (event)) void CConfigMain::OnOk(wxCommandEvent& WXUNUSED (event))

View File

@ -63,7 +63,7 @@ void HotkeyConfigDialog::EndGetButtons(void)
GetButtonWaitingTimer = 0; GetButtonWaitingTimer = 0;
GetButtonWaitingID = 0; GetButtonWaitingID = 0;
ClickedButton = NULL; ClickedButton = NULL;
SetEscapeId(wxID_OK); SetEscapeId(wxID_ANY);
} }
void HotkeyConfigDialog::OnKeyDown(wxKeyEvent& event) void HotkeyConfigDialog::OnKeyDown(wxKeyEvent& event)
@ -159,7 +159,7 @@ void HotkeyConfigDialog::OnButtonClick(wxCommandEvent& event)
// Get the button // Get the button
ClickedButton = (wxButton *)event.GetEventObject(); ClickedButton = (wxButton *)event.GetEventObject();
SetEscapeId(wxID_NONE); SetEscapeId(wxID_CANCEL);
// Save old label so we can revert back // Save old label so we can revert back
OldLabel = ClickedButton->GetLabel(); OldLabel = ClickedButton->GetLabel();
ClickedButton->SetWindowStyle(wxWANTS_CHARS); ClickedButton->SetWindowStyle(wxWANTS_CHARS);
@ -281,13 +281,9 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls(void)
Page->SetSizer(sPage); Page->SetSizer(sPage);
} }
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
sButtons->AddStretchSpacer();
sButtons->Add(new wxButton(this, wxID_OK, _("Close")), 0, (wxLEFT), 5);
wxBoxSizer *sMainSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *sMainSizer = new wxBoxSizer(wxVERTICAL);
sMainSizer->Add(Notebook, 0, wxEXPAND | wxALL, 5); sMainSizer->Add(Notebook, 0, wxEXPAND | wxALL, 5);
sMainSizer->Add(sButtons, 0, wxEXPAND | (wxLEFT | wxRIGHT | wxDOWN), 5); sMainSizer->Add(CreateButtonSizer(wxOK), 0, wxEXPAND | wxLEFT | wxRIGHT | wxDOWN, 5);
SetSizerAndFit(sMainSizer); SetSizerAndFit(sMainSizer);
SetFocus(); SetFocus();
} }

View File

@ -149,7 +149,9 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
if (GameIni.Load(GameIniFile.c_str())) if (GameIni.Load(GameIniFile.c_str()))
LoadGameConfig(); LoadGameConfig();
else else
wxMessageBox(wxString::Format(_("Could not create %s"), wxString::From8BitData(GameIniFile.c_str()).c_str()), _("Error"), wxOK|wxICON_ERROR, this); wxMessageBox(wxString::Format(_("Could not create %s"),
wxString::From8BitData(GameIniFile.c_str()).c_str()),
_("Error"), wxOK|wxICON_ERROR, this);
} }
// Disk header and apploader // Disk header and apploader
@ -206,34 +208,31 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
wxMouseEventHandler(CISOProperties::RightClickOnBanner), (wxObject*)NULL, this); wxMouseEventHandler(CISOProperties::RightClickOnBanner), (wxObject*)NULL, this);
// Filesystem browser/dumper // Filesystem browser/dumper
// TODO : Should we add a way to browse the wad file ?
if (!DiscIO::IsVolumeWadFile(OpenISO))
{
if (DiscIO::IsVolumeWiiDisc(OpenISO)) if (DiscIO::IsVolumeWiiDisc(OpenISO))
{ {
for (u32 i = 0; i < WiiDisc.size(); i++) for (u32 i = 0; i < WiiDisc.size(); i++)
{ {
WiiPartition partition = WiiDisc.at(i); WiiPartition partition = WiiDisc.at(i);
wxTreeItemId PartitionRoot = m_Treectrl->AppendItem(RootId, wxString::Format(_("Partition %i"), i), 0, 0, 0); wxTreeItemId PartitionRoot =
m_Treectrl->AppendItem(RootId, wxString::Format(_("Partition %i"), i));
CreateDirectoryTree(PartitionRoot, partition.Files, 1, partition.Files.at(0)->m_FileSize); CreateDirectoryTree(PartitionRoot, partition.Files, 1, partition.Files.at(0)->m_FileSize);
if (i == 1) if (i == 1)
m_Treectrl->Expand(PartitionRoot); m_Treectrl->Expand(PartitionRoot);
} }
} }
else else if (!GCFiles.empty())
{
// TODO : Should we add a way to browse the wad file ?
if (!DiscIO::IsVolumeWadFile(OpenISO))
{
if (!GCFiles.empty())
CreateDirectoryTree(RootId, GCFiles, 1, GCFiles.at(0)->m_FileSize); CreateDirectoryTree(RootId, GCFiles, 1, GCFiles.at(0)->m_FileSize);
}
}
m_Treectrl->Expand(RootId); m_Treectrl->Expand(RootId);
}
} }
CISOProperties::~CISOProperties() CISOProperties::~CISOProperties()
{ {
if (!IsVolumeWiiDisc(OpenISO)) if (!IsVolumeWiiDisc(OpenISO) && !IsVolumeWadFile(OpenISO) && pFileSystem)
if (!IsVolumeWadFile(OpenISO))
if (pFileSystem)
delete pFileSystem; delete pFileSystem;
// two vector's items are no longer valid after deleting filesystem // two vector's items are no longer valid after deleting filesystem
WiiDisc.clear(); WiiDisc.clear();
@ -280,34 +279,30 @@ size_t CISOProperties::CreateDirectoryTree(wxTreeItemId& parent,
void CISOProperties::CreateGUIControls(bool IsWad) void CISOProperties::CreateGUIControls(bool IsWad)
{ {
m_Close = new wxButton(this, wxID_OK, _("Close"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); wxButton * const EditConfig =
EditConfig = new wxButton(this, ID_EDITCONFIG, _("Edit Config"), wxDefaultPosition, wxDefaultSize); new wxButton(this, ID_EDITCONFIG, _("Edit Config"), wxDefaultPosition, wxDefaultSize);
EditConfig->SetToolTip(_("This will let you Manually Edit the INI config file")); EditConfig->SetToolTip(_("This will let you Manually Edit the INI config file"));
// Notebook // Notebook
m_Notebook = new wxNotebook(this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize); wxNotebook * const m_Notebook =
m_GameConfig = new wxPanel(m_Notebook, ID_GAMECONFIG, wxDefaultPosition, wxDefaultSize); new wxNotebook(this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize);
wxPanel * const m_GameConfig =
new wxPanel(m_Notebook, ID_GAMECONFIG, wxDefaultPosition, wxDefaultSize);
m_Notebook->AddPage(m_GameConfig, _("GameConfig")); m_Notebook->AddPage(m_GameConfig, _("GameConfig"));
m_PatchPage = new wxPanel(m_Notebook, ID_PATCH_PAGE, wxDefaultPosition, wxDefaultSize); wxPanel * const m_PatchPage =
new wxPanel(m_Notebook, ID_PATCH_PAGE, wxDefaultPosition, wxDefaultSize);
m_Notebook->AddPage(m_PatchPage, _("Patches")); m_Notebook->AddPage(m_PatchPage, _("Patches"));
m_CheatPage = new wxPanel(m_Notebook, ID_ARCODE_PAGE, wxDefaultPosition, wxDefaultSize); wxPanel * const m_CheatPage =
new wxPanel(m_Notebook, ID_ARCODE_PAGE, wxDefaultPosition, wxDefaultSize);
m_Notebook->AddPage(m_CheatPage, _("AR Codes")); m_Notebook->AddPage(m_CheatPage, _("AR Codes"));
m_geckocode_panel = new Gecko::CodeConfigPanel(m_Notebook); m_geckocode_panel = new Gecko::CodeConfigPanel(m_Notebook);
m_Notebook->AddPage(m_geckocode_panel, _("Gecko Codes")); m_Notebook->AddPage(m_geckocode_panel, _("Gecko Codes"));
m_Information = new wxPanel(m_Notebook, ID_INFORMATION, wxDefaultPosition, wxDefaultSize); wxPanel * const m_Information =
new wxPanel(m_Notebook, ID_INFORMATION, wxDefaultPosition, wxDefaultSize);
m_Notebook->AddPage(m_Information, _("Info")); m_Notebook->AddPage(m_Information, _("Info"));
m_Filesystem = new wxPanel(m_Notebook, ID_FILESYSTEM, wxDefaultPosition, wxDefaultSize);
m_Notebook->AddPage(m_Filesystem, _("Filesystem"));
wxBoxSizer* sButtons;
sButtons = new wxBoxSizer(wxHORIZONTAL);
sButtons->Add(EditConfig, 0, wxALL, 5);
sButtons->Add(0, 0, 1, wxEXPAND, 5);
sButtons->Add(m_Close, 0, wxALL, 5);
// GameConfig editing - Overrides and emulation state // GameConfig editing - Overrides and emulation state
OverrideText = new wxStaticText(m_GameConfig, ID_OVERRIDE_TEXT, _("These settings override core Dolphin settings.\nUndetermined means the game uses Dolphin's setting."), wxDefaultPosition, wxDefaultSize); wxStaticText * const OverrideText = new wxStaticText(m_GameConfig, wxID_ANY, _("These settings override core Dolphin settings.\nUndetermined means the game uses Dolphin's setting."));
// Core // Core
CPUThread = new wxCheckBox(m_GameConfig, ID_USEDUALCORE, _("Enable Dual Core"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); CPUThread = new wxCheckBox(m_GameConfig, ID_USEDUALCORE, _("Enable Dual Core"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
SkipIdle = new wxCheckBox(m_GameConfig, ID_IDLESKIP, _("Enable Idle Skipping"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); SkipIdle = new wxCheckBox(m_GameConfig, ID_IDLESKIP, _("Enable Idle Skipping"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
@ -328,30 +323,32 @@ void CISOProperties::CreateGUIControls(bool IsWad)
EnableProgressiveScan = new wxCheckBox(m_GameConfig, ID_ENABLEPROGRESSIVESCAN, _("Enable Progressive Scan"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); EnableProgressiveScan = new wxCheckBox(m_GameConfig, ID_ENABLEPROGRESSIVESCAN, _("Enable Progressive Scan"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
EnableWideScreen = new wxCheckBox(m_GameConfig, ID_ENABLEWIDESCREEN, _("Enable WideScreen"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); EnableWideScreen = new wxCheckBox(m_GameConfig, ID_ENABLEWIDESCREEN, _("Enable WideScreen"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
// Video // Video
UseZTPSpeedupHack = new wxCheckBox(m_GameConfig, ID_ZTP_SPEEDUP, _("ZTP hack"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); UseZTPSpeedupHack = new wxCheckBox(m_GameConfig, ID_ZTP_SPEEDUP, _("ZTP hack"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER);
UseZTPSpeedupHack->SetToolTip(_("Enable this to speed up The Legend of Zelda: Twilight Princess. Disable for ANY other game.")); UseZTPSpeedupHack->SetToolTip(_("Enable this to speed up The Legend of Zelda: Twilight Princess. Disable for ANY other game."));
// Hack // Hack
szrPHackSettings = new wxFlexGridSizer(0); wxFlexGridSizer * const szrPHackSettings = new wxFlexGridSizer(0);
PHackEnable = new wxCheckBox(m_GameConfig, ID_PHACKENABLE, _("Custom Projection Hack"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE, wxDefaultValidator); PHackEnable = new wxCheckBox(m_GameConfig, ID_PHACKENABLE, _("Custom Projection Hack"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
PHackEnable->SetToolTip(_("Enables Custom Projection Hack")); PHackEnable->SetToolTip(_("Enables Custom Projection Hack"));
PHSettings = new wxButton(m_GameConfig, ID_PHSETTINGS, _("Settings..."), wxDefaultPosition, wxDefaultSize, 0); PHSettings = new wxButton(m_GameConfig, ID_PHSETTINGS, _("Settings..."));
PHSettings->SetToolTip(_("Customize some Orthographic Projection parameters.")); PHSettings->SetToolTip(_("Customize some Orthographic Projection parameters."));
sEmuState = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer * const sEmuState = new wxBoxSizer(wxHORIZONTAL);
EmuStateText = new wxStaticText(m_GameConfig, ID_EMUSTATE_TEXT, _("Emulation State: "), wxDefaultPosition, wxDefaultSize); wxStaticText * const EmuStateText =
new wxStaticText(m_GameConfig, wxID_ANY, _("Emulation State: "));
arrayStringFor_EmuState.Add(_("Not Set")); arrayStringFor_EmuState.Add(_("Not Set"));
arrayStringFor_EmuState.Add(_("Broken")); arrayStringFor_EmuState.Add(_("Broken"));
arrayStringFor_EmuState.Add(_("Intro")); arrayStringFor_EmuState.Add(_("Intro"));
arrayStringFor_EmuState.Add(_("In Game")); arrayStringFor_EmuState.Add(_("In Game"));
arrayStringFor_EmuState.Add(_("Playable")); arrayStringFor_EmuState.Add(_("Playable"));
arrayStringFor_EmuState.Add(_("Perfect")); arrayStringFor_EmuState.Add(_("Perfect"));
EmuState = new wxChoice(m_GameConfig, ID_EMUSTATE, wxDefaultPosition, wxDefaultSize, arrayStringFor_EmuState, 0, wxDefaultValidator); EmuState = new wxChoice(m_GameConfig, ID_EMUSTATE,
EmuIssues = new wxTextCtrl(m_GameConfig, ID_EMU_ISSUES, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); wxDefaultPosition, wxDefaultSize, arrayStringFor_EmuState);
EmuIssues = new wxTextCtrl(m_GameConfig, ID_EMU_ISSUES, wxEmptyString);
wxBoxSizer* sConfigPage; wxBoxSizer * const sConfigPage = new wxBoxSizer(wxVERTICAL);
sConfigPage = new wxBoxSizer(wxVERTICAL); wxStaticBoxSizer * const sbCoreOverrides =
sbCoreOverrides = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Core")); new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Core"));
sbCoreOverrides->Add(CPUThread, 0, wxLEFT, 5); sbCoreOverrides->Add(CPUThread, 0, wxLEFT, 5);
sbCoreOverrides->Add(SkipIdle, 0, wxLEFT, 5); sbCoreOverrides->Add(SkipIdle, 0, wxLEFT, 5);
sbCoreOverrides->Add(MMU, 0, wxLEFT, 5); sbCoreOverrides->Add(MMU, 0, wxLEFT, 5);
@ -362,7 +359,8 @@ void CISOProperties::CreateGUIControls(bool IsWad)
sbCoreOverrides->Add(BlockMerging, 0, wxLEFT, 5); sbCoreOverrides->Add(BlockMerging, 0, wxLEFT, 5);
sbCoreOverrides->Add(DSPHLE, 0, wxLEFT, 5); sbCoreOverrides->Add(DSPHLE, 0, wxLEFT, 5);
sbWiiOverrides = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Wii Console")); wxStaticBoxSizer * const sbWiiOverrides =
new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Wii Console"));
if (!DiscIO::IsVolumeWiiDisc(OpenISO) && !DiscIO::IsVolumeWadFile(OpenISO)) if (!DiscIO::IsVolumeWiiDisc(OpenISO) && !DiscIO::IsVolumeWadFile(OpenISO))
{ {
sbWiiOverrides->ShowItems(false); sbWiiOverrides->ShowItems(false);
@ -379,13 +377,15 @@ void CISOProperties::CreateGUIControls(bool IsWad)
sbWiiOverrides->Add(EnableProgressiveScan, 0, wxLEFT, 5); sbWiiOverrides->Add(EnableProgressiveScan, 0, wxLEFT, 5);
sbWiiOverrides->Add(EnableWideScreen, 0, wxLEFT, 5); sbWiiOverrides->Add(EnableWideScreen, 0, wxLEFT, 5);
sbVideoOverrides = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Video")); wxStaticBoxSizer * const sbVideoOverrides =
new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Video"));
sbVideoOverrides->Add(UseZTPSpeedupHack, 0, wxLEFT, 5); sbVideoOverrides->Add(UseZTPSpeedupHack, 0, wxLEFT, 5);
szrPHackSettings->Add(PHackEnable, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5); szrPHackSettings->Add(PHackEnable, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5);
szrPHackSettings->Add(PHSettings, 0, wxLEFT, 5); szrPHackSettings->Add(PHSettings, 0, wxLEFT, 5);
sbVideoOverrides->Add(szrPHackSettings, 0, wxEXPAND); sbVideoOverrides->Add(szrPHackSettings, 0, wxEXPAND);
sbGameConfig = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Game-Specific Settings")); wxStaticBoxSizer * const sbGameConfig =
new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Game-Specific Settings"));
sbGameConfig->Add(OverrideText, 0, wxEXPAND|wxALL, 5); sbGameConfig->Add(OverrideText, 0, wxEXPAND|wxALL, 5);
sbGameConfig->Add(sbCoreOverrides, 0, wxEXPAND); sbGameConfig->Add(sbCoreOverrides, 0, wxEXPAND);
sbGameConfig->Add(sbWiiOverrides, 0, wxEXPAND); sbGameConfig->Add(sbWiiOverrides, 0, wxEXPAND);
@ -399,17 +399,17 @@ void CISOProperties::CreateGUIControls(bool IsWad)
// Patches // Patches
sPatches = new wxBoxSizer(wxVERTICAL); wxBoxSizer * const sPatches = new wxBoxSizer(wxVERTICAL);
Patches = new wxCheckListBox(m_PatchPage, ID_PATCHES_LIST, wxDefaultPosition, wxDefaultSize, arrayStringFor_Patches, wxLB_HSCROLL, wxDefaultValidator); Patches = new wxCheckListBox(m_PatchPage, ID_PATCHES_LIST, wxDefaultPosition,
sPatchButtons = new wxBoxSizer(wxHORIZONTAL); wxDefaultSize, arrayStringFor_Patches, wxLB_HSCROLL);
EditPatch = new wxButton(m_PatchPage, ID_EDITPATCH, _("Edit..."), wxDefaultPosition, wxDefaultSize, 0); wxBoxSizer * const sPatchButtons = new wxBoxSizer(wxHORIZONTAL);
AddPatch = new wxButton(m_PatchPage, ID_ADDPATCH, _("Add..."), wxDefaultPosition, wxDefaultSize, 0); EditPatch = new wxButton(m_PatchPage, ID_EDITPATCH, _("Edit..."));
RemovePatch = new wxButton(m_PatchPage, ID_REMOVEPATCH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0); wxButton * const AddPatch = new wxButton(m_PatchPage, ID_ADDPATCH, _("Add..."));
RemovePatch = new wxButton(m_PatchPage, ID_REMOVEPATCH, _("Remove"));
EditPatch->Enable(false); EditPatch->Enable(false);
RemovePatch->Enable(false); RemovePatch->Enable(false);
wxBoxSizer* sPatchPage; wxBoxSizer* sPatchPage = new wxBoxSizer(wxVERTICAL);
sPatchPage = new wxBoxSizer(wxVERTICAL);
sPatches->Add(Patches, 1, wxEXPAND|wxALL, 0); sPatches->Add(Patches, 1, wxEXPAND|wxALL, 0);
sPatchButtons->Add(EditPatch, 0, wxEXPAND|wxALL, 0); sPatchButtons->Add(EditPatch, 0, wxEXPAND|wxALL, 0);
sPatchButtons->AddStretchSpacer(); sPatchButtons->AddStretchSpacer();
@ -421,17 +421,18 @@ void CISOProperties::CreateGUIControls(bool IsWad)
// Action Replay Cheats // Action Replay Cheats
sCheats = new wxBoxSizer(wxVERTICAL); wxBoxSizer * const sCheats = new wxBoxSizer(wxVERTICAL);
Cheats = new wxCheckListBox(m_CheatPage, ID_CHEATS_LIST, wxDefaultPosition, wxDefaultSize, arrayStringFor_Cheats, wxLB_HSCROLL, wxDefaultValidator); Cheats = new wxCheckListBox(m_CheatPage, ID_CHEATS_LIST, wxDefaultPosition,
sCheatButtons = new wxBoxSizer(wxHORIZONTAL); wxDefaultSize, arrayStringFor_Cheats, wxLB_HSCROLL);
EditCheat = new wxButton(m_CheatPage, ID_EDITCHEAT, _("Edit..."), wxDefaultPosition, wxDefaultSize, 0); wxBoxSizer * const sCheatButtons = new wxBoxSizer(wxHORIZONTAL);
AddCheat = new wxButton(m_CheatPage, ID_ADDCHEAT, _("Add..."), wxDefaultPosition, wxDefaultSize, 0); EditCheat = new wxButton(m_CheatPage, ID_EDITCHEAT, _("Edit..."));
RemoveCheat = new wxButton(m_CheatPage, ID_REMOVECHEAT, _("Remove"), wxDefaultPosition, wxDefaultSize, 0); wxButton * const AddCheat = new wxButton(m_CheatPage, ID_ADDCHEAT, _("Add..."));
RemoveCheat = new wxButton(m_CheatPage, ID_REMOVECHEAT, _("Remove"),
wxDefaultPosition, wxDefaultSize, 0);
EditCheat->Enable(false); EditCheat->Enable(false);
RemoveCheat->Enable(false); RemoveCheat->Enable(false);
wxBoxSizer* sCheatPage; wxBoxSizer* sCheatPage = new wxBoxSizer(wxVERTICAL);
sCheatPage = new wxBoxSizer(wxVERTICAL);
sCheats->Add(Cheats, 1, wxEXPAND|wxALL, 0); sCheats->Add(Cheats, 1, wxEXPAND|wxALL, 0);
sCheatButtons->Add(EditCheat, 0, wxEXPAND|wxALL, 0); sCheatButtons->Add(EditCheat, 0, wxEXPAND|wxALL, 0);
sCheatButtons->AddStretchSpacer(); sCheatButtons->AddStretchSpacer();
@ -442,39 +443,51 @@ void CISOProperties::CreateGUIControls(bool IsWad)
m_CheatPage->SetSizer(sCheatPage); m_CheatPage->SetSizer(sCheatPage);
m_NameText = new wxStaticText(m_Information, ID_NAME_TEXT, _("Name:"), wxDefaultPosition, wxDefaultSize); wxStaticText * const m_NameText =
m_Name = new wxTextCtrl(m_Information, ID_NAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY); new wxStaticText(m_Information, wxID_ANY, _("Name:"));
m_GameIDText = new wxStaticText(m_Information, ID_GAMEID_TEXT, _("Game ID:"), wxDefaultPosition, wxDefaultSize); m_Name = new wxTextCtrl(m_Information, ID_NAME, wxEmptyString,
m_GameID = new wxTextCtrl(m_Information, ID_GAMEID, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY); wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_CountryText = new wxStaticText(m_Information, ID_COUNTRY_TEXT, _("Country:"), wxDefaultPosition, wxDefaultSize); wxStaticText * const m_GameIDText =
m_Country = new wxTextCtrl(m_Information, ID_COUNTRY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY); new wxStaticText(m_Information, wxID_ANY, _("Game ID:"));
m_MakerIDText = new wxStaticText(m_Information, ID_MAKERID_TEXT, _("Maker ID:"), wxDefaultPosition, wxDefaultSize); m_GameID = new wxTextCtrl(m_Information, ID_GAMEID, wxEmptyString,
m_MakerID = new wxTextCtrl(m_Information, ID_MAKERID, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY); wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_DateText = new wxStaticText(m_Information, ID_DATE_TEXT, _("Date:"), wxDefaultPosition, wxDefaultSize); wxStaticText * const m_CountryText =
m_Date = new wxTextCtrl(m_Information, ID_DATE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY); new wxStaticText(m_Information, wxID_ANY, _("Country:"));
m_FSTText = new wxStaticText(m_Information, ID_FST_TEXT, _("FST Size:"), wxDefaultPosition, wxDefaultSize); m_Country = new wxTextCtrl(m_Information, ID_COUNTRY, wxEmptyString,
m_FST = new wxTextCtrl(m_Information, ID_FST, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY); wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
wxStaticText * const m_MakerIDText =
new wxStaticText(m_Information, wxID_ANY, _("Maker ID:"));
m_MakerID = new wxTextCtrl(m_Information, ID_MAKERID, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
wxStaticText * const m_DateText =
new wxStaticText(m_Information, wxID_ANY, _("Date:"));
m_Date = new wxTextCtrl(m_Information, ID_DATE, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
wxStaticText * const m_FSTText =
new wxStaticText(m_Information, wxID_ANY, _("FST Size:"));
m_FST = new wxTextCtrl(m_Information, ID_FST, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_LangText = new wxStaticText(m_Information, ID_LANG_TEXT, _("Show Language:"), wxDefaultPosition, wxDefaultSize); wxStaticText * const m_LangText = new wxStaticText(m_Information, wxID_ANY, _("Show Language:"));
arrayStringFor_Lang.Add(_("English")); arrayStringFor_Lang.Add(_("English"));
arrayStringFor_Lang.Add(_("German")); arrayStringFor_Lang.Add(_("German"));
arrayStringFor_Lang.Add(_("French")); arrayStringFor_Lang.Add(_("French"));
arrayStringFor_Lang.Add(_("Spanish")); arrayStringFor_Lang.Add(_("Spanish"));
arrayStringFor_Lang.Add(_("Italian")); arrayStringFor_Lang.Add(_("Italian"));
arrayStringFor_Lang.Add(_("Dutch")); arrayStringFor_Lang.Add(_("Dutch"));
m_Lang = new wxChoice(m_Information, ID_LANG, wxDefaultPosition, wxDefaultSize, arrayStringFor_Lang, 0, wxDefaultValidator); m_Lang = new wxChoice(m_Information, ID_LANG, wxDefaultPosition, wxDefaultSize, arrayStringFor_Lang);
m_Lang->SetSelection((int)SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage); m_Lang->SetSelection((int)SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage);
m_ShortText = new wxStaticText(m_Information, ID_SHORTNAME_TEXT, _("Short Name:"), wxDefaultPosition, wxDefaultSize); wxStaticText * const m_ShortText = new wxStaticText(m_Information, wxID_ANY, _("Short Name:"));
m_ShortName = new wxTextCtrl(m_Information, ID_SHORTNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY); m_ShortName = new wxTextCtrl(m_Information, ID_SHORTNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_MakerText = new wxStaticText(m_Information, ID_MAKER_TEXT, _("Maker:"), wxDefaultPosition, wxDefaultSize); wxStaticText * const m_MakerText = new wxStaticText(m_Information, wxID_ANY, _("Maker:"));
m_Maker = new wxTextCtrl(m_Information, ID_MAKER, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY); m_Maker = new wxTextCtrl(m_Information, ID_MAKER, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_CommentText = new wxStaticText(m_Information, ID_COMMENT_TEXT, _("Comment:"), wxDefaultPosition, wxDefaultSize); wxStaticText * const m_CommentText = new wxStaticText(m_Information, wxID_ANY, _("Comment:"));
m_Comment = new wxTextCtrl(m_Information, ID_COMMENT, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY); m_Comment = new wxTextCtrl(m_Information, ID_COMMENT, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY);
m_BannerText = new wxStaticText(m_Information, ID_BANNER_TEXT, _("Banner:"), wxDefaultPosition, wxDefaultSize); wxStaticText * const m_BannerText = new wxStaticText(m_Information, wxID_ANY, _("Banner:"));
m_Banner = new wxStaticBitmap(m_Information, ID_BANNER, wxNullBitmap, wxDefaultPosition, wxSize(96, 32), 0); m_Banner = new wxStaticBitmap(m_Information, ID_BANNER, wxNullBitmap, wxDefaultPosition, wxSize(96, 32), 0);
// ISO Details // ISO Details
sISODetails = new wxGridBagSizer(0, 0); wxGridBagSizer * const sISODetails = new wxGridBagSizer(0, 0);
sISODetails->Add(m_NameText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5); sISODetails->Add(m_NameText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_Name, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5); sISODetails->Add(m_Name, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->Add(m_GameIDText, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5); sISODetails->Add(m_GameIDText, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
@ -488,11 +501,12 @@ void CISOProperties::CreateGUIControls(bool IsWad)
sISODetails->Add(m_FSTText, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5); sISODetails->Add(m_FSTText, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_FST, wxGBPosition(5, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5); sISODetails->Add(m_FST, wxGBPosition(5, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->AddGrowableCol(1); sISODetails->AddGrowableCol(1);
sbISODetails = new wxStaticBoxSizer(wxVERTICAL, m_Information, _("ISO Details")); wxStaticBoxSizer * const sbISODetails =
new wxStaticBoxSizer(wxVERTICAL, m_Information, _("ISO Details"));
sbISODetails->Add(sISODetails, 0, wxEXPAND, 5); sbISODetails->Add(sISODetails, 0, wxEXPAND, 5);
// Banner Details // Banner Details
sBannerDetails = new wxGridBagSizer(0, 0); wxGridBagSizer * const sBannerDetails = new wxGridBagSizer(0, 0);
sBannerDetails->Add(m_LangText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5); sBannerDetails->Add(m_LangText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sBannerDetails->Add(m_Lang, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5); sBannerDetails->Add(m_Lang, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sBannerDetails->Add(m_ShortText, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5); sBannerDetails->Add(m_ShortText, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
@ -504,47 +518,52 @@ void CISOProperties::CreateGUIControls(bool IsWad)
sBannerDetails->Add(m_BannerText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALL, 5); sBannerDetails->Add(m_BannerText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALL, 5);
sBannerDetails->Add(m_Banner, wxGBPosition(4, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5); sBannerDetails->Add(m_Banner, wxGBPosition(4, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sBannerDetails->AddGrowableCol(1); sBannerDetails->AddGrowableCol(1);
sbBannerDetails = new wxStaticBoxSizer(wxVERTICAL, m_Information, _("Banner Details")); wxStaticBoxSizer * const sbBannerDetails =
new wxStaticBoxSizer(wxVERTICAL, m_Information, _("Banner Details"));
sbBannerDetails->Add(sBannerDetails, 0, wxEXPAND, 5); sbBannerDetails->Add(sBannerDetails, 0, wxEXPAND, 5);
wxBoxSizer* sInfoPage; wxBoxSizer * const sInfoPage = new wxBoxSizer(wxVERTICAL);
sInfoPage = new wxBoxSizer(wxVERTICAL);
sInfoPage->Add(sbISODetails, 0, wxEXPAND|wxALL, 5); sInfoPage->Add(sbISODetails, 0, wxEXPAND|wxALL, 5);
sInfoPage->Add(sbBannerDetails, 0, wxEXPAND|wxALL, 5); sInfoPage->Add(sbBannerDetails, 0, wxEXPAND|wxALL, 5);
m_Information->SetSizer(sInfoPage); m_Information->SetSizer(sInfoPage);
if (!IsWad)
{
wxPanel * const m_Filesystem =
new wxPanel(m_Notebook, ID_FILESYSTEM, wxDefaultPosition, wxDefaultSize);
m_Notebook->AddPage(m_Filesystem, _("Filesystem"));
// Filesystem icons // Filesystem icons
m_iconList = new wxImageList(16, 16); wxImageList * const m_iconList = new wxImageList(16, 16);
m_iconList->Add(wxBitmap(disc_xpm), wxNullBitmap); // 0 m_iconList->Add(wxBitmap(disc_xpm), wxNullBitmap); // 0
m_iconList->Add(wxBitmap(folder_xpm), wxNullBitmap); // 1 m_iconList->Add(wxBitmap(folder_xpm), wxNullBitmap); // 1
m_iconList->Add(wxBitmap(file_xpm), wxNullBitmap); // 2 m_iconList->Add(wxBitmap(file_xpm), wxNullBitmap); // 2
// Filesystem tree // Filesystem tree
m_Treectrl = new wxTreeCtrl(m_Filesystem, ID_TREECTRL, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE, wxDefaultValidator); m_Treectrl = new wxTreeCtrl(m_Filesystem, ID_TREECTRL,
wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE);
m_Treectrl->AssignImageList(m_iconList); m_Treectrl->AssignImageList(m_iconList);
RootId = m_Treectrl->AddRoot(_("Disc"), 0, 0, 0); RootId = m_Treectrl->AddRoot(_("Disc"), 0, 0, 0);
wxBoxSizer* sTreePage; wxBoxSizer* sTreePage = new wxBoxSizer(wxVERTICAL);
sTreePage = new wxBoxSizer(wxVERTICAL);
sTreePage->Add(m_Treectrl, 1, wxEXPAND|wxALL, 5); sTreePage->Add(m_Treectrl, 1, wxEXPAND|wxALL, 5);
m_Filesystem->SetSizer(sTreePage); m_Filesystem->SetSizer(sTreePage);
}
// It's a wad file, so we remove the FileSystem page wxSizer* sButtons = CreateButtonSizer(wxNO_DEFAULT);
if (IsWad) sButtons->Prepend(EditConfig, 0, wxALL, 5);
m_Notebook->RemovePage(4); sButtons->Add(new wxButton(this, wxID_OK, _("Close")), 0, wxALL, 5);
m_Notebook->SetSelection(0);
// Add notebook and buttons to the dialog // Add notebook and buttons to the dialog
wxBoxSizer* sMain; wxBoxSizer* sMain;
sMain = new wxBoxSizer(wxVERTICAL); sMain = new wxBoxSizer(wxVERTICAL);
sMain->Add(m_Notebook, 1, wxEXPAND|wxALL, 5); sMain->Add(m_Notebook, 1, wxEXPAND|wxALL, 5);
sMain->Add(sButtons, 0, wxEXPAND, 5); sMain->Add(sButtons, 0, wxEXPAND, 5);
sMain->SetMinSize(wxSize(550, 600)); sMain->SetMinSize(wxSize(500, -1));
SetSizerAndFit(sMain); SetSizerAndFit(sMain);
Layout();
Center(); Center();
SetFocus();
} }
void CISOProperties::OnCheckBoxClicked(wxCommandEvent& event) void CISOProperties::OnCheckBoxClicked(wxCommandEvent& event)

View File

@ -48,8 +48,7 @@ struct PHackData
class CISOProperties : public wxDialog class CISOProperties : public wxDialog
{ {
public: public:
CISOProperties(const std::string fileName, CISOProperties(const std::string fileName,
wxWindow* parent, wxWindow* parent,
wxWindowID id = 1, wxWindowID id = 1,
@ -66,34 +65,9 @@ class CISOProperties : public wxDialog
PHackData PHack_Data; PHackData PHack_Data;
private: private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
wxStaticBoxSizer *sbGameConfig;
wxStaticBoxSizer *sbCoreOverrides;
wxStaticBoxSizer *sbWiiOverrides;
wxStaticBoxSizer *sbVideoOverrides;
wxBoxSizer *sEmuState;
wxBoxSizer *sPatches;
wxBoxSizer *sPatchButtons;
wxBoxSizer *sCheats;
wxBoxSizer *sCheatButtons;
wxStaticBoxSizer *sbISODetails;
wxGridBagSizer *sISODetails;
wxStaticBoxSizer *sbBannerDetails;
wxGridBagSizer *sBannerDetails;
wxButton *m_Close;
wxNotebook *m_Notebook;
wxPanel *m_GameConfig;
wxPanel *m_PatchPage;
wxPanel *m_CheatPage;
wxPanel *m_Information;
wxPanel *m_Filesystem;
wxStaticText *OverrideText;
// Core // Core
wxCheckBox *CPUThread, *SkipIdle, *MMU, *MMUBAT, *TLBHack; wxCheckBox *CPUThread, *SkipIdle, *MMU, *MMUBAT, *TLBHack;
wxCheckBox *VBeam, *FastDiscSpeed, *BlockMerging, *DSPHLE; wxCheckBox *VBeam, *FastDiscSpeed, *BlockMerging, *DSPHLE;
@ -103,20 +77,16 @@ class CISOProperties : public wxDialog
wxCheckBox *UseZTPSpeedupHack, *PHackEnable; wxCheckBox *UseZTPSpeedupHack, *PHackEnable;
wxButton *PHSettings; wxButton *PHSettings;
wxButton *EditConfig;
wxStaticText *EmuStateText;
wxArrayString arrayStringFor_EmuState; wxArrayString arrayStringFor_EmuState;
wxChoice *EmuState; wxChoice *EmuState;
wxTextCtrl *EmuIssues; wxTextCtrl *EmuIssues;
wxArrayString arrayStringFor_Patches; wxArrayString arrayStringFor_Patches;
wxCheckListBox *Patches; wxCheckListBox *Patches;
wxButton *EditPatch; wxButton *EditPatch;
wxButton *AddPatch;
wxButton *RemovePatch; wxButton *RemovePatch;
wxArrayString arrayStringFor_Cheats; wxArrayString arrayStringFor_Cheats;
wxCheckListBox *Cheats; wxCheckListBox *Cheats;
wxButton *EditCheat; wxButton *EditCheat;
wxButton *AddCheat;
wxButton *RemoveCheat; wxButton *RemoveCheat;
wxArrayString arrayStringFor_Speedhacks; wxArrayString arrayStringFor_Speedhacks;
wxCheckListBox *Speedhacks; wxCheckListBox *Speedhacks;
@ -124,17 +94,6 @@ class CISOProperties : public wxDialog
wxButton *AddSpeedhack; wxButton *AddSpeedhack;
wxButton *RemoveSpeedhack; wxButton *RemoveSpeedhack;
wxStaticText *m_NameText;
wxStaticText *m_GameIDText;
wxStaticText *m_CountryText;
wxStaticText *m_MakerIDText;
wxStaticText *m_DateText;
wxStaticText *m_FSTText;
wxStaticText *m_LangText;
wxStaticText *m_ShortText;
wxStaticText *m_MakerText;
wxStaticText *m_CommentText;
wxStaticText *m_BannerText;
wxTextCtrl *m_Name; wxTextCtrl *m_Name;
wxTextCtrl *m_GameID; wxTextCtrl *m_GameID;
wxTextCtrl *m_Country; wxTextCtrl *m_Country;
@ -150,9 +109,6 @@ class CISOProperties : public wxDialog
wxTreeCtrl *m_Treectrl; wxTreeCtrl *m_Treectrl;
wxTreeItemId RootId; wxTreeItemId RootId;
wxImageList *m_iconList;
wxFlexGridSizer *szrPHackSettings;
Gecko::CodeConfigPanel *m_geckocode_panel; Gecko::CodeConfigPanel *m_geckocode_panel;
@ -168,7 +124,6 @@ class CISOProperties : public wxDialog
ID_INFORMATION, ID_INFORMATION,
ID_FILESYSTEM, ID_FILESYSTEM,
ID_OVERRIDE_TEXT,
ID_USEDUALCORE, ID_USEDUALCORE,
ID_IDLESKIP, ID_IDLESKIP,
ID_MMU, ID_MMU,
@ -184,9 +139,7 @@ class CISOProperties : public wxDialog
ID_ENABLEPROGRESSIVESCAN, ID_ENABLEPROGRESSIVESCAN,
ID_ENABLEWIDESCREEN, ID_ENABLEWIDESCREEN,
ID_EDITCONFIG, ID_EDITCONFIG,
ID_EMUSTATE_TEXT,
ID_EMUSTATE, ID_EMUSTATE,
ID_EMUISSUES_TEXT,
ID_EMU_ISSUES, ID_EMU_ISSUES,
ID_PATCHES_LIST, ID_PATCHES_LIST,
ID_EDITPATCH, ID_EDITPATCH,
@ -197,20 +150,6 @@ class CISOProperties : public wxDialog
ID_ADDCHEAT, ID_ADDCHEAT,
ID_REMOVECHEAT, ID_REMOVECHEAT,
ID_NAME_TEXT,
ID_GAMEID_TEXT,
ID_COUNTRY_TEXT,
ID_MAKERID_TEXT,
ID_DATE_TEXT,
ID_FST_TEXT,
ID_VERSION_TEXT,
ID_LANG_TEXT,
ID_SHORTNAME_TEXT,
ID_LONGNAME_TEXT,
ID_MAKER_TEXT,
ID_COMMENT_TEXT,
ID_BANNER_TEXT,
ID_NAME, ID_NAME,
ID_GAMEID, ID_GAMEID,
ID_COUNTRY, ID_COUNTRY,

View File

@ -190,11 +190,6 @@ void InputConfigDialog::UpdateControlReferences()
(*i)->controller->UpdateReferences(g_controller_interface); (*i)->controller->UpdateReferences(g_controller_interface);
} }
void InputConfigDialog::ClickCancel(wxCommandEvent& event)
{
event.Skip();
}
void InputConfigDialog::ClickSave(wxCommandEvent& event) void InputConfigDialog::ClickSave(wxCommandEvent& event)
{ {
m_plugin.SaveConfig(); m_plugin.SaveConfig();
@ -495,7 +490,6 @@ wxStaticBoxSizer* ControlDialog::CreateControlChooser(wxWindow* const parent, wx
wxButton* const clear_button = new wxButton(parent, -1, _("Clear")); wxButton* const clear_button = new wxButton(parent, -1, _("Clear"));
wxButton* const set_button = new wxButton(parent, -1, _("Set")); wxButton* const set_button = new wxButton(parent, -1, _("Set"));
wxButton* const ok_button = new wxButton(parent, wxID_OK, _("OK"));
wxButton* const select_button = new wxButton(parent, -1, _("Select")); wxButton* const select_button = new wxButton(parent, -1, _("Select"));
_connect_macro_(select_button, ControlDialog::SetSelectedControl, wxEVT_COMMAND_BUTTON_CLICKED, parent); _connect_macro_(select_button, ControlDialog::SetSelectedControl, wxEVT_COMMAND_BUTTON_CLICKED, parent);
@ -546,16 +540,14 @@ wxStaticBoxSizer* ControlDialog::CreateControlChooser(wxWindow* const parent, wx
ctrls_sizer->Add(control_lbox, 1, wxEXPAND, 0); ctrls_sizer->Add(control_lbox, 1, wxEXPAND, 0);
ctrls_sizer->Add(button_sizer, 0, wxEXPAND, 0); ctrls_sizer->Add(button_sizer, 0, wxEXPAND, 0);
wxBoxSizer* const bottom_btns_sizer = new wxBoxSizer(wxHORIZONTAL); wxSizer* const bottom_btns_sizer = CreateButtonSizer(wxOK);
bottom_btns_sizer->Add(clear_button, 0, wxLEFT, 5); bottom_btns_sizer->Prepend(set_button, 0, wxRIGHT, 5);
bottom_btns_sizer->Add(set_button, 0, wxRIGHT, 5); bottom_btns_sizer->Prepend(clear_button, 0, wxLEFT, 5);
bottom_btns_sizer->AddStretchSpacer(1);
bottom_btns_sizer->Add(ok_button, 0, wxRIGHT, 5);
main_szr->Add(range_sizer, 0, wxEXPAND|wxLEFT|wxRIGHT, 5); main_szr->Add(range_sizer, 0, wxEXPAND|wxLEFT|wxRIGHT, 5);
main_szr->Add(ctrls_sizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 5); main_szr->Add(ctrls_sizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 5);
main_szr->Add(textctrl, 1, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 5); main_szr->Add(textctrl, 1, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 5);
main_szr->Add(bottom_btns_sizer, 0, wxEXPAND|wxBOTTOM, 5); main_szr->Add(bottom_btns_sizer, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5);
main_szr->Add(m_bound_label, 0, wxCENTER, 0); main_szr->Add(m_bound_label, 0, wxCENTER, 0);
UpdateListContents(); UpdateListContents();
@ -983,23 +975,16 @@ InputConfigDialog::InputConfigDialog(wxWindow* const parent, InputPlugin& plugin
wxButton* const close_button = new wxButton(this, wxID_OK, _("Save")); wxButton* const close_button = new wxButton(this, wxID_OK, _("Save"));
_connect_macro_(close_button, InputConfigDialog::ClickSave, wxEVT_COMMAND_BUTTON_CLICKED, this); _connect_macro_(close_button, InputConfigDialog::ClickSave, wxEVT_COMMAND_BUTTON_CLICKED, this);
wxButton* const cancel_button = new wxButton(this, wxID_CANCEL, _("Cancel")); wxButton* const cancel_button = new wxButton(this, wxID_CANCEL, _("Cancel"));
_connect_macro_(cancel_button, InputConfigDialog::ClickCancel, wxEVT_COMMAND_BUTTON_CLICKED, this);
wxBoxSizer* btns = new wxBoxSizer(wxHORIZONTAL); wxSizer* btns = CreateButtonSizer(wxNO_DEFAULT);
//btns->Add(new wxStaticText(this, -1, wxString::FromAscii(ver.c_str())), 0, wxLEFT|wxTOP, 5); btns->Add(cancel_button);
btns->AddStretchSpacer(); btns->Add(close_button);
btns->Add(cancel_button, 0, 0, 0);
btns->Add(close_button, 0, 0, 0);
wxBoxSizer* const szr = new wxBoxSizer(wxVERTICAL); wxBoxSizer* const szr = new wxBoxSizer(wxVERTICAL);
szr->Add(m_pad_notebook, 0, wxEXPAND|wxTOP|wxLEFT|wxRIGHT, 5); szr->Add(m_pad_notebook, 0, wxEXPAND|wxTOP|wxLEFT|wxRIGHT, 5);
szr->Add(btns, 0, wxEXPAND|wxALL, 5); szr->Add(btns, 0, wxEXPAND|wxALL, 5);
SetSizerAndFit(szr); // needed SetSizerAndFit(szr);
// not needed here it seems, but it cant hurt
//Layout();
Center(); Center();
// live preview update timer // live preview update timer

View File

@ -235,7 +235,6 @@ public:
bool Destroy(); bool Destroy();
void ClickCancel(wxCommandEvent& event);
void ClickSave(wxCommandEvent& event); void ClickSave(wxCommandEvent& event);
void UpdateDeviceComboBox(); void UpdateDeviceComboBox();

View File

@ -470,9 +470,9 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
szr_main->Add(notebook, 1, wxEXPAND | wxALL, 5); szr_main->Add(notebook, 1, wxEXPAND | wxALL, 5);
szr_main->Add(btn_close, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 5); szr_main->Add(btn_close, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 5);
notebook->SetSelection(0);
SetSizerAndFit(szr_main); SetSizerAndFit(szr_main);
Center(); Center();
SetFocus();
SetUIValuesFromConfig(); SetUIValuesFromConfig();
Connect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(VideoConfigDiag::OnUpdateUI), NULL, this); Connect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(VideoConfigDiag::OnUpdateUI), NULL, this);

View File

@ -82,7 +82,7 @@ WiimoteConfigDiag::WiimoteConfigDiag(wxWindow* const parent, InputPlugin& plugin
wxButton* const cancel_button = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition); wxButton* const cancel_button = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition);
_connect_macro_(cancel_button, WiimoteConfigDiag::Cancel, wxEVT_COMMAND_BUTTON_CLICKED, this); _connect_macro_(cancel_button, WiimoteConfigDiag::Cancel, wxEVT_COMMAND_BUTTON_CLICKED, this);
wxBoxSizer* const button_sizer = new wxBoxSizer(wxHORIZONTAL); wxSizer* const button_sizer = CreateButtonSizer(wxNO_DEFAULT);
button_sizer->Add(cancel_button, 0, wxALIGN_RIGHT | wxRIGHT, 5); button_sizer->Add(cancel_button, 0, wxALIGN_RIGHT | wxRIGHT, 5);
button_sizer->Add(ok_button, 0, wxALIGN_RIGHT); button_sizer->Add(ok_button, 0, wxALIGN_RIGHT);

View File

@ -144,9 +144,8 @@ void VideoBackend::ShowConfig(void *_hParent)
// Clear ppshaders string vector // Clear ppshaders string vector
g_Config.backend_info.PPShaders.clear(); g_Config.backend_info.PPShaders.clear();
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, _trans("Direct3D11"), "gfx_dx11"); VideoConfigDiag diag((wxWindow*)_hParent, _trans("Direct3D11"), "gfx_dx11");
diag->ShowModal(); diag.ShowModal();
diag->Destroy();
g_Config.backend_info.Adapters.clear(); g_Config.backend_info.Adapters.clear();
DX11::D3D::UnloadDXGI(); DX11::D3D::UnloadDXGI();

View File

@ -125,9 +125,8 @@ void VideoBackend::ShowConfig(void* parent)
// Clear ppshaders string vector // Clear ppshaders string vector
g_Config.backend_info.PPShaders.clear(); g_Config.backend_info.PPShaders.clear();
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)parent, _trans("Direct3D9"), "gfx_dx9"); VideoConfigDiag diag((wxWindow*)parent, _trans("Direct3D9"), "gfx_dx9");
diag->ShowModal(); diag.ShowModal();
diag->Destroy();
g_Config.backend_info.Adapters.clear(); g_Config.backend_info.Adapters.clear();
DX9::D3D::Shutdown(); DX9::D3D::Shutdown();

View File

@ -152,9 +152,8 @@ void VideoBackend::ShowConfig(void *_hParent)
// pp shaders // pp shaders
GetShaders(g_Config.backend_info.PPShaders); GetShaders(g_Config.backend_info.PPShaders);
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, "OpenGL", "gfx_opengl"); VideoConfigDiag diag((wxWindow*)_hParent, "OpenGL", "gfx_opengl");
diag->ShowModal(); diag.ShowModal();
diag->Destroy();
#endif #endif
} }

View File

@ -57,9 +57,8 @@ void *DllDebugger(void *_hParent, bool Show)
void VideoBackend::ShowConfig(void *_hParent) void VideoBackend::ShowConfig(void *_hParent)
{ {
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX
VideoConfigDialog* const diag = new VideoConfigDialog((wxWindow*)_hParent, "Software", "gfx_software"); VideoConfigDialog diag((wxWindow*)_hParent, "Software", "gfx_software");
diag->ShowModal(); diag.ShowModal();
diag->Destroy();
#endif #endif
} }

View File

@ -105,27 +105,17 @@ VideoConfigDialog::VideoConfigDialog(wxWindow* parent, const std::string& title,
page_general->SetSizerAndFit(szr_general); page_general->SetSizerAndFit(szr_general);
} }
wxButton* const btn_close = new wxButton(this, -1, wxT("Close"), wxDefaultPosition);
_connect_macro_(btn_close, VideoConfigDialog::Event_ClickClose, wxEVT_COMMAND_BUTTON_CLICKED, this);
Connect(-1, wxEVT_CLOSE_WINDOW, wxCloseEventHandler(VideoConfigDialog::Event_Close), (wxObject*)0, this);
wxBoxSizer* const szr_main = new wxBoxSizer(wxVERTICAL); wxBoxSizer* const szr_main = new wxBoxSizer(wxVERTICAL);
szr_main->Add(notebook, 1, wxEXPAND | wxALL, 5); szr_main->Add(notebook, 1, wxEXPAND | wxALL, 5);
szr_main->Add(btn_close, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 5); szr_main->Add(new wxButton(this, wxID_OK, wxT("Close"), wxDefaultPosition),
0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 5);
SetSizerAndFit(szr_main); SetSizerAndFit(szr_main);
Center(); Center();
SetFocus();
} }
void VideoConfigDialog::Event_ClickClose(wxCommandEvent&) VideoConfigDialog::~VideoConfigDialog()
{
Close();
}
void VideoConfigDialog::Event_Close(wxCloseEvent& ev)
{ {
g_SWVideoConfig.Save((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str()); g_SWVideoConfig.Save((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str());
EndModal(wxID_OK);
} }

View File

@ -37,11 +37,9 @@ class VideoConfigDialog : public wxDialog
{ {
public: public:
VideoConfigDialog(wxWindow* parent, const std::string &title, const std::string& ininame); VideoConfigDialog(wxWindow* parent, const std::string &title, const std::string& ininame);
~VideoConfigDialog();
protected: protected:
void Event_ClickClose(wxCommandEvent&);
void Event_Close(wxCloseEvent&);
SWVideoConfig& vconfig; SWVideoConfig& vconfig;
std::string ininame; std::string ininame;
}; };