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

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2003-09-14 22:59:02 +00:00
parent 86351e4a9d
commit ab96d680eb

View File

@ -4365,6 +4365,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);