X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..00b89a1d1da61a1f842db63b244ad08c0554121c:/src/univ/scrthumb.cpp?ds=sidebyside diff --git a/src/univ/scrthumb.cpp b/src/univ/scrthumb.cpp index 2852a6f280..b5c49719aa 100644 --- a/src/univ/scrthumb.cpp +++ b/src/univ/scrthumb.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: univ/scrthumb.cpp +// Name: src/univ/scrthumb.cpp // Purpose: wxScrollThumb and related classes // Author: Vadim Zeitlin // Modified by: @@ -25,9 +25,9 @@ #ifndef WX_PRECOMP #include "wx/window.h" - #include "wx/renderer.h" #endif // WX_PRECOMP +#include "wx/renderer.h" #include "wx/univ/scrtimer.h" #include "wx/univ/scrthumb.h" @@ -59,7 +59,9 @@ struct WXDLLEXPORT wxScrollThumbCaptureData m_window->ReleaseMouse(); } +#if wxUSE_TIMER delete m_timerScroll; +#endif // wxUSE_TIMER } // the thumb part being held pressed @@ -83,6 +85,8 @@ struct WXDLLEXPORT wxScrollThumbCaptureData // wxScrollTimer: the timer used when the arrow is kept pressed // ---------------------------------------------------------------------------- +#if wxUSE_TIMER + class wxScrollThumbTimer : public wxScrollTimer { public: @@ -97,7 +101,7 @@ public: break; default: - wxFAIL_MSG(_T("unexpected shaft part in wxScrollThumbTimer")); + wxFAIL_MSG(wxT("unexpected shaft part in wxScrollThumbTimer")); // fall through case wxScrollThumb::Shaft_Below: @@ -120,6 +124,8 @@ protected: int m_inc; }; +#endif // wxUSE_TIMER + // ============================================================================ // implementation // ============================================================================ @@ -138,7 +144,7 @@ wxScrollThumb::wxScrollThumb(wxControlWithThumb *control) wxScrollThumb::~wxScrollThumb() { // it should have been destroyed - wxASSERT_MSG( !m_captureData, _T("memory leak in wxScrollThumb") ); + wxASSERT_MSG( !m_captureData, wxT("memory leak in wxScrollThumb") ); } // ---------------------------------------------------------------------------- @@ -192,6 +198,7 @@ bool wxScrollThumb::HandleMouse(const wxMouseEvent& event) const // generate an additional event if we start dragging the thumb m_control->OnThumbDragStart(GetThumbPos(event)); } +#if wxUSE_TIMER else // not the thumb { // start timer for auto scrolling when the user presses the mouse @@ -199,6 +206,7 @@ bool wxScrollThumb::HandleMouse(const wxMouseEvent& event) const m_captureData->m_timerScroll = new wxScrollThumbTimer(m_control, shaftPart); } +#endif // wxUSE_TIMER } // release mouse if the *same* button went up else if ( HasCapture() && (btn == m_captureData->m_btnCapture) ) @@ -276,7 +284,7 @@ wxCoord wxScrollThumb::GetMouseCoord(const wxMouseEvent& event) const int wxScrollThumb::GetThumbPos(const wxMouseEvent& event) const { wxCHECK_MSG( m_captureData && m_captureData->m_shaftPart == Shaft_Thumb, 0, - _T("can't be called when thumb is not dragged") ); + wxT("can't be called when thumb is not dragged") ); int x = GetMouseCoord(event) - m_captureData->m_ofsMouse; return m_control->PixelToThumbPos(x);