From 7a19fb6e5fca677fb8175b77bc284ed81bfb9ce1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 2 Jul 2005 22:16:12 +0000 Subject: [PATCH] fixed bug with showing unneeded scrollbar in the list control (at least under MSW) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34805 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listbkg.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/generic/listbkg.cpp b/src/generic/listbkg.cpp index e9b4baa656..e3208c2611 100644 --- a/src/generic/listbkg.cpp +++ b/src/generic/listbkg.cpp @@ -235,6 +235,12 @@ void wxListbook::OnSize(wxSizeEvent& event) break; } + // arrange the icons before calling SetClientSize(), otherwise it wouldn't + // account for the scrollbars the list control might need and, at least + // under MSW, we'd finish with an ugly looking list control with both + // vertical and horizontal scrollbar (with one of them being added because + // the other one is not accounted for in client size computations) + m_list->Arrange(); m_list->Move(posList.x, posList.y); m_list->SetClientSize(sizeList.x, sizeList.y); @@ -276,7 +282,7 @@ void wxListbook::OnSize(wxSizeEvent& event) wxWindow *page = m_pages[m_selection]; wxCHECK_RET( page, _T("NULL page in wxListbook?") ); page->SetSize(GetPageRect()); - } + } } wxSize wxListbook::CalcSizeFromPage(const wxSize& sizePage) const -- 2.45.2