finish proper window handling, fix the modal state of the config dialogs, plus some minor cleanup/changes :p

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5129 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
luisr142004 2010-02-25 06:12:35 +00:00
commit 816febd3b0
33 changed files with 422 additions and 454 deletions

View file

@ -25,16 +25,13 @@ BEGIN_EVENT_TABLE(DSPConfigDialogHLE, wxDialog)
EVT_CHECKBOX(ID_ENABLE_DTK_MUSIC, DSPConfigDialogHLE::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_THROTTLE, DSPConfigDialogHLE::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_RE0_FIX, DSPConfigDialogHLE::SettingsChanged)
EVT_CHOICE(wxID_ANY, DSPConfigDialogHLE::BackendChanged)
EVT_CHOICE(ID_BACKEND, DSPConfigDialogHLE::BackendChanged)
EVT_COMMAND_SCROLL(ID_VOLUME, DSPConfigDialogHLE::VolumeChanged)
END_EVENT_TABLE()
DSPConfigDialogHLE::DSPConfigDialogHLE(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
{
// Center window
CenterOnParent();
m_OK = new wxButton(this, wxID_OK, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
wxStaticBoxSizer *sbSettings = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Sound Settings"));
@ -94,6 +91,9 @@ DSPConfigDialogHLE::DSPConfigDialogHLE(wxWindow *parent, wxWindowID id, const wx
sButtons->Add(m_OK, 0, wxALL, 1);
sMain->Add(sButtons, 0, wxALL|wxEXPAND, 4);
SetSizerAndFit(sMain);
// Center window
CenterOnParent();
}
// Add audio output options

View file

@ -28,7 +28,7 @@ class DSPConfigDialogHLE : public wxDialog
{
public:
DSPConfigDialogHLE(wxWindow *parent,
wxWindowID id = 1,
wxWindowID id = wxID_ANY,
const wxString &title = wxT("Dolphin DSP-HLE Plugin Settings"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
@ -52,7 +52,6 @@ private:
enum
{
wxID_OK,
ID_ENABLE_HLE_AUDIO,
ID_ENABLE_DTK_MUSIC,
ID_ENABLE_THROTTLE,

View file

@ -99,8 +99,6 @@ BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
wxUninitialize();
#endif
break;
default:
break;
}
g_hInstance = hinstDLL;
@ -147,12 +145,12 @@ void GetDllInfo(PLUGIN_INFO* _PluginInfo)
_PluginInfo->Version = 0x0100;
_PluginInfo->Type = PLUGIN_TYPE_DSP;
#ifdef DEBUGFAST
sprintf(_PluginInfo->Name, "Dolphin DSP-HLE Plugin (DebugFast) ");
sprintf_s(_PluginInfo->Name, 100, "Dolphin DSP-HLE Plugin (DebugFast) ");
#else
#ifndef _DEBUG
sprintf(_PluginInfo->Name, "Dolphin DSP-HLE Plugin ");
sprintf_s(_PluginInfo->Name, 100, "Dolphin DSP-HLE Plugin ");
#else
sprintf(_PluginInfo ->Name, "Dolphin DSP-HLE Plugin (Debug) ");
sprintf_s(_PluginInfo->Name, 100, "Dolphin DSP-HLE Plugin (Debug) ");
#endif
#endif
}
@ -171,28 +169,29 @@ void DllConfig(HWND _hParent)
g_Config.Load();
g_Config.GameIniLoad(globals->game_ini);
if (!m_ConfigFrame)
wxWindow *frame = GetParentedWxWindow(_hParent);
m_ConfigFrame = new DSPConfigDialogHLE(frame);
// add backends
std::vector<std::string> backends = AudioCommon::GetSoundBackends();
for (std::vector<std::string>::const_iterator iter = backends.begin();
iter != backends.end(); ++iter)
{
wxWindow *frame = GetParentedWxWindow(_hParent);
m_ConfigFrame = new DSPConfigDialogHLE(frame);
m_ConfigFrame->AddBackend((*iter).c_str());
}
// add backends
std::vector<std::string> backends = AudioCommon::GetSoundBackends();
// Only allow one open at a time
frame->Disable();
m_ConfigFrame->ShowModal();
frame->Enable();
for (std::vector<std::string>::const_iterator iter = backends.begin();
iter != backends.end(); ++iter)
{
m_ConfigFrame->AddBackend((*iter).c_str());
}
// Only allow one open at a time
m_ConfigFrame->ShowModal();
m_ConfigFrame->Destroy();
m_ConfigFrame = NULL;
m_ConfigFrame->Destroy();
m_ConfigFrame = NULL;
#ifdef _WIN32
frame->SetHWND(NULL);
frame->SetHWND(NULL);
#endif
delete frame;
frame->Destroy();
}
#endif
}