Completely re-construct the wxComboCtrl textctrl-events instead of just redirecting them
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67439 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1754,6 +1754,13 @@ void wxComboCtrlBase::RecalcAndRefresh()
|
|||||||
|
|
||||||
void wxComboCtrlBase::OnTextCtrlEvent(wxCommandEvent& event)
|
void wxComboCtrlBase::OnTextCtrlEvent(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
|
// Avoid infinite recursion
|
||||||
|
if ( event.GetEventObject() == this )
|
||||||
|
{
|
||||||
|
event.Skip();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( event.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED )
|
if ( event.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED )
|
||||||
{
|
{
|
||||||
if ( m_ignoreEvtText > 0 )
|
if ( m_ignoreEvtText > 0 )
|
||||||
@@ -1763,12 +1770,13 @@ void wxComboCtrlBase::OnTextCtrlEvent(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change event id, object and string before relaying it forward
|
event.StopPropagation();
|
||||||
event.SetId(GetId());
|
|
||||||
wxString s = event.GetString();
|
// For safety, completely re-create a new wxCommandEvent
|
||||||
event.SetEventObject(this);
|
wxCommandEvent evt2(event.GetEventType(), GetId());
|
||||||
event.SetString(s);
|
evt2.SetEventObject(this);
|
||||||
event.Skip();
|
evt2.SetString(event.GetString());
|
||||||
|
HandleWindowEvent(evt2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// call if cursor is on button area or mouse is captured for the button
|
// call if cursor is on button area or mouse is captured for the button
|
||||||
|
Reference in New Issue
Block a user