X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2a77c8c455237806f1ef7900ecb5b90b813c488f..b72aa48cdeca3530ffb6ac5af438835d58bf79d9:/src/msw/window.cpp?ds=sidebyside diff --git a/src/msw/window.cpp b/src/msw/window.cpp index c633426aba..b280a33098 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1996,12 +1996,21 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) return TRUE; } else // no default button -#endif // wxUSE_BUTTON { - // no special function for enter and don't even - // let IsDialogMessage() have it: it seems to - // do something really strange with it - return FALSE; +#endif // wxUSE_BUTTON + // 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 } } } @@ -2412,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;