X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/47366662dedbeeedc92e165075b638e810b608f5..11a2ce5ad289cb21b35cc21131b46f75dd4af060:/src/gtk/scrolwin.cpp diff --git a/src/gtk/scrolwin.cpp b/src/gtk/scrolwin.cpp index 257c6f9f22..a072691442 100644 --- a/src/gtk/scrolwin.cpp +++ b/src/gtk/scrolwin.cpp @@ -325,6 +325,11 @@ void wxScrolledWindow::DoSetVirtualSize( int x, int y ) { wxPanel::DoSetVirtualSize( x, y ); AdjustScrollbars(); + +#if wxUSE_CONSTRAINTS + if (GetAutoLayout()) + Layout(); +#endif } /* @@ -378,9 +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_targetWindow->ScrollWindow( (int) (m_xScrollPosition - m_hAdjust->value) * m_xScrollPixelsPerLine, 0 ); - 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; + } } } @@ -396,9 +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_targetWindow->ScrollWindow( 0, (int) (m_yScrollPosition - m_vAdjust->value) * m_yScrollPixelsPerLine ); - 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; + } } } @@ -818,11 +827,6 @@ void wxScrolledWindow::OnSize(wxSizeEvent& WXUNUSED(event)) m_targetWindow->SetVirtualSize( m_targetWindow->GetClientSize() ); SetVirtualSize( GetClientSize() ); - -#if wxUSE_CONSTRAINTS - if (GetAutoLayout()) - Layout(); -#endif } // This calls OnDraw, having adjusted the origin according to the current