// Created: 22.01.01
// RCS-ID: $Id$
// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
-// Licence: wxWidgets licence
+// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "univscrarrow.h"
-#endif
-
#include "wx/wxprec.h"
#ifdef __BORLANDC__
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
if ( arrow == m_captureData->m_arrowPressed )
{
// resume now
- m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, TRUE);
+ m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, true);
timer->Start();
- return TRUE;
+ return true;
}
}
else // if ( 1 ) FIXME: m_control->ShouldPauseScrolling() )
{
// stop as the mouse left the arrow
m_control->SetArrowFlag(m_captureData->m_arrowPressed,
- wxCONTROL_PRESSED, FALSE);
+ wxCONTROL_PRESSED, false);
timer->Stop();
- return TRUE;
+ return true;
}
}
- return FALSE;
+ 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
UpdateCurrentFlag(Arrow_First, arrow);
UpdateCurrentFlag(Arrow_Second, arrow);
- // return TRUE if it was really an event for an arrow
+ // return true if it was really an event for an arrow
return !event.Leaving() && arrow != Arrow_None;
}
if ( btn == -1 )
{
// we only care about button press/release events
- return FALSE;
+ return false;
}
if ( event.ButtonDown() || event.ButtonDClick() )
if ( arrow == Arrow_None )
{
// mouse pressed over something else
- return FALSE;
+ return false;
}
if ( m_control->GetArrowState(arrow) & wxCONTROL_DISABLED )
{
// don't allow to press disabled arrows
- return TRUE;
+ return true;
}
wxConstCast(this, wxScrollArrows)->m_captureData =
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);
+ m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, true);
}
else
{
+#if wxUSE_TIMER
delete tmpTimerScroll;
+#endif // wxUSE_TIMER
}
}
//else: mouse already captured, nothing to do
delete m_captureData;
wxConstCast(this, wxScrollArrows)->m_captureData = NULL;
- m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, FALSE);
+ m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, false);
}
else
{
// we don't process this
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}