From: Vadim Zeitlin Date: Thu, 25 Aug 2005 19:27:43 +0000 (+0000) Subject: pressing enter now activates the default button even when the focus is on a checkbox... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3147bb585a14fd5a05fd3c5e390634ac47299745 pressing enter now activates the default button even when the focus is on a checkbox or radio button git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35315 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 50f56cd2a7..ca9fe433c6 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1975,7 +1975,10 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) // it return false; } - else if ( lDlgCode & DLGC_BUTTON ) + + // currently active button should get enter press even + // if there is a default button elsewhere + if ( lDlgCode & DLGC_DEFPUSHBUTTON ) { // let IsDialogMessage() handle this for all // buttons except the owner-drawn ones which it @@ -1984,16 +1987,15 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) if ( (style & BS_OWNERDRAW) == BS_OWNERDRAW ) { // emulate the button click - wxWindow *btn = wxFindWinFromHandle((WXHWND)msg->hwnd); + wxWindow * + btn = wxFindWinFromHandle((WXHWND)msg->hwnd); if ( btn ) btn->MSWCommand(BN_CLICKED, 0 /* unused */); } bProcess = false; } - // FIXME: this should be handled by - // wxNavigationKeyEvent handler and not here! - else + else // not a button itself { #if wxUSE_BUTTON wxButton *btn = wxDynamicCast(GetDefaultItem(),