From 5e4196efab9d4df965430decadf6dc130f523aa3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 9 Jul 2003 23:09:09 +0000 Subject: [PATCH] wxScrolledWindow scrollbar update fix (patch 680427) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@21827 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/scrlwing.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index b43a1067e8..91c02243d2 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -356,15 +356,24 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX, if (do_refresh && !noRefresh) m_targetWindow->Refresh(TRUE, GetRect()); - // TODO: check if we can use AdjustScrollbars always. -#ifdef __WXUNIVERSAL__ - AdjustScrollbars(); -#else - // This is also done by AdjustScrollbars, above +#ifndef __WXUNIVERSAL__ + // If the target is not the same as the window with the scrollbars, + // then we need to update the scrollbars here, since they won't have + // been updated by SetVirtualSize(). + if ( m_targetWindow != m_win ) +#endif // !__WXUNIVERSAL__ + { + AdjustScrollbars(); + } +#ifndef __WXUNIVERSAL__ + else + { + // otherwise this has been done by AdjustScrollbars, above #ifdef __WXMAC__ - m_targetWindow->MacUpdateImmediately() ; -#endif + m_targetWindow->MacUpdateImmediately() ; #endif + } +#endif // !__WXUNIVERSAL__ } // ----------------------------------------------------------------------------