]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/selstore.cpp
use IMPLEMENT_APP_CONSOLE and not IMPLEMENT_APP for console apps
[wxWidgets.git] / src / generic / selstore.cpp
index 2422bd8057f3388fefca039f2fb17ca3d55fdf79..4333aeaeaac99d1d5ec53c96d34f21725aa93c44 100644 (file)
@@ -214,3 +214,19 @@ void wxSelectionStore::OnItemDelete(unsigned item)
     }
 }
 
+void wxSelectionStore::SetItemCount(unsigned count)
+{
+    // forget about all items whose indices are now invalid if the size
+    // decreased
+    if ( count < m_count )
+    {
+        for ( size_t i = m_itemsSel.GetCount(); i > 0; i-- )
+        {
+            if ( m_itemsSel[i - 1] >= count )
+                m_itemsSel.RemoveAt(i - 1);
+        }
+    }
+
+    // remember the new number of items
+    m_count = count;
+}