Don't connect handler for wxEVT_TEXT_ENTER in wxComboCtrl unnecessarily

Connecting to wxEVT_TEXT_ENTER is not necessary if wxTE_PROCESS_ENTER style is
not used was always useless and is actively harmful since the changes of
5591a20093 as it results in an assert failure
now.

Just don't do it unless we really want, and will get, these events.
This commit is contained in:
Vadim Zeitlin 2016-02-29 18:47:30 +01:00
parent 7e493c3a3c
commit cee3188c1a

View File

@ -1100,9 +1100,12 @@ wxComboCtrlBase::CreateTextCtrl(int style)
m_text->Connect(id, wxEVT_TEXT,
wxCommandEventHandler(wxComboCtrlBase::OnTextCtrlEvent),
NULL, this);
m_text->Connect(id, wxEVT_TEXT_ENTER,
wxCommandEventHandler(wxComboCtrlBase::OnTextCtrlEvent),
NULL, this);
if ( style & wxTE_PROCESS_ENTER )
{
m_text->Connect(id, wxEVT_TEXT_ENTER,
wxCommandEventHandler(wxComboCtrlBase::OnTextCtrlEvent),
NULL, this);
}
m_text->SetHint(m_hintText);
}