// ----------------------------------------------------------------------------
#ifdef __GNUG__
- #pragma implementation "slider.h"
+ #pragma implementation "univslider.h"
#endif
#include "wx/wxprec.h"
wxScrollThumb::Shaft wxSlider::HitTest(const wxPoint& pt) const
{
wxRect rectShaft = GetShaftRect();
- if ( !rectShaft.Inside(pt) )
+ wxRect rectThumb;
+ CalcThumbRect(&rectShaft, &rectThumb, NULL);
+
+ // check for possible shaft or thumb hit
+ if (!rectShaft.Inside(pt) && !rectThumb.Inside(pt))
{
return wxScrollThumb::Shaft_None;
}
- // inside the shaft, where is it relatively to the thumb?
- wxRect rectThumb;
- CalcThumbRect(&rectShaft, &rectThumb, NULL);
// the position to test and the start and end of the thumb
wxCoord x, x1, x2;
// wxStdSliderButtonInputHandler
// ----------------------------------------------------------------------------
-bool wxStdSliderButtonInputHandler::HandleKey(wxControl *control,
+bool wxStdSliderButtonInputHandler::HandleKey(wxInputConsumer *consumer,
const wxKeyEvent& event,
bool pressed)
{
break;
case WXK_PRIOR:
+ case WXK_PAGEUP:
action = wxACTION_SLIDER_PAGE_UP;
break;
case WXK_NEXT:
+ case WXK_PAGEDOWN:
action = wxACTION_SLIDER_PAGE_DOWN;
break;
}
if ( !!action )
{
- control->PerformAction(action);
+ consumer->PerformAction(action);
return TRUE;
}
}
- return wxStdInputHandler::HandleKey(control, event, pressed);
+ return wxStdInputHandler::HandleKey(consumer, event, pressed);
}
-bool wxStdSliderButtonInputHandler::HandleMouse(wxControl *control,
+bool wxStdSliderButtonInputHandler::HandleMouse(wxInputConsumer *consumer,
const wxMouseEvent& event)
{
- wxSlider *slider = wxStaticCast(control, wxSlider);
+ wxSlider *slider = wxStaticCast(consumer->GetInputWindow(), wxSlider);
if ( slider->GetThumb().HandleMouse(event) )
{
return FALSE;
}
- return wxStdInputHandler::HandleMouse(control, event);
+ return wxStdInputHandler::HandleMouse(consumer, event);
}
-bool wxStdSliderButtonInputHandler::HandleMouseMove(wxControl *control,
+bool wxStdSliderButtonInputHandler::HandleMouseMove(wxInputConsumer *consumer,
const wxMouseEvent& event)
{
- wxSlider *slider = wxStaticCast(control, wxSlider);
+ wxSlider *slider = wxStaticCast(consumer->GetInputWindow(), wxSlider);
if ( slider->GetThumb().HandleMouseMove(event) )
{
return FALSE;
}
- return wxStdInputHandler::HandleMouseMove(control, event);
+ return wxStdInputHandler::HandleMouseMove(consumer, event);
}
-bool wxStdSliderButtonInputHandler::HandleFocus(wxControl *control,
+bool wxStdSliderButtonInputHandler::HandleFocus(wxInputConsumer *consumer,
const wxFocusEvent& event)
{
// slider's appearance changes when it gets/loses focus