X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c04c7a3d0ae9f09bd7219b97799d9b185f1c2bab..d2b23b67301bd2d286366d4326a21da3132558fa:/src/univ/winuniv.cpp diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index 75f8f3bc74..90bb87c58f 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -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(); }