X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..117247fd2cf664fc7b86b3101246a3a58332898a:/src/os2/app.cpp diff --git a/src/os2/app.cpp b/src/os2/app.cpp index 4aa19bee52..ef18d55511 100644 --- a/src/os2/app.cpp +++ b/src/os2/app.cpp @@ -184,7 +184,7 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxFrameClassName ,(PFNWP)wxWndProc - ,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT + ,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT | CS_FRAME ,sizeof(ULONG) )) { @@ -651,11 +651,11 @@ int wxApp::MainLoop() #if wxUSE_THREADS wxMutexGuiLeaveOrEnter(); #endif // wxUSE_THREADS - while (!Pending() && ProcessIdle()) - { -// wxUsleep(10000); - } - DoMessage(); + while (!Pending() && ProcessIdle()) + { +// wxUsleep(10000); + } + DoMessage(); } return (int)svCurrentMsg.mp1; } // end of wxApp::MainLoop @@ -731,24 +731,41 @@ bool wxApp::ProcessMessage( // // 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 - for (pWnd = pWndThis; pWnd; pWnd = pWnd->GetParent() ) + if(pMsg->msg == WM_CHAR) { - if (pMsg->msg == WM_CHAR) - if (pWnd->OS2TranslateMessage(pWxmsg)) - return TRUE; + PBYTE pChmsg = (PBYTE)&(pMsg->msg); + USHORT uSch = CHARMSG(pChmsg)->chr; + 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((bRc = pWnd->OS2TranslateMessage(pWxmsg)) == TRUE) + break; + } + if(!bRc) // untranslated, should restore original value + CHARMSG(pChmsg)->chr = uSch; + } } -#endif // // Anyone for a non-translation message? Try youngest descendants first. // - for (pWnd = pWndThis; pWnd; pWnd = pWnd->GetParent()) - { - if (pWnd->OS2ProcessMessage(pWxmsg)) - return TRUE; - } +// for (pWnd = pWndThis; pWnd; pWnd = pWnd->GetParent()) +// { +// if (pWnd->OS2ProcessMessage(pWxmsg)) +// return TRUE; +// } return FALSE; } // end of wxApp::ProcessMessage