Reparied accel processing

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8124 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2000-08-18 12:00:39 +00:00
parent be44e7a5f4
commit f09d8a3b94
2 changed files with 26 additions and 9 deletions

View File

@@ -89,8 +89,8 @@ wxAcceleratorTable::wxAcceleratorTable(
wxFrame* pFrame = (wxFrame*)wxTheApp->GetTopWindow(); wxFrame* pFrame = (wxFrame*)wxTheApp->GetTopWindow();
::WinSetAccelTable( vHabmain ::WinSetAccelTable( vHabmain
,(HWND)pFrame->GetFrame()
,hAccel ,hAccel
,(HWND)pFrame->GetFrame()
); );
} }
M_ACCELDATA->m_hAccel = hAccel; M_ACCELDATA->m_hAccel = hAccel;
@@ -152,8 +152,8 @@ wxAcceleratorTable::wxAcceleratorTable(
wxFrame* pFrame = (wxFrame*)wxTheApp->GetTopWindow(); wxFrame* pFrame = (wxFrame*)wxTheApp->GetTopWindow();
::WinSetAccelTable( vHabmain ::WinSetAccelTable( vHabmain
,(HWND)pFrame->GetFrame()
,M_ACCELDATA->m_hAccel ,M_ACCELDATA->m_hAccel
,(HWND)pFrame->GetFrame()
); );
} }

View File

@@ -731,16 +731,33 @@ bool wxApp::ProcessMessage(
// //
// Try translations first; find the youngest window with // Try translations first; find the youngest window with
// a translation table. // a translation table. OS/2 has case sensative accels, so
// this block, coded by BK, removes that and helps make them
// case insensative.
// //
#if 0 if(pMsg->msg == WM_CHAR)
for (pWnd = pWndThis; pWnd; pWnd = pWnd->GetParent() )
{ {
if (pMsg->msg == WM_CHAR) PBYTE pChmsg = (PBYTE)&(pMsg->msg);
if (pWnd->OS2TranslateMessage(pWxmsg)) USHORT uSch = CHARMSG(pChmsg)->chr;
return TRUE; bool bRc;
//
// Do not process keyup events
//
if(!(CHARMSG(pChmsg)->fs & KC_KEYUP))
{
if((CHARMSG(pChmsg)->fs & (KC_ALT | KC_CTRL)) && CHARMSG(pChmsg)->chr != 0)
CHARMSG(pChmsg)->chr = (USHORT)wxToupper((UCHAR)usch);
for(pWnd = pWndThis; pWnd; pWnd = pWnd->GetParent() )
{
if(pWnd->OS2TranslateMessage(pWxmsg))
break;
}
if(!bRc) // untranslated, should restore original value
CHARMSG(pChmsg)->chr = uSch;
}
} }
#endif
// //
// Anyone for a non-translation message? Try youngest descendants first. // Anyone for a non-translation message? Try youngest descendants first.
// //