From a0d8a3052817fef6eef27e9a6ab8802495a39db8 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 2 Apr 1999 19:05:02 +0000 Subject: [PATCH] Fixed doubled-up key effects in wxTextCtrl by resetting m_lastMsg to 0 after calling Default(). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 93396297f8..2a3c008acf 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2047,7 +2047,13 @@ long wxWindow::Default() wxGetMessageName(m_lastMsg)); #endif // __WXDEBUG__ - return this->MSWDefWindowProc(m_lastMsg, m_lastWParam, m_lastLParam); + long ret = this->MSWDefWindowProc(m_lastMsg, m_lastWParam, m_lastLParam); + + // The idea here is to prevent MSWDefWindowProc from being called twice, + // which it can be where OnChar/OnKeyDown are concerned (because OnChar is + // sometimes called in wxWin where it isn't in MSW) + m_lastMsg = 0; + return ret; } bool wxWindow::MSWProcessMessage(WXMSG* pMsg) @@ -3791,7 +3797,10 @@ void wxWindow::OnChar(wxKeyEvent& event) id= m_lastWParam; if ( !event.ControlDown() ) // Why this test? - (void) MSWDefWindowProc(m_lastMsg, (WPARAM) id, m_lastLParam); + { + if (m_lastMsg != 0) + (void) MSWDefWindowProc(m_lastMsg, (WPARAM) id, m_lastLParam); + } } void wxWindow::OnKeyDown(wxKeyEvent& event)