X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/52f2ad0899c3e625b6ae1449524993ed8be39d7a..2add9e3c2f07bdb9234fbf3b84dda6b04d5ed598:/contrib/src/gizmos/editlbox.cpp diff --git a/contrib/src/gizmos/editlbox.cpp b/contrib/src/gizmos/editlbox.cpp index 1e0271a58c..a9315781de 100644 --- a/contrib/src/gizmos/editlbox.cpp +++ b/contrib/src/gizmos/editlbox.cpp @@ -7,10 +7,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ - #pragma implementation "editlbox.h" -#endif - // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" @@ -228,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); } }