From b03f81b7780b8ea5e25894929f55762e40cbd70d Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Mon, 5 Aug 2002 17:56:06 +0000 Subject: [PATCH] Miserable hack around problem when shrinking a scrolled window with child windows when it was maxiamally scrolled. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16370 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/scrolwin.cpp | 14 ++++++++++---- src/gtk1/scrolwin.cpp | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/gtk/scrolwin.cpp b/src/gtk/scrolwin.cpp index 222c399fc3..a072691442 100644 --- a/src/gtk/scrolwin.cpp +++ b/src/gtk/scrolwin.cpp @@ -383,8 +383,11 @@ void wxScrolledWindow::AdjustScrollbars() if( m_hAdjust->value + m_hAdjust->page_size > m_hAdjust->upper ) { - m_hAdjust->value = m_hAdjust->upper - m_hAdjust->page_size; - m_xScrollPosition = (int)m_hAdjust->value; + if (GetChildren().GetCount() == 0) + { + m_hAdjust->value = m_hAdjust->upper - m_hAdjust->page_size; + m_xScrollPosition = (int)m_hAdjust->value; + } } } @@ -400,8 +403,11 @@ void wxScrolledWindow::AdjustScrollbars() if( m_vAdjust->value + m_vAdjust->page_size > m_vAdjust->upper ) { - m_vAdjust->value = m_vAdjust->upper - m_vAdjust->page_size; - m_yScrollPosition = (int)m_vAdjust->value; + if (GetChildren().GetCount() == 0) + { + m_vAdjust->value = m_vAdjust->upper - m_vAdjust->page_size; + m_yScrollPosition = (int)m_vAdjust->value; + } } } diff --git a/src/gtk1/scrolwin.cpp b/src/gtk1/scrolwin.cpp index 222c399fc3..a072691442 100644 --- a/src/gtk1/scrolwin.cpp +++ b/src/gtk1/scrolwin.cpp @@ -383,8 +383,11 @@ void wxScrolledWindow::AdjustScrollbars() if( m_hAdjust->value + m_hAdjust->page_size > m_hAdjust->upper ) { - m_hAdjust->value = m_hAdjust->upper - m_hAdjust->page_size; - m_xScrollPosition = (int)m_hAdjust->value; + if (GetChildren().GetCount() == 0) + { + m_hAdjust->value = m_hAdjust->upper - m_hAdjust->page_size; + m_xScrollPosition = (int)m_hAdjust->value; + } } } @@ -400,8 +403,11 @@ void wxScrolledWindow::AdjustScrollbars() if( m_vAdjust->value + m_vAdjust->page_size > m_vAdjust->upper ) { - m_vAdjust->value = m_vAdjust->upper - m_vAdjust->page_size; - m_yScrollPosition = (int)m_vAdjust->value; + if (GetChildren().GetCount() == 0) + { + m_vAdjust->value = m_vAdjust->upper - m_vAdjust->page_size; + m_yScrollPosition = (int)m_vAdjust->value; + } } }