- Converting dialog windows to use wxWidgets instead of win32.
- Currently only the about box is converted.
- The debug versions in windows will not compile yet.
- If you want to use the old version, remove #define USE_WXWIDGETS in nJoy.h



git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@85 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Laurence Muller
2008-07-26 12:28:17 +00:00
parent d522d8ad86
commit 82137a0ee9
8 changed files with 4339 additions and 35 deletions

View File

@ -42,6 +42,22 @@ CONTROLLER_STATE joystate[4];
CONTROLLER_MAPPING joysticks[4];
bool emulator_running = FALSE;
//////////////////////////////////////////////////////////////////////////////////////////
// wxWidgets
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#ifdef USE_WXWIDGETS
class wxDLLApp : public wxApp
{
bool OnInit()
{
return true;
}
};
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
#endif
//////////////////////////////////////////////////////////////////////////////////////////
// DllMain
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@ -52,6 +68,31 @@ BOOL APIENTRY DllMain( HINSTANCE hinstDLL, // DLL module handle
{
InitCommonControls();
#ifdef USE_WXWIDGETS
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{
//use wxInitialize() if you don't want GUI instead of the following 12 lines
wxSetInstance((HINSTANCE)hinstDLL);
int argc = 0;
char **argv = NULL;
wxEntryStart(argc, argv);
if ( !wxTheApp || !wxTheApp->CallOnInit() )
return FALSE;
}
break;
case DLL_PROCESS_DETACH:
wxEntryCleanup(); //use wxUninitialize() if you don't want GUI
break;
default:
break;
}
#endif
nJoy_hInst = hinstDLL;
return TRUE;
}
@ -79,9 +120,27 @@ void GetDllInfo(PLUGIN_INFO* _PluginInfo)
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void DllAbout(HWND _hParent)
{
#ifdef _WIN32
OpenAbout(nJoy_hInst, _hParent);
#endif
#ifdef USE_WXWIDGETS
#ifdef _WIN32
wxWindow win;
win.SetHWND((WXHWND)_hParent);
win.Enable(false);
AboutBox frame(&win);
frame.ShowModal();
win.Enable(true);
win.SetHWND(0);
#else
AboutBox frame(NULL);
frame.ShowModal();
#endif
#else
#ifdef _WIN32
OpenAbout(nJoy_hInst, _hParent);
#endif
#endif
}
// Call config dialog