#ifndef _WX_BOOKCTRL_H_
#define _WX_BOOKCTRL_H_
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma interface "bookctrl.h"
-#endif
-
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
virtual size_t GetPageCount() const { return m_pages.size(); }
// get the panel which represents the given page
- virtual wxWindow *GetPage(size_t n) { return m_pages[n]; }
+ wxWindow *GetPage(size_t n) { return m_pages[n]; }
+ wxWindow *GetPage(size_t n) const { return m_pages[n]; }
// get the current page or NULL if none
wxWindow *GetCurrentPage() const
{
- int n = GetSelection();
- return n == wxNOT_FOUND ? NULL
- : wx_const_cast(wxBookCtrlBase *, this)->GetPage(n);
+ const int n = GetSelection();
+ return n == wxNOT_FOUND ? NULL : GetPage(n);
}
// get the currently selected page or wxNOT_FOUND if none
}
}
- // override some base class virtuals
- virtual void ApplyParentThemeBackground(const wxColour& bg)
- { SetBackgroundColour(bg); }
- virtual bool ProvidesBackground() const { return true; }
-
protected:
+ // Should we accept NULL page pointers in Add/InsertPage()?
+ //
+ // Default is no but derived classes may override it if they can treat NULL
+ // pages in some sensible way (e.g. wxTreebook overrides this to allow
+ // having nodes without any associated page)
+ virtual bool AllowNullPage() const { return false; }
+
// remove the page and return a pointer to it
virtual wxWindow *DoRemovePage(size_t page) = 0;
// Always rely on GetBestSize, which will look at all the pages
virtual void SetInitialBestSize(const wxSize& WXUNUSED(size)) { }
+
// the array of all pages of this control
wxArrayPages m_pages;