]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/gizmos/editlbox.cpp
added support for colour cursors in wxGTK (patch 1655576)
[wxWidgets.git] / contrib / src / gizmos / editlbox.cpp
index 5f73e158830aedb4808a8c3ead38580a73896ed5..a9315781decef7b06fc3ed05620f75226d5620bd 100644 (file)
@@ -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);
     }
 }