]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
Initialise font family when initializing from native font, since this
[wxWidgets.git] / src / msw / window.cpp
index d219c90534b21916a22dfd939c4f290e05dda834..ff531d4eaa2bd075eae7b599fd1f889cc96db270 100644 (file)
@@ -1163,6 +1163,13 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const
                 *exstyle |= WS_EX_DLGMODALFRAME;
                 break;
         }
+
+        // to make the dialog navigation work with the nested panels we must
+        // use this style
+        if ( flags & wxTAB_TRAVERSAL )
+        {
+            *exstyle |= WS_EX_CONTROLPARENT;
+        }
     }
 
     return style;
@@ -2073,10 +2080,18 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
         // place edit control from being closed with Escape in a dialog
         if ( msg->message != WM_KEYDOWN || msg->wParam != VK_ESCAPE )
         {
-            if ( ::IsDialogMessage(GetHwnd(), msg) )
+            // ::IsDialogMessage() can enter in an infinite loop when
+            // WS_EX_CONTROLPARENT is specified and the currently focused
+            // window is disabled or hidden, so don't call it in this case
+            HWND hwndFocus = ::GetFocus();
+            if ( !hwndFocus ||
+                  ::IsWindowEnabled(hwndFocus) && ::IsWindowVisible(hwndFocus) )
             {
-                // IsDialogMessage() did something...
-                return TRUE;
+                if ( ::IsDialogMessage(GetHwnd(), msg) )
+                {
+                    // IsDialogMessage() did something...
+                    return TRUE;
+                }
             }
         }
     }
@@ -3951,6 +3966,7 @@ void wxWindowMSW::InitMouseEvent(wxMouseEvent& event,
 
     event.SetTimestamp(s_currentMsg.time);
     event.m_eventObject = this;
+    event.SetId(GetId());
 
 #if wxUSE_MOUSEEVENT_HACK
     m_lastMouseX = x;