nJoy: GUI update

- Config GUI now uses wxWidgets (should work in linux!)
- The alignment of text may look crappy in linux, so we still need to fix that.
- Opening the config GUI takes time, crappy XPM image of the controller loads slow (cant we use BMP files???) (line 240)
- Stupid GUI bug present when switching between a default joystick and one with no hat. (line 381)
- For some reason setting the value of a wxTextCtrl doesnt gets updated immediately (line 559)
- If you're using windows and dont want to use wxWidgets for the GUI, you can still use the old one by removing #define USE_WXWIDGETS from nJoy.h line 33.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@95 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Laurence Muller
2008-07-29 22:26:42 +00:00
parent 7894e6c9e9
commit 53ba40fd7f
10 changed files with 1640 additions and 33 deletions

View File

@ -66,7 +66,7 @@ BOOL APIENTRY DllMain( HINSTANCE hinstDLL, // DLL module handle
DWORD dwReason, // reason called
LPVOID lpvReserved) // reserved
{
InitCommonControls();
#ifdef USE_WXWIDGETS
switch (dwReason)
@ -91,6 +91,8 @@ BOOL APIENTRY DllMain( HINSTANCE hinstDLL, // DLL module handle
default:
break;
}
#else
InitCommonControls();
#endif
nJoy_hInst = hinstDLL;
@ -147,20 +149,55 @@ void DllAbout(HWND _hParent)
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void DllConfig(HWND _hParent)
{
#ifdef _WIN32
if(SDL_Init(SDL_INIT_JOYSTICK ) < 0)
{
MessageBox(NULL, SDL_GetError(), "Could not initialize SDL!", MB_ICONERROR);
return;
}
LoadConfig(); // load settings
if(OpenConfig(nJoy_hInst, _hParent))
{
SaveConfig();
}
LoadConfig(); // reload settings
#endif
#ifdef USE_WXWIDGETS
#ifdef _WIN32
if(SDL_Init(SDL_INIT_JOYSTICK ) < 0)
{
MessageBox(NULL, SDL_GetError(), "Could not initialize SDL!", MB_ICONERROR);
return;
}
LoadConfig(); // load settings
wxWindow win;
win.SetHWND((WXHWND)_hParent);
win.Enable(false);
ConfigBox frame(&win);
frame.ShowModal();
win.Enable(true);
win.SetHWND(0);
#else
if(SDL_Init(SDL_INIT_JOYSTICK ) < 0)
{
printf("Could not initialize SDL! (%s)\n", SDL_GetError());
return;
}
LoadConfig(); // load settings
ConfigBox frame(NULL);
frame.ShowModal();
#endif
#else
#ifdef _WIN32
if(SDL_Init(SDL_INIT_JOYSTICK ) < 0)
{
MessageBox(NULL, SDL_GetError(), "Could not initialize SDL!", MB_ICONERROR);
return;
}
LoadConfig(); // load settings
if(OpenConfig(nJoy_hInst, _hParent))
{
SaveConfig();
}
LoadConfig(); // reload settings
#endif
#endif
}
// Init PAD (start emulation)