fixed wxScrolledWindow::SetScrollbars() which was broken by the virtual size changes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15789 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-06-07 23:36:36 +00:00
parent d42e3d592b
commit dc429f89a6
2 changed files with 7 additions and 12 deletions

View File

@@ -27,7 +27,7 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
// default scrolled window style // default scrolled window style
#ifndef wxScrolledWindowStyle #ifndef wxScrolledWindowStyle
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL) #define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
#endif #endif
// avoid triggering this stupid VC++ warning // avoid triggering this stupid VC++ warning
@@ -69,8 +69,6 @@ public:
// lay out the window and its children // lay out the window and its children
virtual bool Layout(); virtual bool Layout();
virtual void DoSetVirtualSize( int x, int y );
protected: protected:
// this is needed for wxEVT_PAINT processing hack described in // this is needed for wxEVT_PAINT processing hack described in
// wxScrollHelperEvtHandler::ProcessEvent() // wxScrollHelperEvtHandler::ProcessEvent()
@@ -94,4 +92,3 @@ private:
#endif #endif
// _WX_GENERIC_SCROLLWIN_H_ // _WX_GENERIC_SCROLLWIN_H_
// vi:sts=4:sw=4:et

View File

@@ -342,6 +342,8 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX,
m_targetWindow->SetVirtualSizeHints( noUnitsX * pixelsPerUnitX, noUnitsY * pixelsPerUnitY ); m_targetWindow->SetVirtualSizeHints( noUnitsX * pixelsPerUnitX, noUnitsY * pixelsPerUnitY );
AdjustScrollbars();
if (do_refresh && !noRefresh) if (do_refresh && !noRefresh)
m_targetWindow->Refresh(TRUE, GetRect()); m_targetWindow->Refresh(TRUE, GetRect());
@@ -865,11 +867,13 @@ void wxScrollHelper::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) co
// Default OnSize resets scrollbars, if any // Default OnSize resets scrollbars, if any
void wxScrollHelper::HandleOnSize(wxSizeEvent& WXUNUSED(event)) void wxScrollHelper::HandleOnSize(wxSizeEvent& WXUNUSED(event))
{ {
if( m_targetWindow != m_win ) if ( m_targetWindow != m_win )
m_targetWindow->SetVirtualSize( m_targetWindow->GetClientSize() ); m_targetWindow->SetVirtualSize( m_targetWindow->GetClientSize() );
m_win->SetVirtualSize( m_win->GetClientSize() ); m_win->SetVirtualSize( m_win->GetClientSize() );
AdjustScrollbars();
#if wxUSE_CONSTRAINTS #if wxUSE_CONSTRAINTS
if (m_win->GetAutoLayout()) if (m_win->GetAutoLayout())
m_win->Layout(); m_win->Layout();
@@ -1159,12 +1163,6 @@ bool wxGenericScrolledWindow::Layout()
return wxPanel::Layout(); return wxPanel::Layout();
} }
void wxGenericScrolledWindow::DoSetVirtualSize( int x, int y )
{
wxPanel::DoSetVirtualSize( x, y );
AdjustScrollbars();
}
void wxGenericScrolledWindow::OnPaint(wxPaintEvent& event) void wxGenericScrolledWindow::OnPaint(wxPaintEvent& event)
{ {
// the user code didn't really draw the window if we got here, so set this // the user code didn't really draw the window if we got here, so set this