]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/winuniv.cpp
don't declare inline function with dllexport declaration, this provokes mingw32 warni...
[wxWidgets.git] / src / univ / winuniv.cpp
index 75f8f3bc74e9c40e0c0dbd54fbe411c353ca6b40..90bb87c58f2780dc5dc4e3c3cae36d0d88fa8053 100644 (file)
@@ -359,7 +359,7 @@ bool wxWindow::DoDrawBackground(wxDC& dc)
     rect.height = size.y;
 
     wxWindow * const parent = GetParent();
-    if ( HasTransparentBackground() && parent )
+    if ( HasTransparentBackground() && !UseBgCol() && parent )
     {
         wxASSERT( !IsTopLevel() );
 
@@ -1412,6 +1412,25 @@ void wxWindow::OnChar(wxKeyEvent& event)
         }
     }
 
+    // if Return was pressed, see if there's a default button to activate
+    if ( !event.HasModifiers() && event.GetKeyCode() == WXK_RETURN )
+    {
+        wxTopLevelWindow *
+            tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
+        if ( tlw )
+        {
+            wxButton *btn = wxDynamicCast(tlw->GetDefaultItem(), wxButton);
+            if ( btn )
+            {
+                wxCommandEvent evt(wxEVT_COMMAND_BUTTON_CLICKED, btn->GetId());
+                evt.SetEventObject(btn);
+                btn->Command(evt);
+                return;
+            }
+        }
+    }
+
+
     event.Skip();
 }