wxTextCtrl works as itshould in disabled and/or not editable states

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8579 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-10-18 17:46:08 +00:00
parent 85df8658e0
commit 3b56ef075a
7 changed files with 240 additions and 67 deletions

View File

@@ -287,8 +287,31 @@ void wxListBox::Delete(int n)
}
//else: current item may stay
m_selections.Remove(n);
// update the selections array: the indices of all seletected items after
// the one being deleted must change and the item itselfm ust be removed
int index = wxNOT_FOUND;
size_t count = m_selections.GetCount();
for ( size_t item = 0; item < count; item++ )
{
if ( m_selections[item] == n )
{
// remember to delete it later
index = item;
}
else if ( m_selections[item] > n )
{
// to account for the index shift
m_selections[item]--;
}
//else: nothing changed for this one
}
if ( index != wxNOT_FOUND )
{
m_selections.RemoveAt(index);
}
// the number of items has changed, hence the scrollbar may disappear
m_updateScrollbarY = TRUE;
}