From: Vadim Zeitlin Date: Fri, 5 Mar 2010 23:55:09 +0000 (+0000) Subject: No changes, just remove redundant GetControllerSize() definitions. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1d2b7f06a3dce24483009462f547f0011ae1fdc1 No changes, just remove redundant GetControllerSize() definitions. For some reasons wxBookCtrlBase::GetControllerSize() was redefined in several derived classes even though it did exactly the same thing in all of them. Leave only the base class version and remove the other ones. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/bookctrl.h b/include/wx/bookctrl.h index e101e0660c..fbb493ebe5 100644 --- a/include/wx/bookctrl.h +++ b/include/wx/bookctrl.h @@ -137,6 +137,9 @@ public: // resize the notebook so that all pages will have the specified size virtual void SetPageSize(const wxSize& size); + // return the size of the area needed to accommodate the controller + wxSize GetControllerSize() const; + // calculate the size of the control from the size of its page virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const = 0; @@ -312,7 +315,6 @@ protected: virtual wxRect GetPageRect() const; // event handlers - virtual wxSize GetControllerSize() const; void OnSize(wxSizeEvent& event); // controller buddy if available, NULL otherwise (usually for native book controls like wxNotebook) diff --git a/include/wx/choicebk.h b/include/wx/choicebk.h index 4daa5b28ff..ed7ff2bd7c 100644 --- a/include/wx/choicebk.h +++ b/include/wx/choicebk.h @@ -91,9 +91,6 @@ protected: virtual wxWindow *DoRemovePage(size_t page); - // get the size which the choice control should have - virtual wxSize GetControllerSize() const; - void UpdateSelectedPage(size_t newsel) { m_selection = static_cast(newsel); diff --git a/include/wx/listbook.h b/include/wx/listbook.h index a021dee95e..b1fb9a73a8 100644 --- a/include/wx/listbook.h +++ b/include/wx/listbook.h @@ -89,9 +89,6 @@ public: protected: virtual wxWindow *DoRemovePage(size_t page); - // get the size which the list control should have - virtual wxSize GetControllerSize() const; - void UpdateSelectedPage(size_t newsel); wxBookCtrlEvent* CreatePageChangingEvent() const; diff --git a/include/wx/toolbook.h b/include/wx/toolbook.h index 43f1ac3274..52e1de2a7e 100644 --- a/include/wx/toolbook.h +++ b/include/wx/toolbook.h @@ -101,9 +101,6 @@ public: protected: virtual wxWindow *DoRemovePage(size_t page); - // get the size which the list control should have - virtual wxSize GetControllerSize() const; - // event handlers void OnToolSelected(wxCommandEvent& event); void OnSize(wxSizeEvent& event); diff --git a/src/common/bookctrl.cpp b/src/common/bookctrl.cpp index 2ca683a7c2..da06cdafeb 100644 --- a/src/common/bookctrl.cpp +++ b/src/common/bookctrl.cpp @@ -289,12 +289,11 @@ void wxBookCtrlBase::OnSize(wxSizeEvent& event) wxSize wxBookCtrlBase::GetControllerSize() const { - if(!m_bookctrl) - return wxSize(0,0); + if ( !m_bookctrl ) + return wxSize(0, 0); const wxSize sizeClient = GetClientSize(), - sizeBorder = m_bookctrl->GetSize() - m_bookctrl->GetClientSize(), - sizeCtrl = m_bookctrl->GetBestSize() + sizeBorder; + sizeCtrl = m_bookctrl->GetBestSize(); wxSize size; diff --git a/src/generic/choicbkg.cpp b/src/generic/choicbkg.cpp index 731ff90cab..724c0a4215 100644 --- a/src/generic/choicbkg.cpp +++ b/src/generic/choicbkg.cpp @@ -115,26 +115,6 @@ wxChoicebook::Create(wxWindow *parent, // wxChoicebook geometry management // ---------------------------------------------------------------------------- -wxSize wxChoicebook::GetControllerSize() const -{ - const wxSize sizeClient = GetClientSize(), - sizeChoice = m_controlSizer->CalcMin(); - - wxSize size; - if ( IsVertical() ) - { - size.x = sizeClient.x; - size.y = sizeChoice.y; - } - else // left/right aligned - { - size.x = sizeChoice.x; - size.y = sizeClient.y; - } - - return size; -} - wxSize wxChoicebook::CalcSizeFromPage(const wxSize& sizePage) const { // we need to add the size of the choice control and the border between diff --git a/src/generic/listbkg.cpp b/src/generic/listbkg.cpp index e7dd71235d..5df5de104a 100644 --- a/src/generic/listbkg.cpp +++ b/src/generic/listbkg.cpp @@ -155,28 +155,6 @@ long wxListbook::GetListCtrlReportViewFlags() const // wxListbook geometry management // ---------------------------------------------------------------------------- -wxSize wxListbook::GetControllerSize() const -{ - const wxSize sizeClient = GetClientSize(), - sizeBorder = m_bookctrl->GetSize() - m_bookctrl->GetClientSize(), - sizeList = GetListView()->GetViewRect().GetSize() + sizeBorder; - - wxSize size; - - if ( IsVertical() ) - { - size.x = sizeClient.x; - size.y = sizeList.y; - } - else // left/right aligned - { - size.x = sizeList.x; - size.y = sizeClient.y; - } - - return size; -} - void wxListbook::OnSize(wxSizeEvent& event) { // arrange the icons before calling SetClientSize(), otherwise it wouldn't diff --git a/src/generic/toolbkg.cpp b/src/generic/toolbkg.cpp index fd642cc935..ae2dbbe36d 100644 --- a/src/generic/toolbkg.cpp +++ b/src/generic/toolbkg.cpp @@ -129,27 +129,6 @@ bool wxToolbook::Create(wxWindow *parent, // wxToolbook geometry management // ---------------------------------------------------------------------------- -wxSize wxToolbook::GetControllerSize() const -{ - const wxSize sizeClient = GetClientSize(), - sizeToolBar = GetToolBar()->GetBestSize(); - - wxSize size; - - if ( IsVertical() ) - { - size.x = sizeClient.x; - size.y = sizeToolBar.y; - } - else // left/right aligned - { - size.x = sizeToolBar.x; - size.y = sizeClient.y; - } - - return size; -} - void wxToolbook::OnSize(wxSizeEvent& event) { if (m_needsRealizing)