From 64725871e0c1441c55d49216797ea5c4dd042a2d Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 27 Dec 2002 14:04:10 +0000 Subject: [PATCH] Improved my fix to SetScrollbars, using wxMax & GetClientSize git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18421 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/scrlwing.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index 720b4f2ec4..3808f0b579 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -344,13 +344,14 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX, // here not just the size. It makes SetScrollbars 'sticky' // emulating the old non-autoscroll behaviour. - wxSize sz = m_targetWindow->GetSize(); + wxSize sz = m_targetWindow->GetClientSize(); +#if 1 + int x = wxMax(noUnitsX * pixelsPerUnitX, sz.x); + int y = wxMax(noUnitsY * pixelsPerUnitY, sz.y); +#else int x = noUnitsX * pixelsPerUnitX; int y = noUnitsY * pixelsPerUnitY; - if (x == 0) - x = sz.x; - if (y == 0) - y = sz.y; +#endif m_targetWindow->SetVirtualSizeHints( x, y ); // The above should arguably be deprecated, this however we still need.