X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..9f556d1dd6a06524c0d5419862836b9f0e9e6e1d:/contrib/src/gizmos/editlbox.cpp diff --git a/contrib/src/gizmos/editlbox.cpp b/contrib/src/gizmos/editlbox.cpp index 5f73e15883..a9315781de 100644 --- a/contrib/src/gizmos/editlbox.cpp +++ b/contrib/src/gizmos/editlbox.cpp @@ -224,6 +224,12 @@ void wxEditableListBox::OnEndLabelEdit(wxListEvent& event) // add new empty line here so that adding one more line is still // possible: m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), wxEmptyString); + + // Simulate a wxEVT_COMMAND_LIST_ITEM_SELECTED event for the new item, + // so that the buttons are enabled/disabled properly + wxListEvent selectionEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED, m_listCtrl->GetId()); + selectionEvent.m_itemIndex = event.GetIndex(); + m_listCtrl->GetEventHandler()->ProcessEvent(selectionEvent); } }