]> git.saurik.com Git - wxWidgets.git/commitdiff
No changes, just remove redundant GetControllerSize() definitions.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 5 Mar 2010 23:55:09 +0000 (23:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 5 Mar 2010 23:55:09 +0000 (23:55 +0000)
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

include/wx/bookctrl.h
include/wx/choicebk.h
include/wx/listbook.h
include/wx/toolbook.h
src/common/bookctrl.cpp
src/generic/choicbkg.cpp
src/generic/listbkg.cpp
src/generic/toolbkg.cpp

index e101e0660cc2713ebe11a1335cabce2ce86f3478..fbb493ebe5aa9fe6112819853bac4c98cbf35ad0 100644 (file)
@@ -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)
index 4daa5b28fff19e04acedba7b88308396d177115c..ed7ff2bd7c7843cefb83a4d07e209e3e53ba6bba 100644 (file)
@@ -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<int>(newsel);
index a021dee95e677b5c73f05e8dae58b90ca7b1ba6b..b1fb9a73a836a2cce2793cce4224c7b35036379a 100644 (file)
@@ -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;
index 43f1ac3274d556bcdebdc079b5b1e932e351ac8c..52e1de2a7e7d4115e0ed613625e598c72bad1882 100644 (file)
@@ -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);
index 2ca683a7c2c16191760e5fc7cf194034656ae331..da06cdafeba1ce300f7bc3f26a1ccdde4ffda51b 100644 (file)
@@ -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;
 
index 731ff90cabc313b147741cc7338b33f6bc6e45db..724c0a42150dcd8adc2666a067f82f91b9355dc3 100644 (file)
@@ -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
index e7dd71235d75033d4d0aaffee3fd294fb552946d..5df5de104a0d638663ff7427d3bcf1adc0a85c08 100644 (file)
@@ -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
index fd642cc93536b0afb86b432b88b48d6d455fc5cc..ae2dbbe36dd1ae592b449e03f3db230f89b20053 100644 (file)
@@ -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)