Permalink
Browse files

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
5591a20 as it results in an assert failure
now.

Just don't do it unless we really want, and will get, these events.
  • Loading branch information...
vadz committed Feb 29, 2016
1 parent 7e493c3 commit cee3188c1abaa5b222c57b87cc94064e56921db8
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/common/combocmn.cpp
View
@@ -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);
}

0 comments on commit cee3188

Please sign in to comment.