]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for enter processing of owner-drawn buttons
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 1 Dec 2000 01:13:20 +0000 (01:13 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 1 Dec 2000 01:13:20 +0000 (01:13 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8868 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index b19210ce935046748931df84aba41b7ea34ff8f0..12df5910536aa6f540fd7aa9df12952cd3184fe2 100644 (file)
@@ -1557,7 +1557,18 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
                         }
                         else if ( lDlgCode & DLGC_BUTTON )
                         {
-                            // buttons want process Enter themselevs
+                            // let IsDialogMessage() handle this for all
+                            // buttons except the owner-drawn ones which it
+                            // just seems to ignore
+                            long style = ::GetWindowLong(msg->hwnd, GWL_STYLE);
+                            if ( (style & BS_OWNERDRAW) == BS_OWNERDRAW )
+                            {
+                                // emulate the button click
+                                wxWindow *btn = wxFindWinFromHandle((WXHWND)msg->hwnd);
+                                if ( btn )
+                                    btn->MSWCommand(BN_CLICKED, 0 /* unused */);
+                            }
+
                             bProcess = FALSE;
                         }
                         else