]> git.saurik.com Git - wxWidgets.git/commitdiff
pressing enter now activates the default button even when the focus is on a checkbox...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 25 Aug 2005 19:27:43 +0000 (19:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 25 Aug 2005 19:27:43 +0000 (19:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35315 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index 50f56cd2a7bb57d6287896044e27b8b2cfdea276..ca9fe433c6042f2d741e11a75fc66f5bd3614184 100644 (file)
@@ -1975,7 +1975,10 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
                             // it
                             return false;
                         }
                             // 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
                         {
                             // 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
                             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;
                         }
                                 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(),
                         {
 #if wxUSE_BUTTON
                             wxButton *btn = wxDynamicCast(GetDefaultItem(),