X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..bada28f00f12666ef31f0543cea2cde86b7935c7:/src/os2/app.cpp diff --git a/src/os2/app.cpp b/src/os2/app.cpp index 4aa19bee52..70342ca40f 100644 --- a/src/os2/app.cpp +++ b/src/os2/app.cpp @@ -183,7 +183,7 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxFrameClassName - ,(PFNWP)wxWndProc + ,NULL ,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT ,sizeof(ULONG) )) @@ -196,7 +196,7 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxFrameClassNameNoRedraw - ,(PFNWP)wxWndProc + ,NULL ,0 ,0 )) @@ -209,7 +209,7 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxMDIFrameClassName - ,(PFNWP)wxWndProc + ,NULL ,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT ,0 )) @@ -222,7 +222,7 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxMDIFrameClassNameNoRedraw - ,(PFNWP)wxWndProc + ,NULL ,0 ,0 )) @@ -235,7 +235,7 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxMDIChildFrameClassName - ,(PFNWP)wxWndProc + ,NULL ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_SYNCPAINT | CS_HITTEST ,0 )) @@ -248,7 +248,7 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxMDIChildFrameClassNameNoRedraw - ,(PFNWP)wxWndProc + ,NULL ,CS_HITTEST ,0 )) @@ -261,7 +261,7 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxPanelClassName - ,(PFNWP)wxWndProc + ,NULL ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_HITTEST | CS_SAVEBITS | CS_SYNCPAINT ,0 )) @@ -274,8 +274,8 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxCanvasClassName - ,(PFNWP)wxWndProc - ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_HITTEST | CS_SAVEBITS | CS_SYNCPAINT + ,NULL + ,0 // CS_MOVENOTIFY | CS_SIZEREDRAW | CS_HITTEST | CS_SAVEBITS | CS_SYNCPAINT ,0 )) { @@ -651,9 +651,9 @@ int wxApp::MainLoop() #if wxUSE_THREADS wxMutexGuiLeaveOrEnter(); #endif // wxUSE_THREADS - while (!Pending() && ProcessIdle()) + while (/*Pending() &&*/ ProcessIdle()) { -// wxUsleep(10000); +// wxUsleep(10000); } DoMessage(); } @@ -731,24 +731,43 @@ bool wxApp::ProcessMessage( // // Try translations first; find the youngest window with - // a translation table. - // -#if 0 - for (pWnd = pWndThis; pWnd; pWnd = pWnd->GetParent() ) - { - if (pMsg->msg == WM_CHAR) - if (pWnd->OS2TranslateMessage(pWxmsg)) - return TRUE; + // a translation table. OS/2 has case sensative accels, so + // this block, coded by BK, removes that and helps make them + // case insensative. + // + if(pMsg->msg == WM_CHAR) + { + 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 @@ -761,7 +780,7 @@ void wxApp::OnIdle( // // Avoid recursion (via ProcessEvent default case) // - if (sbInOnIdle ) + if (sbInOnIdle) return; sbInOnIdle = TRUE;