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
This commit is contained in:
Julian Smart 2002-04-10 18:15:17 +00:00
parent f5f05abf22
commit ee018b89b7

View File

@ -799,10 +799,24 @@ void wxScrollHelper::EnableScrolling (bool x_scroll, bool y_scroll)
void wxScrollHelper::GetVirtualSize (int *x, int *y) const void wxScrollHelper::GetVirtualSize (int *x, int *y) const
{ {
wxSize sz(0, 0);
if (m_targetWindow)
sz = m_targetWindow->GetClientSize();
if ( x ) if ( x )
{
if (m_xScrollPixelsPerLine == 0)
*x = sz.x;
else
*x = m_xScrollPixelsPerLine * m_xScrollLines; *x = m_xScrollPixelsPerLine * m_xScrollLines;
}
if ( y ) if ( y )
{
if (m_yScrollPixelsPerLine == 0)
*y = sz.y;
else
*y = m_yScrollPixelsPerLine * m_yScrollLines; *y = m_yScrollPixelsPerLine * m_yScrollLines;
}
} }
// Where the current view starts from // Where the current view starts from