From ec7482df8b90237b3fa54e4f7e0684f6e9628ebf Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 26 Jul 2001 11:32:03 +0000 Subject: [PATCH] Fixed problem with missing refresh in wxScrolledWindow:: SetScrollbars(). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11181 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/scrolwin.cpp | 17 ++++++++++++++--- src/gtk1/scrolwin.cpp | 17 ++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/gtk/scrolwin.cpp b/src/gtk/scrolwin.cpp index ef89c29b5a..4a5737f0ba 100644 --- a/src/gtk/scrolwin.cpp +++ b/src/gtk/scrolwin.cpp @@ -241,12 +241,15 @@ void wxScrolledWindow::SetScrollbars (int pixelsPerUnitX, int pixelsPerUnitY, int noUnitsX, int noUnitsY, int xPos, int yPos, bool noRefresh ) { + int old_x = m_xScrollPixelsPerLine * m_xScrollPosition; + int old_y = m_yScrollPixelsPerLine * m_yScrollPosition; + m_xScrollPixelsPerLine = pixelsPerUnitX; m_yScrollPixelsPerLine = pixelsPerUnitY; - m_xScrollPosition = xPos; - m_yScrollPosition = yPos; m_xScrollLines = noUnitsX; m_yScrollLines = noUnitsY; + m_xScrollPosition = xPos; + m_yScrollPosition = yPos; m_hAdjust->lower = 0.0; m_hAdjust->upper = noUnitsX; @@ -259,8 +262,16 @@ void wxScrolledWindow::SetScrollbars (int pixelsPerUnitX, int pixelsPerUnitY, m_vAdjust->value = yPos; m_vAdjust->step_increment = 1.0; m_vAdjust->page_increment = 2.0; - + AdjustScrollbars(); + + if (!noRefresh) + { + int new_x = m_xScrollPixelsPerLine * m_xScrollPosition; + int new_y = m_yScrollPixelsPerLine * m_yScrollPosition; + + m_targetWindow->ScrollWindow( old_x-new_x, old_y-new_y ); + } } void wxScrolledWindow::AdjustScrollbars() diff --git a/src/gtk1/scrolwin.cpp b/src/gtk1/scrolwin.cpp index ef89c29b5a..4a5737f0ba 100644 --- a/src/gtk1/scrolwin.cpp +++ b/src/gtk1/scrolwin.cpp @@ -241,12 +241,15 @@ void wxScrolledWindow::SetScrollbars (int pixelsPerUnitX, int pixelsPerUnitY, int noUnitsX, int noUnitsY, int xPos, int yPos, bool noRefresh ) { + int old_x = m_xScrollPixelsPerLine * m_xScrollPosition; + int old_y = m_yScrollPixelsPerLine * m_yScrollPosition; + m_xScrollPixelsPerLine = pixelsPerUnitX; m_yScrollPixelsPerLine = pixelsPerUnitY; - m_xScrollPosition = xPos; - m_yScrollPosition = yPos; m_xScrollLines = noUnitsX; m_yScrollLines = noUnitsY; + m_xScrollPosition = xPos; + m_yScrollPosition = yPos; m_hAdjust->lower = 0.0; m_hAdjust->upper = noUnitsX; @@ -259,8 +262,16 @@ void wxScrolledWindow::SetScrollbars (int pixelsPerUnitX, int pixelsPerUnitY, m_vAdjust->value = yPos; m_vAdjust->step_increment = 1.0; m_vAdjust->page_increment = 2.0; - + AdjustScrollbars(); + + if (!noRefresh) + { + int new_x = m_xScrollPixelsPerLine * m_xScrollPosition; + int new_y = m_yScrollPixelsPerLine * m_yScrollPosition; + + m_targetWindow->ScrollWindow( old_x-new_x, old_y-new_y ); + } } void wxScrolledWindow::AdjustScrollbars() -- 2.45.2