+ // 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;
+ }
+ }
+ }
+
+