]> git.saurik.com Git - wxWidgets.git/commitdiff
Reparied accel processing
authorDavid Webster <Dave.Webster@bhmi.com>
Fri, 18 Aug 2000 12:00:39 +0000 (12:00 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Fri, 18 Aug 2000 12:00:39 +0000 (12:00 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8124 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/accel.cpp
src/os2/app.cpp

index 1fdc45861f6aab2dee33396a19392c8bc4bdba16..bda2003f77eb3ad4d05ce3bce2c33e4cb228efa3 100644 (file)
@@ -89,8 +89,8 @@ wxAcceleratorTable::wxAcceleratorTable(
         wxFrame*                    pFrame = (wxFrame*)wxTheApp->GetTopWindow();
 
         ::WinSetAccelTable( vHabmain
-                           ,(HWND)pFrame->GetFrame()
                            ,hAccel
+                           ,(HWND)pFrame->GetFrame()
                           );
     }
     M_ACCELDATA->m_hAccel = hAccel;
@@ -152,8 +152,8 @@ wxAcceleratorTable::wxAcceleratorTable(
         wxFrame*                    pFrame = (wxFrame*)wxTheApp->GetTopWindow();
 
         ::WinSetAccelTable( vHabmain
-                           ,(HWND)pFrame->GetFrame()
                            ,M_ACCELDATA->m_hAccel
+                           ,(HWND)pFrame->GetFrame()
                           );
     }
 
index 4aa19bee52c443a650aeae6dd1c5558aecd74ac8..f03a8e20ed81d7216deff886e615adb23ace451f 100644 (file)
@@ -731,16 +731,33 @@ 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(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.
     //