]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
Include wx/stopwatch.h according to precompiled headers of wx/wx.h (with other minor...
[wxWidgets.git] / src / msw / window.cpp
index 67d2a2dab39be09f2bc3741043e2ef64365cf41f..0515fe88be44d7bea076d5e4aab2b57e8213ebbe 100644 (file)
@@ -2146,14 +2146,17 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
                         else // not a button itself
                         {
 #if wxUSE_BUTTON
-                            wxButton *btn = wxDynamicCast(GetDefaultItem(),
-                                                          wxButton);
-                            if ( btn && btn->IsEnabled() )
+                            wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
+                            if ( tlw )
                             {
-                                // if we do have a default button, do press it
-                                btn->MSWCommand(BN_CLICKED, 0 /* unused */);
+                                wxButton *btn = wxDynamicCast(tlw->GetDefaultItem(), wxButton);
+                                if ( btn && btn->IsEnabled() )
+                                {
+                                    // if we do have a default button, do press it
+                                    btn->MSWCommand(BN_CLICKED, 0 /* unused */);
 
-                                return true;
+                                    return true;
+                                }
                             }
                             else // no default button
 #endif // wxUSE_BUTTON
@@ -4409,7 +4412,7 @@ WXHBRUSH wxWindowMSW::MSWGetBgBrush(WXHDC hDC, WXHWND hWndToPaint)
     return 0;
 }
 
-bool wxWindowMSW::HandlePrintClient(WXHDC hDC)
+bool wxWindowMSW::HandlePrintClient(WXHDC WXUNUSED(hDC))
 {
     // TODO: handle wxBG_STYLE_CUSTOM and/or wxBG_STYLE_COLOUR here so when
     // DrawParentThemeBackground() from uxtheme.dll is called we don't get