X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..a1900c9e1d07ac71f373f94656bf26a45f032c39:/src/generic/scrlwing.cpp diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index f868dd053b..bf9a58d3fa 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -40,7 +40,9 @@ #include "wx/scrolwin.h" #include "wx/panel.h" +#if wxUSE_TIMER #include "wx/timer.h" +#endif #include "wx/sizer.h" #ifdef __WXMSW__ @@ -91,6 +93,7 @@ private: DECLARE_NO_COPY_CLASS(wxScrollHelperEvtHandler) }; +#if wxUSE_TIMER // ---------------------------------------------------------------------------- // wxAutoScrollTimer: the timer used to generate a stream of scroll events when // a captured mouse is held outside the window @@ -175,6 +178,7 @@ void wxAutoScrollTimer::Notify() } } } +#endif // ---------------------------------------------------------------------------- // wxScrollHelperEvtHandler @@ -718,7 +722,7 @@ void wxScrollHelper::AdjustScrollbars() oldh = h; GetTargetSize( &w, &h ); - } while ( w != oldw && h != oldh ); + } while ( w != oldw || h != oldh ); #ifdef __WXMOTIF__ // Sorry, some Motif-specific code to implement a backing pixmap @@ -1072,11 +1076,13 @@ bool wxScrollHelper::SendAutoScrollEvents(wxScrollWinEvent& event) const void wxScrollHelper::StopAutoScrolling() { +#if wxUSE_TIMER if ( m_timerAutoScroll ) { delete m_timerAutoScroll; m_timerAutoScroll = (wxTimer *)NULL; } +#endif } void wxScrollHelper::HandleOnMouseEnter(wxMouseEvent& event) @@ -1138,6 +1144,7 @@ void wxScrollHelper::HandleOnMouseLeave(wxMouseEvent& event) if ( !m_targetWindow->HasScrollbar(orient) ) return; +#if wxUSE_TIMER delete m_timerAutoScroll; m_timerAutoScroll = new wxAutoScrollTimer ( @@ -1148,6 +1155,7 @@ void wxScrollHelper::HandleOnMouseLeave(wxMouseEvent& event) orient ); m_timerAutoScroll->Start(50); // FIXME: make configurable +#endif } }