m_arrowPressed = wxScrollArrows::Arrow_None;
m_window = NULL;
m_btnCapture = -1;
+#if wxUSE_TIMER
m_timerScroll = NULL;
+#endif // wxUSE_TIMER
}
~wxScrollArrowCaptureData()
if ( m_window )
m_window->ReleaseMouse();
+#if wxUSE_TIMER
delete m_timerScroll;
+#endif // wxUSE_TIMER
}
// the arrow being held pressed (may be Arrow_None)
// the window which has captured the mouse
wxWindow *m_window;
+#if wxUSE_TIMER
// the timer for generating the scroll events
wxScrollTimer *m_timerScroll;
+#endif
};
// ----------------------------------------------------------------------------
// wxScrollArrowTimer: a wxScrollTimer which calls OnArrow()
// ----------------------------------------------------------------------------
+#if wxUSE_TIMER
+
class wxScrollArrowTimer : public wxScrollTimer
{
public:
wxScrollArrows::Arrow m_arrow;
};
+#endif // wxUSE_TIMER
+
// ============================================================================
// implementation of wxScrollArrows
// ============================================================================
arrow = m_control->HitTest(event.GetPosition());
}
+#if wxUSE_TIMER
if ( m_captureData && m_captureData->m_timerScroll)
{
// the mouse is captured, we may want to pause scrolling if it goes
return false;
}
+#endif // wxUSE_TIMER
// reset the wxCONTROL_CURRENT flag for the arrows which don't have the
// mouse and set it for the one which has
m_captureData->m_window = m_control->GetWindow();
m_captureData->m_window->CaptureMouse();
- // start scrolling
+#if wxUSE_TIMER
+ // start scrolling
wxScrollArrowTimer *tmpTimerScroll =
new wxScrollArrowTimer(m_control, arrow);
+#endif // wxUSE_TIMER
- // Because in some cases wxScrollArrowTimer can cause
- // m_captureData to be destructed we need to test if it
+ // Because in some cases wxScrollArrowTimer can cause
+ // m_captureData to be destructed we need to test if it
// is still valid before using.
if (m_captureData)
{
+#if wxUSE_TIMER
m_captureData->m_timerScroll = tmpTimerScroll;
+#endif // wxUSE_TIMER
m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, true);
}
else
{
+#if wxUSE_TIMER
delete tmpTimerScroll;
+#endif // wxUSE_TIMER
}
}
//else: mouse already captured, nothing to do