From fa3ebb122107595c0a08eb24a8fd2503e68f4cd4 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 1 Sep 2006 15:38:37 +0000 Subject: [PATCH] Commit ODCombo delete selection fix. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/odcombo.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index c72efc280c..8e83c45616 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -556,8 +556,16 @@ void wxVListBoxComboPopup::Delete( unsigned int item ) if ( (int)item == m_widestItem ) m_findWidest = true; + int sel = GetSelection(); + if ( IsCreated() ) wxVListBox::SetItemCount( wxVListBox::GetItemCount()-1 ); + + // Fix selection + if ( (int)item < sel ) + SetSelection(sel-1); + else if ( (int)item == sel ) + SetSelection(wxNOT_FOUND); } int wxVListBoxComboPopup::FindString(const wxString& s, bool bCase) const -- 2.45.2