X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..23d2edff3505385801313910ece449bdb959f0f1:/src/generic/scrlwing.cpp diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index f65fb4b487..f516a8552d 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -82,6 +82,8 @@ private: wxScrollHelper *m_scrollHelper; bool m_hasDrawnWindow; + + DECLARE_NO_COPY_CLASS(wxScrollHelperEvtHandler) }; // ---------------------------------------------------------------------------- @@ -104,6 +106,8 @@ private: wxEventType m_eventType; int m_pos, m_orient; + + DECLARE_NO_COPY_CLASS(wxAutoScrollTimer) }; // ============================================================================ @@ -344,18 +348,32 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX, // here not just the size. It makes SetScrollbars 'sticky' // emulating the old non-autoscroll behaviour. - m_targetWindow->SetVirtualSizeHints( noUnitsX * pixelsPerUnitX, noUnitsY * pixelsPerUnitY ); + wxSize sz = m_targetWindow->GetClientSize(); +#if 1 + int x = wxMax(noUnitsX * pixelsPerUnitX, sz.x); + int y = wxMax(noUnitsY * pixelsPerUnitY, sz.y); +#else + int x = noUnitsX * pixelsPerUnitX; + int y = noUnitsY * pixelsPerUnitY; +#endif + m_targetWindow->SetVirtualSizeHints( x, y ); // The above should arguably be deprecated, this however we still need. - m_targetWindow->SetVirtualSize( noUnitsX * pixelsPerUnitX, noUnitsY * pixelsPerUnitY ); + m_targetWindow->SetVirtualSize( x, y ); if (do_refresh && !noRefresh) m_targetWindow->Refresh(TRUE, GetRect()); + // TODO: check if we can use AdjustScrollbars always. +#ifdef __WXUNIVERSAL__ + AdjustScrollbars(); +#else + // This is also done by AdjustScrollbars, above #ifdef __WXMAC__ m_targetWindow->MacUpdateImmediately() ; #endif +#endif } // ---------------------------------------------------------------------------- @@ -938,7 +956,7 @@ void wxScrollHelper::HandleOnChar(wxKeyEvent& event) yScrollOld = m_yScrollPosition; int dsty; - switch ( event.KeyCode() ) + switch ( event.GetKeyCode() ) { case WXK_PAGEUP: case WXK_PRIOR: