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
This commit is contained in:
Vadim Zeitlin
2003-08-22 21:59:47 +00:00
parent 275341c036
commit c59da60ade

View File

@@ -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;