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
This commit is contained in:
@@ -2047,7 +2047,13 @@ long wxWindow::Default()
|
|||||||
wxGetMessageName(m_lastMsg));
|
wxGetMessageName(m_lastMsg));
|
||||||
#endif // __WXDEBUG__
|
#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)
|
bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
|
||||||
@@ -3791,7 +3797,10 @@ void wxWindow::OnChar(wxKeyEvent& event)
|
|||||||
id= m_lastWParam;
|
id= m_lastWParam;
|
||||||
|
|
||||||
if ( !event.ControlDown() ) // Why this test?
|
if ( !event.ControlDown() ) // Why this test?
|
||||||
|
{
|
||||||
|
if (m_lastMsg != 0)
|
||||||
(void) MSWDefWindowProc(m_lastMsg, (WPARAM) id, m_lastLParam);
|
(void) MSWDefWindowProc(m_lastMsg, (WPARAM) id, m_lastLParam);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::OnKeyDown(wxKeyEvent& event)
|
void wxWindow::OnKeyDown(wxKeyEvent& event)
|
||||||
|
Reference in New Issue
Block a user