From: Julian Smart Date: Sat, 13 Apr 2002 15:16:11 +0000 (+0000) Subject: Fixed GetVirtualSize for wxGTK's wxScrolledWindow X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a6ae98cb7cb2d876e8e8cc458feb1ff3e2c8fe78 Fixed GetVirtualSize for wxGTK's wxScrolledWindow git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15131 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/scrolwin.cpp b/src/gtk/scrolwin.cpp index 175fb3494d..9009eb64ae 100644 --- a/src/gtk/scrolwin.cpp +++ b/src/gtk/scrolwin.cpp @@ -573,10 +573,24 @@ void wxScrolledWindow::EnableScrolling (bool x_scroll, bool y_scroll) void wxScrolledWindow::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 diff --git a/src/gtk1/scrolwin.cpp b/src/gtk1/scrolwin.cpp index 175fb3494d..9009eb64ae 100644 --- a/src/gtk1/scrolwin.cpp +++ b/src/gtk1/scrolwin.cpp @@ -573,10 +573,24 @@ void wxScrolledWindow::EnableScrolling (bool x_scroll, bool y_scroll) void wxScrolledWindow::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