From fbd11d30c8499ef25989974ef6ec16fb5b759668 Mon Sep 17 00:00:00 2001
From: Robin Dunn <robin@alldunn.com>
Date: Wed, 25 Aug 2004 22:10:20 +0000
Subject: [PATCH] wxListbook needs to clean up the wxListCtrl when
 DeleteAllPages is called.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28909 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 include/wx/listbook.h   | 2 ++
 src/generic/listbkg.cpp | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/include/wx/listbook.h b/include/wx/listbook.h
index 73244fc256..a912075502 100644
--- a/include/wx/listbook.h
+++ b/include/wx/listbook.h
@@ -109,6 +109,8 @@ public:
     // returns true if we have wxLB_TOP or wxLB_BOTTOM style
     bool IsVertical() const { return HasFlag(wxLB_BOTTOM | wxLB_TOP); }
 
+    virtual bool DeleteAllPages();
+
 protected:
     virtual wxWindow *DoRemovePage(size_t page);
 
diff --git a/src/generic/listbkg.cpp b/src/generic/listbkg.cpp
index c75120bd59..2fcf9a8548 100644
--- a/src/generic/listbkg.cpp
+++ b/src/generic/listbkg.cpp
@@ -411,6 +411,13 @@ wxWindow *wxListbook::DoRemovePage(size_t page)
     return win;
 }
 
+
+bool wxListbook::DeleteAllPages()
+{
+    m_list->DeleteAllItems();
+    return wxBookCtrl::DeleteAllPages();
+}
+
 // ----------------------------------------------------------------------------
 // wxListbook events
 // ----------------------------------------------------------------------------
-- 
2.47.2