From: Vadim Zeitlin Date: Sat, 30 Jun 2012 23:41:27 +0000 (+0000) Subject: Make wxBookCtrlBase::GetPage() virtual to fix it for wxAuiNotebook. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/005b12d8bee1a7b8594be8ddf37a3f121abfcf46 Make wxBookCtrlBase::GetPage() virtual to fix it for wxAuiNotebook. wxAuiNotebook doesn't store its page in the base class m_pages array, so calling GetPage() on it via a wxBookCtrl pointer resulted in a crash. Make GetPage() virtual to allow overriding it at wxAuiNotebook level. Closes #13768. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71908 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/aui/auibook.h b/include/wx/aui/auibook.h index 9d488b04a8..d42d784c5d 100644 --- a/include/wx/aui/auibook.h +++ b/include/wx/aui/auibook.h @@ -289,8 +289,8 @@ public: bool DeletePage(size_t page); bool RemovePage(size_t page); - size_t GetPageCount() const; - wxWindow* GetPage(size_t pageIdx) const; + virtual size_t GetPageCount() const; + virtual wxWindow* GetPage(size_t pageIdx) const; int GetPageIndex(wxWindow* pageWnd) const; bool SetPageText(size_t page, const wxString& text); diff --git a/include/wx/bookctrl.h b/include/wx/bookctrl.h index 163dd8efa0..50087a2526 100644 --- a/include/wx/bookctrl.h +++ b/include/wx/bookctrl.h @@ -95,7 +95,7 @@ public: virtual size_t GetPageCount() const { return m_pages.size(); } // get the panel which represents the given page - wxWindow *GetPage(size_t n) const { return m_pages[n]; } + virtual wxWindow *GetPage(size_t n) const { return m_pages[n]; } // get the current page or NULL if none wxWindow *GetCurrentPage() const