X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8e40d27b8d762c63e0fbb112540f601c44349eb3..c266945cab18b6f34286235f2950970575259339:/src/gtk1/scrolwin.cpp diff --git a/src/gtk1/scrolwin.cpp b/src/gtk1/scrolwin.cpp index 4e89b7d390..a072691442 100644 --- a/src/gtk1/scrolwin.cpp +++ b/src/gtk1/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,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; + } } } @@ -395,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; + } } } @@ -816,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