]> git.saurik.com Git - wxWidgets.git/commitdiff
Commit ODCombo delete selection fix.
authorRobert Roebling <robert@roebling.de>
Fri, 1 Sep 2006 15:38:37 +0000 (15:38 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 1 Sep 2006 15:38:37 +0000 (15:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/odcombo.cpp

index c72efc280cdf16387145d1d0ae24fbe8947edcf1..8e83c45616055189e314085f7a6e02fdf214a901 100644 (file)
@@ -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