backport: adjust m_current when inserting items in the control (patch 799937)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-09-14 23:01:58 +00:00
parent 7e6e96f608
commit 1c4a0ca4c1

View File

@@ -4502,6 +4502,14 @@ void wxListMainWindow::InsertItem( wxListItem &item )
m_dirty = TRUE;
// If an item is selected at or below the point of insertion, we need to
// increment the member variables because the current row's index has gone
// up by one
if ( HasCurrent() && m_current >= id )
{
m_current++;
}
SendNotify(id, wxEVT_COMMAND_LIST_INSERT_ITEM);
RefreshLines(id, GetItemCount() - 1);