From ee018b89b72204c71e4cd849fbc1739c85eb123e Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 10 Apr 2002 18:15:17 +0000 Subject: [PATCH] wxScrolledWindow::GetVirtualSize now returns client size if scrolling parameters have not been set. This makes Layout() work again for scrolled windows. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15079 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/scrlwing.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index b19d93d85b..904104e371 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -799,10 +799,24 @@ void wxScrollHelper::EnableScrolling (bool x_scroll, bool y_scroll) void wxScrollHelper::GetVirtualSize (int *x, int *y) const { + wxSize sz(0, 0); + if (m_targetWindow) + sz = m_targetWindow->GetClientSize(); + if ( x ) - *x = m_xScrollPixelsPerLine * m_xScrollLines; + { + if (m_xScrollPixelsPerLine == 0) + *x = sz.x; + else + *x = m_xScrollPixelsPerLine * m_xScrollLines; + } if ( y ) - *y = m_yScrollPixelsPerLine * m_yScrollLines; + { + if (m_yScrollPixelsPerLine == 0) + *y = sz.y; + else + *y = m_yScrollPixelsPerLine * m_yScrollLines; + } } // Where the current view starts from -- 2.45.2