fixed extraneous scrolling when scrollbars are added/removed (patch 788026; bug 746618)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@22834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -603,6 +603,20 @@ int wxScrollHelper::CalcScrollInc(wxScrollWinEvent& event)
|
|||||||
// Adjust the scrollbars - new version.
|
// Adjust the scrollbars - new version.
|
||||||
void wxScrollHelper::AdjustScrollbars()
|
void wxScrollHelper::AdjustScrollbars()
|
||||||
{
|
{
|
||||||
|
static bool s_isInside = false;
|
||||||
|
if ( s_isInside )
|
||||||
|
{
|
||||||
|
// don't reenter AdjustScrollbars() while another call to
|
||||||
|
// AdjustScrollbars() is in progress because this may lead to calling
|
||||||
|
// ScrollWindow() twice and this can really happen under MSW if
|
||||||
|
// SetScrollbar() call below adds or removes the scrollbar which
|
||||||
|
// changes the window size and hence results in another
|
||||||
|
// AdjustScrollbars() call
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
s_isInside = true;
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
m_targetWindow->MacUpdateImmediately();
|
m_targetWindow->MacUpdateImmediately();
|
||||||
#endif
|
#endif
|
||||||
@@ -678,7 +692,7 @@ void wxScrollHelper::AdjustScrollbars()
|
|||||||
oldh = h;
|
oldh = h;
|
||||||
|
|
||||||
GetTargetSize( &w, &h );
|
GetTargetSize( &w, &h );
|
||||||
} while ( w != oldw && h != oldh );
|
} while ( w != oldw || h != oldh );
|
||||||
|
|
||||||
#ifdef __WXMOTIF__
|
#ifdef __WXMOTIF__
|
||||||
// Sorry, some Motif-specific code to implement a backing pixmap
|
// Sorry, some Motif-specific code to implement a backing pixmap
|
||||||
@@ -734,6 +748,8 @@ void wxScrollHelper::AdjustScrollbars()
|
|||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
m_targetWindow->MacUpdateImmediately();
|
m_targetWindow->MacUpdateImmediately();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
s_isInside = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxScrollHelper::DoPrepareDC(wxDC& dc)
|
void wxScrollHelper::DoPrepareDC(wxDC& dc)
|
||||||
|
Reference in New Issue
Block a user