]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/window.cpp
Removed all outdated makefile.dos and their *.msc include.
[wxWidgets.git] / src / os2 / window.cpp
index 61dd62db3173a29ee55d3d378dd2eeda5fc7697d..2db19422f6d64662e5e418efe2e6d06c5cf9e17a 100644 (file)
@@ -2021,9 +2021,13 @@ bool wxWindowOS2::OS2ProcessMessage( WXMSG* pMsg )
                         }
                         else
                         {
-                            wxButton*   pBtn = wxDynamicCast( GetDefaultItem()
-                                                             ,wxButton
-                                                            );
+                            wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
+                            wxButton*   pBtn = NULL;
+
+                            if (tlw)
+                            {
+                                pBtn = wxDynamicCast(tlw->GetDefaultItem(), wxButton);
+                            }
 
                             if (pBtn && pBtn->IsEnabled())
                             {