]> git.saurik.com Git - wxWidgets.git/commitdiff
changing the number of items in wxHtmlListBox should flush the cache
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 26 Jun 2003 10:05:13 +0000 (10:05 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 26 Jun 2003 10:05:13 +0000 (10:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21421 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/htmllbox.h
include/wx/vlbox.h
src/generic/htmllbox.cpp

index 97f2ae413edae12f43b86f44e60572b4f8266aa2..666717632bdf56892fe1ea315008ba69320e08fb 100644 (file)
@@ -61,9 +61,9 @@ public:
     // destructor cleans up whatever resources we use
     virtual ~wxHtmlListBox();
 
-    // refresh everything
+    // override some base class virtuals
     virtual void RefreshAll();
-
+    virtual void SetItemCount(size_t count);
 
 protected:
     // this method must be implemented in the derived class and should return
index 5e09100e7fb83345b7318eeb37a7990d03363046..276076ece7e6e3f280e3a24a4b8abd9215d34ac2 100644 (file)
@@ -130,7 +130,7 @@ public:
     // set the number of items to be shown in the control
     //
     // this is just a synonym for wxVScrolledWindow::SetLineCount()
-    void SetItemCount(size_t count);
+    virtual void SetItemCount(size_t count);
 
     // delete all items from the control
     void Clear() { SetItemCount(0); }
index a9d2f468c3423d21481ea6731e8382593dbe7f17..dff147a45c6dc1592f97622051e2e30aca336b00 100644 (file)
@@ -262,6 +262,14 @@ void wxHtmlListBox::RefreshAll()
     wxVListBox::RefreshAll();
 }
 
+void wxHtmlListBox::SetItemCount(size_t count)
+{
+    // the items are going to change, forget the old ones
+    m_cache->Clear();
+
+    wxVListBox::SetItemCount(count);
+}
+
 // ----------------------------------------------------------------------------
 // wxHtmlListBox implementation of wxVListBox pure virtuals
 // ----------------------------------------------------------------------------