]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/window.cpp
cleaned up the checkbox creation code (~70 lines of code became 3)
[wxWidgets.git] / src / os2 / window.cpp
index fd71c44b76688b8d61a125ea9d0ff9d59673fb6d..c5000c0f476cc198af5bb4316941b6fa7b09c518 100644 (file)
@@ -278,10 +278,11 @@ void wxWindowOS2::Init()
     m_bDoubleClickAllowed = 0;
     m_bWinCaptured = FALSE;
 
-    m_isBeingDeleted = FALSE;
-    m_fnOldWndProc = 0;
-    m_bUseCtl3D = FALSE;
-    m_bMouseInWindow = FALSE;
+    m_isBeingDeleted        = FALSE;
+    m_fnOldWndProc          = 0;
+    m_bUseCtl3D             = FALSE;
+    m_bMouseInWindow        = FALSE;
+    m_bLastKeydownProcessed = FALSE;
 
     //
     // wxWnd
@@ -2705,12 +2706,14 @@ MRESULT wxWindowOS2::OS2WindowProc(
                 }
                 else // keydown event
                 {
+                    m_bLastKeydownProcessed = FALSE;
                     //
                     // If this has been processed by an event handler,
                     // return 0 now (we've handled it). DON't RETURN
                     // we still need to process further
                     //
                     HandleKeyDown((WXDWORD)wParam, lParam);
+                    m_bLastKeydownProcessed = TRUE;
                     if (uKeyFlags & KC_VIRTUALKEY)
                     {
                         USHORT          uVk = SHORT2FROMMP((MPARAM)lParam);
@@ -4014,6 +4017,16 @@ bool wxWindowOS2::HandleChar(
     bool                            bCtrlDown = FALSE;
     int                             vId;
 
+    if (m_bLastKeydownProcessed)
+    {
+        //
+        // The key was handled in the EVT_KEY_DOWN.  Handling a key in an
+        // EVT_KEY_DOWN handler is meant, by design, to prevent EVT_CHARs
+        // from happening, so just bail out at this point.
+        //
+        m_bLastKeydownProcessed = FALSE;
+        return TRUE;
+    }
     if (isASCII)
     {
         //