nJoy: Enabled keyboard input (only for buttons so far) through wxWidgets in the main application. It only works when you render to the main window.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1706 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2008-12-28 18:50:24 +00:00
parent de7abc6bd0
commit 5e5e507121
20 changed files with 460 additions and 153 deletions

View File

@ -46,7 +46,7 @@
IMPLEMENT_APP(DolphinApp)
#if defined(HAVE_WX) && HAVE_WX
bool wxMsgAlert(const char*, const char*, bool);
bool wxMsgAlert(const char*, const char*, bool, int);
#endif
CFrame* main_frame = NULL;
@ -278,18 +278,27 @@ void DolphinApp::OnEndSession()
SConfig::GetInstance().SaveSettings();
}
/////////////////////////////////////////////////////////////
/* We declare this here instead of in Common/MsgHandler.cpp because we want to keep Common
free of wxWidget functions */
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int Style)
{
#ifdef _WIN32
/* In Windows we use a MessageBox isntead of a wxMessageBox to don't block
the debug window */
int STYLE = MB_ICONINFORMATION;
if(Style == QUESTION) STYLE = MB_ICONQUESTION;
if(Style == WARNING) STYLE = MB_ICONWARNING;
bool wxMsgAlert(const char* caption, const char* text,
bool yes_no) {
#ifdef _WIN32
// I like parentless messageboxes - don't block the debug window.
return IDYES == MessageBox(0, text, caption, yes_no?MB_YESNO:MB_OK);
#else
return wxYES == wxMessageBox(wxString::FromAscii(text),
wxString::FromAscii(caption),
(yes_no)?wxYES_NO:wxOK);
#endif
return IDYES == MessageBox(0, text, caption, STYLE | (yes_no ? MB_YESNO : MB_OK));
#else
return wxYES == wxMessageBox(wxString::FromAscii(text),
wxString::FromAscii(caption),
(yes_no)?wxYES_NO:wxOK);
#endif
}
//////////////////////////////////
// OK, this thread boundary is DANGEROUS on linux