X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/94af7d45eff65baa84c142b8238267217ba4617d..9e84b84742248ef54a561b4937bbc039332c2c51:/src/msw/textctrl.cpp?ds=sidebyside diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index cee29ac19e..24af3187f6 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -701,8 +701,8 @@ bool wxTextCtrl::EmulateKeyPress(const wxKeyEvent& event) size_t lenOld = GetValue().length(); wxUint32 code = event.GetRawKeyCode(); - ::keybd_event(code, 0, 0 /* key press */, NULL); - ::keybd_event(code, 0, KEYEVENTF_KEYUP, NULL); + ::keybd_event(code, 0, 0 /* key press */, 0); + ::keybd_event(code, 0, KEYEVENTF_KEYUP, 0); // assume that any alphanumeric key changes the total number of characters // in the control - this should work in 99% of cases @@ -1217,7 +1217,8 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) long wxTextCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) { - // we always want the characters and the arrows + long lRc = wxTextCtrlBase::MSWWindowProc(nMsg, wParam, lParam); + if ( nMsg == WM_GETDLGCODE ) { // we always want the chars and the arrows @@ -1225,22 +1226,30 @@ long wxTextCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) // we may have several different cases: // 1. normal case: both TAB and ENTER are used for dialog navigation - // 2. ctrl which wants TAB for itself: ENTER is used to pass to the next - // control in the dialog - // 3. ctrl which wants ENTER for itself: TAB is used for dialog navigation - // 4. ctrl which wants both TAB and ENTER: Ctrl-ENTER is used to pass to - // the next control - if ( m_windowStyle & wxTE_PROCESS_ENTER ) + // 2. ctrl which wants TAB for itself: ENTER is used to pass to the + // next control in the dialog + // 3. ctrl which wants ENTER for itself: TAB is used for dialog + // navigation + // 4. ctrl which wants both TAB and ENTER: Ctrl-ENTER is used to pass + // to the next control + + // the multiline edit control should always get for itself + if ( HasFlag(wxTE_PROCESS_ENTER) || HasFlag(wxTE_MULTILINE) ) lDlgCode |= DLGC_WANTMESSAGE; - if ( m_windowStyle & wxTE_PROCESS_TAB ) + + if ( HasFlag(wxTE_PROCESS_TAB) ) lDlgCode |= DLGC_WANTTAB; - return lDlgCode; + lRc |= lDlgCode; } - return wxTextCtrlBase::MSWWindowProc(nMsg, wParam, lParam); + return lRc; } +// ---------------------------------------------------------------------------- +// text control event processing +// ---------------------------------------------------------------------------- + bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) { switch (param)