From a6ae98cb7cb2d876e8e8cc458feb1ff3e2c8fe78 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 13 Apr 2002 15:16:11 +0000 Subject: [PATCH] Fixed GetVirtualSize for wxGTK's wxScrolledWindow git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15131 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/scrolwin.cpp | 18 ++++++++++++++++-- src/gtk1/scrolwin.cpp | 18 ++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) 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 -- 2.45.2