git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45365
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxX11:
- Added mouse wheel support (David Hart)
+- Make Enter key activate the default button (David Hart)
2.8.4
}
}
+ // if Return was pressed, see if there's a default button to activate
+ if ( !event.HasModifiers() && event.GetKeyCode() == WXK_RETURN )
+ {
+ wxTopLevelWindow *
+ tlw = wxDynamicCast(wxTopLevelWindow *, wxGetTopLevelParent());
+ if ( tlw )
+ {
+ wxButton *btn = wxDynamicCast(wxButton *, tlw->GetDefaultItem());
+ if ( btn )
+ {
+ wxCommandEvent evt(wxEVT_COMMAND_BUTTON_CLICKED, btn->GetId());
+ evt.SetEventObject(btn);
+ btn->Command(evt);
+ return;
+ }
+ }
+ }
+
+
event.Skip();
}