merged 2.4 branch into the trunk
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -340,9 +340,15 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX,
|
||||
m_xScrollPosition = xPos;
|
||||
m_yScrollPosition = yPos;
|
||||
|
||||
// For better backward compatibility we set persisting limits
|
||||
// here not just the size. It makes SetScrollbars 'sticky'
|
||||
// emulating the old non-autoscroll behaviour.
|
||||
|
||||
m_targetWindow->SetVirtualSizeHints( noUnitsX * pixelsPerUnitX, noUnitsY * pixelsPerUnitY );
|
||||
|
||||
AdjustScrollbars();
|
||||
// The above should arguably be deprecated, this however we still need.
|
||||
|
||||
m_targetWindow->SetVirtualSize( noUnitsX * pixelsPerUnitX, noUnitsY * pixelsPerUnitY );
|
||||
|
||||
if (do_refresh && !noRefresh)
|
||||
m_targetWindow->Refresh(TRUE, GetRect());
|
||||
@@ -867,17 +873,19 @@ 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 )
|
||||
m_targetWindow->SetVirtualSize( m_targetWindow->GetClientSize() );
|
||||
if( m_win->GetAutoLayout() )
|
||||
{
|
||||
if ( m_targetWindow != m_win )
|
||||
m_targetWindow->FitInside();
|
||||
|
||||
m_win->SetVirtualSize( m_win->GetClientSize() );
|
||||
|
||||
AdjustScrollbars();
|
||||
m_win->FitInside();
|
||||
|
||||
#if wxUSE_CONSTRAINTS
|
||||
if (m_win->GetAutoLayout())
|
||||
m_win->Layout();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
AdjustScrollbars();
|
||||
}
|
||||
|
||||
// This calls OnDraw, having adjusted the origin according to the current
|
||||
@@ -1171,6 +1179,17 @@ bool wxGenericScrolledWindow::Layout()
|
||||
return wxPanel::Layout();
|
||||
}
|
||||
|
||||
void wxGenericScrolledWindow::DoSetVirtualSize(int x, int y)
|
||||
{
|
||||
wxPanel::DoSetVirtualSize( x, y );
|
||||
AdjustScrollbars();
|
||||
|
||||
#if wxUSE_CONSTRAINTS
|
||||
if (GetAutoLayout())
|
||||
Layout();
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxGenericScrolledWindow::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
// the user code didn't really draw the window if we got here, so set this
|
||||
|
Reference in New Issue
Block a user