From: Vadim Zeitlin Date: Fri, 22 Aug 2003 21:59:47 +0000 (+0000) Subject: try to size the list control correctly even when it has scrollbars X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c59da60ade987fd1e54f4aca0fdbc6d95d0d2388?ds=inline try to size the list control correctly even when it has scrollbars git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23114 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/listbkg.cpp b/src/generic/listbkg.cpp index 67f4f20987..0a616643e2 100644 --- a/src/generic/listbkg.cpp +++ b/src/generic/listbkg.cpp @@ -34,6 +34,7 @@ #include "wx/statline.h" #include "wx/listbook.h" #include "wx/imaglist.h" +#include "wx/settings.h" // ---------------------------------------------------------------------------- // constants @@ -150,11 +151,25 @@ wxSize wxListbook::GetListSize() const { size.x = sizeClient.x; size.y = heightMax; + + if ( widthMax >= sizeClient.x ) + { + // account for the scrollbar + size.y += wxSystemSettings::GetMetric(wxSYS_HSCROLL_Y); + } } else // left/right aligned { + // +10 is due to an apparent bug in wxListCtrl::GetItemRect() but I + // can't fix it there right now so just add a fudge here... size.x = widthMax + 10; size.y = sizeClient.y; + + if ( heightMax >= sizeClient.y ) + { + // account for the scrollbar + size.x += wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); + } } return size;