projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wxGrid focus handling fixes:
[wxWidgets.git]
/
src
/
univ
/
scrthumb.cpp
diff --git
a/src/univ/scrthumb.cpp
b/src/univ/scrthumb.cpp
index 9e8b41106220888b62af64148a3560e787f3050f..a6c0e02284242b2e89e1331428ddcc1a48d91407 100644
(file)
--- 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:
// Purpose: wxScrollThumb and related classes
// Author: Vadim Zeitlin
// Modified by:
@@
-17,10
+17,6
@@
// headers
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "univscrthumb.h"
-#endif
-
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#include "wx/wxprec.h"
#ifdef __BORLANDC__
@@
-29,9
+25,9
@@
#ifndef WX_PRECOMP
#include "wx/window.h"
#ifndef WX_PRECOMP
#include "wx/window.h"
- #include "wx/renderer.h"
#endif // WX_PRECOMP
#endif // WX_PRECOMP
+#include "wx/renderer.h"
#include "wx/univ/scrtimer.h"
#include "wx/univ/scrthumb.h"
#include "wx/univ/scrtimer.h"
#include "wx/univ/scrthumb.h"
@@
-63,7
+59,9
@@
struct WXDLLEXPORT wxScrollThumbCaptureData
m_window->ReleaseMouse();
}
m_window->ReleaseMouse();
}
+#if wxUSE_TIMER
delete m_timerScroll;
delete m_timerScroll;
+#endif // wxUSE_TIMER
}
// the thumb part being held pressed
}
// the thumb part being held pressed
@@
-87,6
+85,8
@@
struct WXDLLEXPORT wxScrollThumbCaptureData
// wxScrollTimer: the timer used when the arrow is kept pressed
// ----------------------------------------------------------------------------
// wxScrollTimer: the timer used when the arrow is kept pressed
// ----------------------------------------------------------------------------
+#if wxUSE_TIMER
+
class wxScrollThumbTimer : public wxScrollTimer
{
public:
class wxScrollThumbTimer : public wxScrollTimer
{
public:
@@
-124,6
+124,8
@@
protected:
int m_inc;
};
int m_inc;
};
+#endif // wxUSE_TIMER
+
// ============================================================================
// implementation
// ============================================================================
// ============================================================================
// implementation
// ============================================================================
@@
-156,7
+158,7
@@
bool wxScrollThumb::HandleMouse(const wxMouseEvent& event) const
if ( btn == -1 )
{
// no...
if ( btn == -1 )
{
// no...
- return
FALSE
;
+ return
false
;
}
// when the mouse is pressed on any scrollbar element, we capture it
}
// when the mouse is pressed on any scrollbar element, we capture it
@@
-166,7
+168,7
@@
bool wxScrollThumb::HandleMouse(const wxMouseEvent& event) const
if ( HasCapture() )
{
// mouse already captured, nothing to do
if ( HasCapture() )
{
// mouse already captured, nothing to do
- return
FALSE
;
+ return
false
;
}
// determine which part of the window the user clicked in
}
// determine which part of the window the user clicked in
@@
-175,7
+177,7
@@
bool wxScrollThumb::HandleMouse(const wxMouseEvent& event) const
if ( shaftPart == Shaft_None )
{
// mouse pressed over something else
if ( shaftPart == Shaft_None )
{
// mouse pressed over something else
- return
FALSE
;
+ return
false
;
}
// capture the mouse
}
// capture the mouse
@@
-196,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));
}
// 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
else // not the thumb
{
// start timer for auto scrolling when the user presses the mouse
@@
-203,6
+206,7
@@
bool wxScrollThumb::HandleMouse(const wxMouseEvent& event) const
m_captureData->m_timerScroll =
new wxScrollThumbTimer(m_control, shaftPart);
}
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) )
}
// release mouse if the *same* button went up
else if ( HasCapture() && (btn == m_captureData->m_btnCapture) )
@@
-219,15
+223,15
@@
bool wxScrollThumb::HandleMouse(const wxMouseEvent& event) const
delete m_captureData;
wxConstCast(this, wxScrollThumb)->m_captureData = NULL;
delete m_captureData;
wxConstCast(this, wxScrollThumb)->m_captureData = NULL;
- m_control->SetShaftPartState(shaftPart, wxCONTROL_PRESSED,
FALSE
);
+ m_control->SetShaftPartState(shaftPart, wxCONTROL_PRESSED,
false
);
}
else // another mouse button released
{
// we don't process this
}
else // another mouse button released
{
// we don't process this
- return
FALSE
;
+ return
false
;
}
}
- return
TRUE
;
+ return
true
;
}
bool wxScrollThumb::HandleMouseMove(const wxMouseEvent& event) const
}
bool wxScrollThumb::HandleMouseMove(const wxMouseEvent& event) const
@@
-242,7
+246,7
@@
bool wxScrollThumb::HandleMouseMove(const wxMouseEvent& event) const
}
// we process all mouse events while the mouse is captured by us
}
// we process all mouse events while the mouse is captured by us
- return
TRUE
;
+ return
true
;
}
else // no capture
{
}
else // no capture
{
@@
-260,9
+264,9
@@
bool wxScrollThumb::HandleMouseMove(const wxMouseEvent& event) const
if ( shaftPart != m_shaftPart )
{
// update the highlighted state
if ( shaftPart != m_shaftPart )
{
// update the highlighted state
- m_control->SetShaftPartState(m_shaftPart, wxCONTROL_CURRENT,
FALSE
);
+ m_control->SetShaftPartState(m_shaftPart, wxCONTROL_CURRENT,
false
);
wxConstCast(this, wxScrollThumb)->m_shaftPart = shaftPart;
wxConstCast(this, wxScrollThumb)->m_shaftPart = shaftPart;
- m_control->SetShaftPartState(m_shaftPart, wxCONTROL_CURRENT,
TRUE
);
+ m_control->SetShaftPartState(m_shaftPart, wxCONTROL_CURRENT,
true
);
}
// if the event happened on the shaft, it was for us and we processed
}
// if the event happened on the shaft, it was for us and we processed