Removed the hackery that was being done with the plugin configuration dialogs on windows. That was unnecessary and ugly. The HWND type is dead for non windows. Also cleaned up the gui a little.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5999 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2010-07-30 03:51:49 +00:00
parent 75bd5ed645
commit 06fb0c292a
21 changed files with 144 additions and 378 deletions

View File

@ -53,23 +53,6 @@ WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
HINSTANCE g_hInstance;
#endif
// copied from GCPad
#if defined(HAVE_WX) && HAVE_WX
wxWindow* GetParentedWxWindow(HWND Parent)
{
#ifdef _WIN32
wxSetInstance((HINSTANCE)g_hInstance);
#endif
wxWindow *win = new wxWindow();
#ifdef _WIN32
win->SetHWND((WXHWND)Parent);
win->AdoptAttributesFromHWND();
#endif
return win;
}
#endif
// /
#ifdef _WIN32
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
{
@ -271,7 +254,7 @@ void GetDllInfo(PLUGIN_INFO* _pPluginInfo)
// input: A handle to the window that calls this function
// output: none
//
void DllConfig(HWND _hParent)
void DllConfig(void *_hParent)
{
#if defined(HAVE_WX) && HAVE_WX
const bool was_init = g_plugin.controller_interface.IsInit();
@ -279,34 +262,18 @@ void DllConfig(HWND _hParent)
if (false == was_init)
{
#if defined(HAVE_X11) && HAVE_X11
Window win = GDK_WINDOW_XID(GTK_WIDGET(_hParent)->window);
Window win = GDK_WINDOW_XID(GTK_WIDGET(((wxWindow *)_hParent)->GetHandle())->window);
InitPlugin((void *)win);
#else
InitPlugin(_hParent);
InitPlugin(((wxWindow *)_hParent)->GetHandle());
#endif
}
wxWindow *frame = GetParentedWxWindow(_hParent);
WiimoteConfigDiag* const m_ConfigFrame = new WiimoteConfigDiag(frame, g_plugin);
//InputConfigDialog* const m_ConfigFrame = new InputConfigDialog(frame, g_plugin, PLUGIN_FULL_NAME);
WiimoteConfigDiag* const m_ConfigFrame = new WiimoteConfigDiag((wxWindow *)_hParent, g_plugin);
#ifdef _WIN32
frame->Disable();
m_ConfigFrame->ShowModal();
frame->Enable();
#else
m_ConfigFrame->ShowModal();
#endif
#ifdef _WIN32
wxMilliSleep(50); // hooray for hacks
frame->SetFocus();
frame->SetHWND(NULL);
#endif
m_ConfigFrame->Destroy();
frame->Destroy();
// /
if (false == was_init)
DeInitPlugin();