diff --git a/include/wx/window.h b/include/wx/window.h index c7183ecabb..82b313d4b8 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -65,6 +65,7 @@ class WXDLLEXPORT wxSizer; class WXDLLEXPORT wxToolTip; class WXDLLEXPORT wxWindowBase; class WXDLLEXPORT wxWindow; +class WXDLLEXPORT wxScrollHelper; #if wxUSE_ACCESSIBILITY class WXDLLEXPORT wxAccessible; @@ -343,6 +344,9 @@ public: *h = s.y; } + void SetScrollHelper( wxScrollHelper *sh ) { m_scrollHelper = sh; } + wxScrollHelper *GetScrollHelper() { return m_scrollHelper; } + // reset the cached best size value so it will be recalculated the // next time it is needed. void InvalidateBestSize(); @@ -1242,6 +1246,8 @@ protected: // Virtual size (scrolling) wxSize m_virtualSize; + wxScrollHelper *m_scrollHelper; + int m_minVirtualWidth; // VirtualSizeHints int m_minVirtualHeight; int m_maxVirtualWidth; diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 9d0b6f4582..47983f7274 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -200,6 +200,8 @@ wxWindowBase::wxWindowBase() m_virtualSize = wxDefaultSize; + m_scrollHelper = (wxScrollHelper *) NULL; + m_minVirtualWidth = m_maxVirtualWidth = wxDefaultCoord; m_minVirtualHeight = diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index e05ecbda17..b6646136f1 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -311,6 +311,8 @@ wxScrollHelper::wxScrollHelper(wxWindow *win) m_handler = NULL; m_win = win; + + m_win->SetScrollHelper( this ); // by default, the associated window is also the target window DoSetTargetWindow(win);