Added WXK_SPECIAL... keycodes for special hardware buttons

Made (Un)RegisterHotKey WinCE-aware.
Added wxEVT_HIBERNATE event.
Now fakes wxEVT_ACTIVATE_APP to be symmetrical with wxEVT_HIBERNATE.
Added wxTE_CAPITALIZE for CAPEDIT controls.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2005-03-18 14:26:57 +00:00
parent 87a39e3b55
commit afafd942a1
14 changed files with 206 additions and 14 deletions

View File

@@ -2278,6 +2278,7 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
case WM_ACTIVATEAPP:
// This implicitly sends a wxEVT_ACTIVATE_APP event
wxTheApp->SetActive(wParam != 0, FindFocus());
break;
#endif
@@ -5794,6 +5795,25 @@ wxPoint wxGetMousePosition()
#if wxUSE_HOTKEY
#if defined(__SMARTPHONE__) || defined(__POCKETPC__)
static void WinCEUnregisterHotKey(int modifiers, int id)
{
// Register hotkeys for the hardware buttons
HINSTANCE hCoreDll;
typedef BOOL (WINAPI *UnregisterFunc1Proc)(UINT, UINT);
UnregisterFunc1Proc procUnregisterFunc;
hCoreDll = LoadLibrary(_T("coredll.dll"));
if (hCoreDll)
{
procUnregisterFunc = (UnregisterFunc1Proc)GetProcAddress(hCoreDll, _T("UnregisterFunc1"));
if (procUnregisterFunc)
procUnregisterFunc(modifiers, id);
FreeLibrary(hCoreDll);
}
}
#endif
bool wxWindowMSW::RegisterHotKey(int hotkeyId, int modifiers, int keycode)
{
UINT win_modifiers=0;
@@ -5806,6 +5826,12 @@ bool wxWindowMSW::RegisterHotKey(int hotkeyId, int modifiers, int keycode)
if ( modifiers & wxMOD_WIN )
win_modifiers |= MOD_WIN;
#if defined(__SMARTPHONE__) || defined(__POCKETPC__)
// Required for PPC and Smartphone hardware buttons
if (keycode >= WXK_SPECIAL1 && keycode <= WXK_SPECIAL20)
WinCEUnregisterHotKey(win_modifiers, hotkeyId);
#endif
if ( !::RegisterHotKey(GetHwnd(), hotkeyId, win_modifiers, keycode) )
{
wxLogLastError(_T("RegisterHotKey"));
@@ -5818,6 +5844,10 @@ bool wxWindowMSW::RegisterHotKey(int hotkeyId, int modifiers, int keycode)
bool wxWindowMSW::UnregisterHotKey(int hotkeyId)
{
#if defined(__SMARTPHONE__) || defined(__POCKETPC__)
WinCEUnregisterHotKey(MOD_WIN, hotkeyId);
#endif
if ( !::UnregisterHotKey(GetHwnd(), hotkeyId) )
{
wxLogLastError(_T("UnregisterHotKey"));