X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/036da5e37479c4e2bc3493d3a7a37ac629757515..b72aa48cdeca3530ffb6ac5af438835d58bf79d9:/src/msw/window.cpp?ds=inline diff --git a/src/msw/window.cpp b/src/msw/window.cpp index b99b966f66..b280a33098 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1995,9 +1995,23 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) return TRUE; } - //else: no default button + else // no default button + { #endif // wxUSE_BUTTON - // treat Enter as TAB: pass to the next control + // this is a quick and dirty test for a text + // control + if ( !(lDlgCode & DLGC_HASSETSEL) ) + { + // don't process Enter, the control might + // need it for itself and don't let + // ::IsDialogMessage() have it as it can + // eat the Enter events sometimes + return FALSE; + } + //else: treat Enter as TAB: pass to the next + // control as this is the best thing to do + // if the text doesn't handle Enter itself + } } } break; @@ -2407,9 +2421,15 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam y = GET_Y_LPARAM(lParam); // redirect the event to a static control if necessary - wxWindow *win = FindWindowForMouseEvent(this, &x, &y); - - processed = win->HandleMouseEvent(message, x, y, wParam); + if (this == GetCapture()) + { + processed = HandleMouseEvent(message, x, y, wParam); + } + else + { + wxWindow *win = FindWindowForMouseEvent(this, &x, &y); + processed = win->HandleMouseEvent(message, x, y, wParam); + } } } break;