X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/029a401d74c00ce86f485fafeda73520d315fb0f..refs/heads/master:/src/generic/scrlwing.cpp diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index ee49a9c6a1..6291815209 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -186,6 +186,9 @@ void wxAutoScrollTimer::Notify() // wxScrollHelperEvtHandler // ---------------------------------------------------------------------------- +// Notice that this method is currently duplicated in the method with the same +// name in wxVarScrollHelperEvtHandler class, until this is fixed, the other +// copy of the method needs to be modified every time this version is. bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event) { wxEventType evType = event.GetEventType(); @@ -310,17 +313,30 @@ bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event) } // ============================================================================ -// wxScrollHelperBase implementation +// wxAnyScrollHelperBase and wxScrollHelperBase implementation // ============================================================================ // ---------------------------------------------------------------------------- -// wxScrollHelperBase construction +// wxAnyScrollHelperBase // ---------------------------------------------------------------------------- -wxScrollHelperBase::wxScrollHelperBase(wxWindow *win) +wxAnyScrollHelperBase::wxAnyScrollHelperBase(wxWindow* win) { wxASSERT_MSG( win, wxT("associated window can't be NULL in wxScrollHelper") ); + m_win = win; + m_targetWindow = NULL; + + m_kbdScrollingEnabled = true; +} + +// ---------------------------------------------------------------------------- +// wxScrollHelperBase construction +// ---------------------------------------------------------------------------- + +wxScrollHelperBase::wxScrollHelperBase(wxWindow *win) + : wxAnyScrollHelperBase(win) +{ m_xScrollPixelsPerLine = m_yScrollPixelsPerLine = m_xScrollPosition = @@ -333,23 +349,16 @@ wxScrollHelperBase::wxScrollHelperBase(wxWindow *win) m_xScrollingEnabled = m_yScrollingEnabled = true; - m_kbdScrollingEnabled = true; - m_scaleX = m_scaleY = 1.0; #if wxUSE_MOUSEWHEEL m_wheelRotation = 0; #endif - m_win = - m_targetWindow = NULL; - m_timerAutoScroll = NULL; m_handler = NULL; - m_win = win; - m_win->SetScrollHelper(static_cast(this)); // by default, the associated window is also the target window @@ -481,11 +490,6 @@ void wxScrollHelperBase::SetTargetWindow(wxWindow *target) DoSetTargetWindow(target); } -wxWindow *wxScrollHelperBase::GetTargetWindow() const -{ - return m_targetWindow; -} - // ---------------------------------------------------------------------------- // scrolling implementation itself // ---------------------------------------------------------------------------- @@ -816,7 +820,7 @@ void wxScrollHelperBase::HandleOnSize(wxSizeEvent& WXUNUSED(event)) // This calls OnDraw, having adjusted the origin according to the current // scroll position -void wxScrollHelperBase::HandleOnPaint(wxPaintEvent& WXUNUSED(event)) +void wxAnyScrollHelperBase::HandleOnPaint(wxPaintEvent& WXUNUSED(event)) { // don't use m_targetWindow here, this is always called for ourselves wxPaintDC dc(m_win); @@ -829,7 +833,7 @@ void wxScrollHelperBase::HandleOnPaint(wxPaintEvent& WXUNUSED(event)) // compatibility here - if we used OnKeyDown(), the programs which process // arrows themselves in their OnChar() would never get the message and like // this they always have the priority -void wxScrollHelperBase::HandleOnChar(wxKeyEvent& event) +void wxAnyScrollHelperBase::HandleOnChar(wxKeyEvent& event) { if ( !m_kbdScrollingEnabled ) {