1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/univ/slider.cpp
3 // Purpose: implementation of the universal version of wxSlider
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
13 There is some discrepancy in wxSL_LABELS style handling between wxMSW and
14 wxGTK: the latter handles it natively and shows only the current value of
15 the slider on the side corresponding to wxSL_TOP/BOTTOM/LEFT/RIGHT style
16 given (which can be combined with wxSL_HORIZONTAL/VERTICAL) while wxMSW
17 emulates this somehow and shows the min and max values near the ends of the
18 slider and the current value in a separate static box nearby.
20 We currently follow wxGTK except that wxSL_HORIZONTAL slider can only have
21 the label displayed on top or bottom of it and wxSL_VERTICAL - to the left
24 What we really need is probably a more fine grain control on labels, i.e. we
25 should be able to select if we show nothing at all, the current value only
26 or the value and the limits - the current approach is just that of the
27 lowest common denominator.
32 1. support for all orientations
33 2. draw the slider thumb highlighted when it is dragged
34 ?3. manual ticks support?
37 // ============================================================================
39 // ============================================================================
41 // ----------------------------------------------------------------------------
43 // ----------------------------------------------------------------------------
45 #include "wx/wxprec.h"
53 #include "wx/slider.h"
59 #include "wx/univ/renderer.h"
60 #include "wx/univ/inphand.h"
61 #include "wx/univ/theme.h"
63 // ----------------------------------------------------------------------------
65 // ----------------------------------------------------------------------------
67 // the margin between the slider and the label (FIXME: hardcoded)
68 static const wxCoord SLIDER_LABEL_MARGIN
= 2;
70 // ============================================================================
71 // implementation of wxSlider
72 // ============================================================================
74 IMPLEMENT_DYNAMIC_CLASS(wxSlider
, wxControl
)
76 BEGIN_EVENT_TABLE(wxSlider
, wxControl
)
77 EVT_SIZE(wxSlider::OnSize
)
80 // ----------------------------------------------------------------------------
82 // ----------------------------------------------------------------------------
85 // warning C4355: 'this' : used in base member initializer list
86 #pragma warning(disable:4355)
95 wxSlider::wxSlider(wxWindow
*parent
,
97 int value
, int minValue
, int maxValue
,
101 const wxValidator
& validator
,
102 const wxString
& name
)
107 (void)Create(parent
, id
, value
, minValue
, maxValue
,
108 pos
, size
, style
, validator
, name
);
112 // warning C4355: 'this' : used in base member initializer list
113 #pragma warning(default:4355)
116 void wxSlider::Init()
131 bool wxSlider::Create(wxWindow
*parent
,
133 int value
, int minValue
, int maxValue
,
137 const wxValidator
& validator
,
138 const wxString
& name
)
140 if ( !wxSliderBase::Create(parent
, id
, pos
, size
, style
,
144 SetRange(minValue
, maxValue
);
147 // call this after setting the range as the best size depends (at least if
148 // we have wxSL_LABELS style) on the range
151 CreateInputHandler(wxINP_HANDLER_SLIDER
);
156 // ----------------------------------------------------------------------------
157 // wxSlider range and value
158 // ----------------------------------------------------------------------------
160 int wxSlider::GetValue() const
165 int wxSlider::NormalizeValue(int value
) const
169 else if ( value
> m_max
)
175 bool wxSlider::ChangeValueBy(int inc
)
177 return ChangeValueTo(NormalizeValue(m_value
+ inc
));
180 bool wxSlider::ChangeValueTo(int value
)
182 // check if the value is going to change at all
183 if (value
== m_value
)
186 // this method is protected and we should only call it with normalized
188 wxCHECK_MSG( IsInRange(value
), false, _T("invalid slider value") );
194 // generate the events: both a specific scroll event and a command event
195 wxScrollEvent
eventScroll(wxEVT_SCROLL_CHANGED
, GetId());
196 eventScroll
.SetPosition(m_value
);
197 eventScroll
.SetEventObject( this );
198 (void)GetEventHandler()->ProcessEvent(eventScroll
);
200 wxCommandEvent
event(wxEVT_COMMAND_SLIDER_UPDATED
, GetId());
201 event
.SetInt(m_value
);
202 event
.SetEventObject(this);
203 (void)GetEventHandler()->ProcessEvent(event
);
208 void wxSlider::SetValue(int value
)
210 value
= NormalizeValue(value
);
212 if ( m_value
!= value
)
220 void wxSlider::SetRange(int minValue
, int maxValue
)
222 if ( minValue
> maxValue
)
224 // swap them, we always want min to be less than max
230 if ( m_min
!= minValue
|| m_max
!= maxValue
)
235 // reset the value to make sure it is in the new range
238 // the size of the label rect might have changed
246 //else: nothing changed
249 int wxSlider::GetMin() const
254 int wxSlider::GetMax() const
259 // ----------------------------------------------------------------------------
260 // wxSlider line/page/thumb size
261 // ----------------------------------------------------------------------------
263 void wxSlider::SetLineSize(int lineSize
)
265 wxCHECK_RET( lineSize
>= 0, _T("invalid slider line size") );
267 m_lineSize
= lineSize
;
270 void wxSlider::SetPageSize(int pageSize
)
272 wxCHECK_RET( pageSize
>= 0, _T("invalid slider page size") );
274 m_pageSize
= pageSize
;
277 int wxSlider::GetLineSize() const
281 // the default line increment is 1
282 wxConstCast(this, wxSlider
)->m_lineSize
= 1;
288 int wxSlider::GetPageSize() const
292 // the default page increment is m_tickFreq
293 wxConstCast(this, wxSlider
)->m_pageSize
= m_tickFreq
;
299 void wxSlider::SetThumbLength(int lenPixels
)
301 wxCHECK_RET( lenPixels
>= 0, _T("invalid slider thumb size") );
303 // use m_thumbSize here directly and not GetThumbLength() to avoid setting
304 // it to the default value as we don't need it
305 if ( lenPixels
!= m_thumbSize
)
307 m_thumbSize
= lenPixels
;
313 int wxSlider::GetThumbLength() const
315 wxSize sz
= GetDefaultThumbSize();
316 int len
= (IsVert() ? sz
.x
: sz
.y
);
317 if (m_thumbSize
> len
)
328 // ----------------------------------------------------------------------------
330 // ----------------------------------------------------------------------------
332 void wxSlider::SetTickFreq(int n
, int WXUNUSED(dummy
))
334 wxCHECK_RET (n
> 0, _T("invalid slider tick frequency"));
336 if ( n
!= m_tickFreq
)
344 // ----------------------------------------------------------------------------
346 // ----------------------------------------------------------------------------
348 wxSize
wxSlider::CalcLabelSize() const
352 // there is no sense in trying to calc the labels size if we haven't got
353 // any, the caller must check for it
354 wxCHECK_MSG( HasLabels(), size
, _T("shouldn't be called") );
356 wxCoord w1
, h1
, w2
, h2
;
357 GetTextExtent(FormatValue(m_min
), &w1
, &h1
);
358 GetTextExtent(FormatValue(m_max
), &w2
, &h2
);
360 size
.x
= wxMax(w1
, w2
);
361 size
.y
= wxMax(h1
, h2
);
366 wxSize
wxSlider::DoGetBestClientSize() const
368 // this dimension is completely arbitrary
369 static const wxCoord SLIDER_WIDTH
= 40;
371 long style
= GetWindowStyle();
373 // first calculate the size of the slider itself: i.e. the shaft and the
375 wxCoord height
= GetRenderer()->GetSliderDim();
381 size
.y
= SLIDER_WIDTH
;
385 size
.x
= SLIDER_WIDTH
;
389 // add space for ticks
392 wxCoord lenTick
= GetRenderer()->GetSliderTickLen();
393 if (style
& wxSL_BOTH
)
395 lenTick
= 2 * lenTick
;
404 // if we have the label, reserve enough space for it
407 wxSize sizeLabels
= CalcLabelSize();
409 if (style
& (wxSL_LEFT
|wxSL_RIGHT
))
411 size
.x
+= sizeLabels
.x
+ SLIDER_LABEL_MARGIN
;
413 else if (style
& (wxSL_TOP
|wxSL_BOTTOM
))
415 size
.y
+= sizeLabels
.y
+ SLIDER_LABEL_MARGIN
;
422 void wxSlider::OnSize(wxSizeEvent
& event
)
429 const wxRect
& wxSlider::GetSliderRect() const
431 if ( m_rectSlider
.width
< 0 )
433 wxConstCast(this, wxSlider
)->CalcGeometry();
439 void wxSlider::CalcGeometry()
442 recalc the label and slider positions, this looks like this for
443 wxSL_HORIZONTAL | wxSL_TOP slider:
446 -------------------------
447 | T | <-- this is the slider rect
448 | HHHHHHHHHHHHHHHTHHHHH |
451 -------------------------
453 LLL is m_rectLabel as calculated here and lll is the real rect used for
454 label drawing in OnDraw() (TTT indicated the thumb position and *s are
457 in the wxSL_VERTICAL | wxSL_RIGHT case the picture is like this:
472 long style
= GetWindowStyle();
474 // initialize to the full client rect
475 wxRect rectTotal
= GetClientRect();
476 m_rectSlider
= rectTotal
;
477 wxSize sizeThumb
= GetThumbSize();
479 // Labels reduce the size of the slider rect
482 wxSize sizeLabels
= CalcLabelSize();
484 m_rectLabel
= wxRect(rectTotal
.GetPosition(), sizeLabels
);
486 if (style
& wxSL_TOP
)
488 // shrink and offset the slider to the bottom
489 m_rectSlider
.y
+= sizeLabels
.y
+ SLIDER_LABEL_MARGIN
;
490 m_rectSlider
.height
-= sizeLabels
.y
+ SLIDER_LABEL_MARGIN
;
492 else if (style
& wxSL_BOTTOM
)
494 // shrink the slider and move the label to the bottom
495 m_rectSlider
.height
-= sizeLabels
.y
+ SLIDER_LABEL_MARGIN
;
496 m_rectLabel
.y
+= m_rectSlider
.height
+ SLIDER_LABEL_MARGIN
;
498 else if (style
& wxSL_LEFT
)
500 // shrink and offset the slider to the right
501 m_rectSlider
.x
+= sizeLabels
.x
+ SLIDER_LABEL_MARGIN
;
502 m_rectSlider
.width
-= sizeLabels
.x
+ SLIDER_LABEL_MARGIN
;
504 else if (style
& wxSL_RIGHT
)
506 // shrink the slider and move the label to the right
507 m_rectSlider
.width
-= sizeLabels
.x
+ SLIDER_LABEL_MARGIN
;
508 m_rectLabel
.x
+= m_rectSlider
.width
+ SLIDER_LABEL_MARGIN
;
512 // calculate ticks too
515 wxCoord lenTick
= GetRenderer()->GetSliderTickLen();
518 m_rectTicks
= GetShaftRect();
522 if (style
& (wxSL_LEFT
|wxSL_BOTH
))
524 m_rectTicks
.x
= m_rectSlider
.x
;
528 m_rectTicks
.x
= m_rectSlider
.x
+ m_rectSlider
.width
- lenTick
;
530 m_rectTicks
.width
= lenTick
;
534 if (style
& (wxSL_TOP
|wxSL_BOTH
))
536 m_rectTicks
.y
= m_rectSlider
.y
;
540 m_rectTicks
.y
= m_rectSlider
.y
+ m_rectSlider
.height
- lenTick
;
542 m_rectTicks
.height
= lenTick
;
546 // slider is never smaller than thumb size unless rectTotal
549 wxCoord width
= wxMin ( rectTotal
.width
, sizeThumb
.x
);
550 m_rectSlider
.width
= wxMax ( m_rectSlider
.width
, width
);
554 wxCoord height
= wxMin ( rectTotal
.height
, sizeThumb
.y
);
555 m_rectSlider
.height
= wxMax ( m_rectSlider
.height
, height
);
559 wxSize
wxSlider::GetDefaultThumbSize() const
561 // Default size has no styles (arrows)
562 return GetRenderer()->GetSliderThumbSize(GetSliderRect(), 0, GetOrientation());
565 wxSize
wxSlider::GetThumbSize() const
567 return GetRenderer()->GetSliderThumbSize(GetSliderRect(), m_thumbSize
, GetOrientation());
570 // ----------------------------------------------------------------------------
571 // wxSlider thumb geometry
572 // ----------------------------------------------------------------------------
574 wxRect
wxSlider::GetShaftRect() const
576 return GetRenderer()->GetSliderShaftRect(m_rectSlider
, m_thumbSize
, GetOrientation(), GetWindowStyle());
579 void wxSlider::CalcThumbRect(const wxRect
*rectShaftIn
,
580 wxRect
*rectThumbOut
,
581 wxRect
*rectLabelOut
,
584 if ( value
== INVALID_THUMB_VALUE
)
586 // use the current if not specified
590 bool isVertical
= IsVert();
595 rectShaft
= *rectShaftIn
;
597 else // no shaft rect provided, calc it
599 rectShaft
= GetShaftRect();
606 wxRect
rectThumb(rectShaft
.GetPosition(), GetThumbSize());
609 rectThumb
.x
+= (rectShaft
.width
- rectThumb
.width
) / 2;
611 lenThumb
= rectThumb
.height
;
612 lenShaft
= rectShaft
.height
;
617 rectThumb
.y
+= (rectShaft
.height
- rectThumb
.height
) / 2;
619 lenThumb
= rectThumb
.width
;
620 lenShaft
= rectShaft
.width
;
624 // the thumb must always be entirely inside the shaft limits, so the max
625 // position is not at lenShaft but at lenShaft - thumbSize
626 if ( m_max
!= m_min
)
630 *p
+= ((lenShaft
- lenThumb
)*(m_max
- value
))/(m_max
- m_min
);
634 *p
+= ((lenShaft
- lenThumb
)*(value
- m_min
))/(m_max
- m_min
);
638 // calc the label rect
639 if ( HasLabels() && rectLabelOut
)
641 long style
= GetWindowStyle();
642 wxRect rectLabel
= m_rectLabel
;
644 // centre the label relatively to the thumb position
645 if (style
& (wxSL_TOP
|wxSL_BOTTOM
))
647 rectLabel
.x
= rectThumb
.x
+ (rectThumb
.width
- m_rectLabel
.width
)/2;
649 else if (style
& (wxSL_LEFT
|wxSL_RIGHT
))
651 rectLabel
.y
= rectThumb
.y
+ (rectThumb
.height
- m_rectLabel
.height
)/2;
654 *rectLabelOut
= rectLabel
;
659 *rectThumbOut
= rectThumb
;
662 // ----------------------------------------------------------------------------
664 // ----------------------------------------------------------------------------
666 wxString
wxSlider::FormatValue(int value
) const
668 return wxString::Format(_T("%d"), value
);
671 void wxSlider::DoDraw(wxControlRenderer
*renderer
)
673 wxRenderer
*rend
= GetRenderer();
674 wxDC
& dc
= renderer
->GetDC();
675 wxRect rectUpdate
= GetUpdateClientRect();
677 wxOrientation orient
= GetOrientation();
678 int flags
= GetStateFlags();
679 long style
= GetWindowStyle();
681 wxSize sz
= GetThumbSize();
682 int len
= IsVert() ? sz
.x
: sz
.y
;
684 // first draw the shaft
685 wxRect rectShaft
= rend
->GetSliderShaftRect(m_rectSlider
, len
, orient
, style
);
686 if ( rectUpdate
.Intersects(rectShaft
) )
688 rend
->DrawSliderShaft(dc
, m_rectSlider
, len
, orient
, flags
, style
);
691 // calculate the thumb position in pixels and draw it
692 wxRect rectThumb
, rectLabel
;
693 CalcThumbRect(&rectShaft
, &rectThumb
, &rectLabel
);
695 // then draw the ticks
696 if ( HasTicks() && rectUpdate
.Intersects(m_rectTicks
) )
698 rend
->DrawSliderTicks(dc
, m_rectSlider
, len
, orient
,
699 m_min
, m_max
, m_tickFreq
, flags
, style
);
702 // then draw the thumb
703 if ( rectUpdate
.Intersects(rectThumb
) )
705 rend
->DrawSliderThumb(dc
, rectThumb
, orient
, flags
| m_thumbFlags
, style
);
708 // finally, draw the label near the thumb
709 if ( HasLabels() && rectUpdate
.Intersects(rectLabel
) )
711 // align it to be close to the shaft
713 if (style
& wxSL_TOP
)
715 align
= wxALIGN_CENTRE_HORIZONTAL
|wxALIGN_TOP
;
717 else if (style
& wxSL_BOTTOM
)
719 align
= wxALIGN_CENTRE_HORIZONTAL
|wxALIGN_BOTTOM
;
721 else if (style
& wxSL_LEFT
)
723 align
= wxALIGN_CENTRE_VERTICAL
|wxALIGN_LEFT
;
725 else if (style
& wxSL_RIGHT
)
727 align
= wxALIGN_CENTRE_VERTICAL
|wxALIGN_RIGHT
;
730 dc
.SetFont(GetFont());
731 dc
.SetTextForeground(GetForegroundColour());
733 // the slider label is never drawn focused
734 rend
->DrawLabel(dc
, FormatValue(m_value
), rectLabel
,
735 flags
& ~wxCONTROL_FOCUSED
, align
);
739 // ----------------------------------------------------------------------------
740 // wxSlider input processing
741 // ----------------------------------------------------------------------------
743 bool wxSlider::PerformAction(const wxControlAction
& action
,
745 const wxString
& strArg
)
747 wxEventType scrollEvent
= wxEVT_NULL
;
749 bool valueChanged
= true;
751 if ( action
== wxACTION_SLIDER_START
)
753 scrollEvent
= wxEVT_SCROLL_TOP
;
756 else if ( action
== wxACTION_SLIDER_END
)
758 scrollEvent
= wxEVT_SCROLL_BOTTOM
;
761 else if ( action
== wxACTION_SLIDER_PAGE_CHANGE
)
763 value
= NormalizeValue(m_value
+ numArg
* GetPageSize());
765 else if ( action
== wxACTION_SLIDER_LINE_UP
)
767 scrollEvent
= wxEVT_SCROLL_LINEUP
;
768 value
= NormalizeValue(m_value
+ +GetLineSize());
770 else if ( action
== wxACTION_SLIDER_LINE_DOWN
)
772 scrollEvent
= wxEVT_SCROLL_LINEDOWN
;
773 value
= NormalizeValue(m_value
+ -GetLineSize());
775 else if ( action
== wxACTION_SLIDER_PAGE_UP
)
777 scrollEvent
= wxEVT_SCROLL_PAGEUP
;
778 value
= NormalizeValue(m_value
+ +GetPageSize());
780 else if ( action
== wxACTION_SLIDER_PAGE_DOWN
)
782 scrollEvent
= wxEVT_SCROLL_PAGEDOWN
;
783 value
= NormalizeValue(m_value
+ -GetPageSize());
785 else if ( action
== wxACTION_SLIDER_THUMB_DRAG
||
786 action
== wxACTION_SLIDER_THUMB_MOVE
)
788 scrollEvent
= wxEVT_SCROLL_THUMBTRACK
;
790 // we shouldn't generate a command event about this change but we still
791 // should update our value and the slider appearance
792 valueChanged
= false;
797 else if ( action
== wxACTION_SLIDER_THUMB_RELEASE
)
799 scrollEvent
= wxEVT_SCROLL_THUMBRELEASE
;
804 return wxControl::PerformAction(action
, numArg
, strArg
);
807 // update wxSlider current value and generate wxCommandEvent, except while
808 // dragging the thumb
810 ChangeValueTo(value
);
812 // also generate more precise wxScrollEvent if applicable
813 if ( scrollEvent
!= wxEVT_NULL
)
815 wxScrollEvent
event(scrollEvent
, GetId());
816 event
.SetPosition(value
);
817 event
.SetEventObject( this );
818 GetEventHandler()->ProcessEvent(event
);
824 // ----------------------------------------------------------------------------
825 // wxSlider implementation of wxControlWithThumb interface
826 // ----------------------------------------------------------------------------
828 wxScrollThumb::Shaft
wxSlider::HitTest(const wxPoint
& pt
) const
830 wxRect rectShaft
= GetShaftRect();
832 CalcThumbRect(&rectShaft
, &rectThumb
, NULL
);
834 // check for possible shaft or thumb hit
835 if (!rectShaft
.Inside(pt
) && !rectThumb
.Inside(pt
))
837 return wxScrollThumb::Shaft_None
;
840 // the position to test and the start and end of the thumb
841 wxCoord x
, x1
, x2
, x3
, x4
;
845 x1
= rectThumb
.GetBottom();
846 x2
= rectShaft
.GetBottom();
847 x3
= rectShaft
.GetTop();
848 x4
= rectThumb
.GetTop();
853 x1
= rectShaft
.GetLeft();
854 x2
= rectThumb
.GetLeft();
855 x3
= rectThumb
.GetRight();
856 x4
= rectShaft
.GetRight();
858 if ((x1
<= x
) && (x
< x2
))
861 return wxScrollThumb::Shaft_Above
;
864 if ((x3
< x
) && (x
<= x4
)) {
866 return wxScrollThumb::Shaft_Below
;
869 // where else can it be?
870 return wxScrollThumb::Shaft_Thumb
;
873 wxCoord
wxSlider::ThumbPosToPixel() const
876 CalcThumbRect(NULL
, &rectThumb
, NULL
);
878 return IsVert() ? rectThumb
.y
: rectThumb
.x
;
881 int wxSlider::PixelToThumbPos(wxCoord x
) const
883 wxRect rectShaft
= GetShaftRect();
884 wxSize sizeThumb
= GetThumbSize();
890 len
= rectShaft
.height
- sizeThumb
.y
;
895 len
= rectShaft
.width
- sizeThumb
.x
;
903 pos
+= ((x
- x0
) * (m_max
- m_min
)) / len
;
907 //else: x <= x0, leave pos = min
913 void wxSlider::SetShaftPartState(wxScrollThumb::Shaft shaftPart
,
917 // for now we ignore the flags for the shaft as no renderer uses them
919 if ( shaftPart
== wxScrollThumb::Shaft_Thumb
)
922 m_thumbFlags
|= flag
;
924 m_thumbFlags
&= ~flag
;
930 void wxSlider::OnThumbDragStart(int pos
)
934 PerformAction(wxACTION_SLIDER_THUMB_DRAG
, m_max
- pos
);
938 PerformAction(wxACTION_SLIDER_THUMB_DRAG
, pos
);
942 void wxSlider::OnThumbDrag(int pos
)
946 PerformAction(wxACTION_SLIDER_THUMB_MOVE
, m_max
- pos
);
950 PerformAction(wxACTION_SLIDER_THUMB_MOVE
, pos
);
954 void wxSlider::OnThumbDragEnd(int pos
)
958 PerformAction(wxACTION_SLIDER_THUMB_RELEASE
, m_max
- pos
);
962 PerformAction(wxACTION_SLIDER_THUMB_RELEASE
, pos
);
966 void wxSlider::OnPageScrollStart()
968 // we do nothing here
971 bool wxSlider::OnPageScroll(int pageInc
)
973 int value
= GetValue();
974 PerformAction(wxACTION_SLIDER_PAGE_CHANGE
, pageInc
);
976 return GetValue() != value
;
979 // ----------------------------------------------------------------------------
980 // wxStdSliderButtonInputHandler
981 // ----------------------------------------------------------------------------
983 bool wxStdSliderButtonInputHandler::HandleKey(wxInputConsumer
*consumer
,
984 const wxKeyEvent
& event
,
989 int keycode
= event
.GetKeyCode();
991 wxControlAction action
;
995 action
= wxACTION_SLIDER_END
;
999 action
= wxACTION_SLIDER_START
;
1004 action
= wxACTION_SLIDER_LINE_UP
;
1009 action
= wxACTION_SLIDER_LINE_DOWN
;
1013 action
= wxACTION_SLIDER_PAGE_UP
;
1017 action
= wxACTION_SLIDER_PAGE_DOWN
;
1021 if ( !action
.IsEmpty() )
1023 consumer
->PerformAction(action
);
1029 return wxStdInputHandler::HandleKey(consumer
, event
, pressed
);
1032 bool wxStdSliderButtonInputHandler::HandleMouse(wxInputConsumer
*consumer
,
1033 const wxMouseEvent
& event
)
1035 wxSlider
*slider
= wxStaticCast(consumer
->GetInputWindow(), wxSlider
);
1037 if ( slider
->GetThumb().HandleMouse(event
) )
1039 // processed by the thumb
1043 return wxStdInputHandler::HandleMouse(consumer
, event
);
1046 bool wxStdSliderButtonInputHandler::HandleMouseMove(wxInputConsumer
*consumer
,
1047 const wxMouseEvent
& event
)
1049 wxSlider
*slider
= wxStaticCast(consumer
->GetInputWindow(), wxSlider
);
1051 if ( slider
->GetThumb().HandleMouseMove(event
) )
1053 // processed by the thumb
1057 return wxStdInputHandler::HandleMouseMove(consumer
, event
);
1061 wxStdSliderButtonInputHandler::HandleFocus(wxInputConsumer
* WXUNUSED(consumer
),
1062 const wxFocusEvent
& WXUNUSED(event
))
1064 // slider's appearance changes when it gets/loses focus
1068 #endif // wxUSE_SLIDER