X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/566d84a7c3c06956562b9f8ac364aa3bad760c10..0c32c93044babd3315029af529ab4348b103b036:/src/generic/scrlwing.cpp diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index e05628749d..b36eace80e 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -342,6 +342,8 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX, m_targetWindow->SetVirtualSizeHints( noUnitsX * pixelsPerUnitX, noUnitsY * pixelsPerUnitY ); + AdjustScrollbars(); + if (do_refresh && !noRefresh) m_targetWindow->Refresh(TRUE, GetRect()); @@ -675,7 +677,7 @@ void wxScrollHelper::AdjustScrollbars() } if (!m_targetWindow->GetBackingPixmap() && - (noUnitsX != 0) && (noUnitsY != 0)) + (m_xScrollLines != 0) && (m_yScrollLines != 0)) { int depth = wxDisplayDepth(); m_targetWindow->SetPixmapWidth(totalPixelWidth); @@ -865,11 +867,13 @@ void wxScrollHelper::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) co // Default OnSize resets scrollbars, if any void wxScrollHelper::HandleOnSize(wxSizeEvent& WXUNUSED(event)) { - if( m_targetWindow != m_win ) + if ( m_targetWindow != m_win ) m_targetWindow->SetVirtualSize( m_targetWindow->GetClientSize() ); m_win->SetVirtualSize( m_win->GetClientSize() ); + AdjustScrollbars(); + #if wxUSE_CONSTRAINTS if (m_win->GetAutoLayout()) m_win->Layout(); @@ -1159,12 +1163,6 @@ bool wxGenericScrolledWindow::Layout() return wxPanel::Layout(); } -void wxGenericScrolledWindow::DoSetVirtualSize( int x, int y ) -{ - wxPanel::DoSetVirtualSize( x, y ); - AdjustScrollbars(); -} - void wxGenericScrolledWindow::OnPaint(wxPaintEvent& event) { // the user code didn't really draw the window if we got here, so set this