#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
// calculate the size of the control from the size of its page
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const = 0;
+ // get/set size of area between book control area and page area
+ inline unsigned int GetInternalBorder() const
+ {
+ return m_internalBorder;
+ }
+ void SetInternalBorder(unsigned int internalBorder)
+ {
+ m_internalBorder = internalBorder;
+ }
// operations
// ----------
}
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;
// helper: get the next page wrapping if we reached the end
int GetNextPage(bool forward) const;
- // common part of all ctors
- void Init();
-
// Always rely on GetBestSize, which will look at all the pages
virtual void SetInitialBestSize(const wxSize& WXUNUSED(size)) { }
// true if we must delete m_imageList
bool m_ownsImageList;
+private:
+
+ // common part of all ctors
+ void Init();
+
+ // internal border
+ unsigned int m_internalBorder;
DECLARE_NO_COPY_CLASS(wxBookCtrlBase)
};