X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d5d29b8a2250ee3097f31dfb8593374b89128ce2..b4e0b521e0878a495c570af3d68b40c82b4a92b3:/include/wx/bookctrl.h diff --git a/include/wx/bookctrl.h b/include/wx/bookctrl.h index 579350fa4f..d404021123 100644 --- a/include/wx/bookctrl.h +++ b/include/wx/bookctrl.h @@ -5,7 +5,7 @@ // Modified by: // Created: 19.08.03 // RCS-ID: $Id$ -// Copyright: (c) 2003 Vadim Zeitlin +// Copyright: (c) 2003 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -47,7 +47,7 @@ public: } wxBookCtrl(wxWindow *parent, - wxWindowID id, + wxWindowID winid, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, @@ -55,12 +55,12 @@ public: { Init(); - (void)Create(parent, id, pos, size, style, name); + (void)Create(parent, winid, pos, size, style, name); } // quasi ctor bool Create(wxWindow *parent, - wxWindowID id, + wxWindowID winid, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, @@ -122,10 +122,19 @@ public: virtual bool DeletePage(size_t n); // remove one page from the notebook, without deleting it - virtual bool RemovePage(size_t n) { return DoRemovePage(n) != NULL; } + virtual bool RemovePage(size_t n) + { + InvalidateBestSize(); + return DoRemovePage(n) != NULL; + } // remove all pages and delete them - virtual bool DeleteAllPages() { WX_CLEAR_ARRAY(m_pages); return true; } + virtual bool DeleteAllPages() + { + InvalidateBestSize(); + WX_CLEAR_ARRAY(m_pages); + return true; + } // adds a new page to the control virtual bool AddPage(wxWindow *page, @@ -133,6 +142,7 @@ public: bool bSelect = false, int imageId = -1) { + InvalidateBestSize(); return InsertPage(GetPageCount(), page, text, bSelect, imageId); } @@ -146,7 +156,7 @@ public: // set the currently selected page, return the index of the previously // selected one (or -1 on error) // - // NB: this function will _not_ generate PAGE_CHANGING/ED events + // NB: this function will generate PAGE_CHANGING/ED events virtual int SetSelection(size_t n) = 0; @@ -161,6 +171,9 @@ public: } } + virtual void ApplyParentThemeBackground(const wxColour& bg) + { SetBackgroundColour(bg); } + protected: // remove the page and return a pointer to it virtual wxWindow *DoRemovePage(size_t page) = 0; @@ -174,6 +187,8 @@ protected: // 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)) { } // the array of all pages of this control wxArrayPages m_pages; @@ -195,9 +210,9 @@ protected: class WXDLLEXPORT wxBookCtrlEvent : public wxNotifyEvent { public: - wxBookCtrlEvent(wxEventType commandType = wxEVT_NULL, int id = 0, + wxBookCtrlEvent(wxEventType commandType = wxEVT_NULL, int winid = 0, int nSel = -1, int nOldSel = -1) - : wxNotifyEvent(commandType, id) + : wxNotifyEvent(commandType, winid) { m_nSel = nSel; m_nOldSel = nOldSel;