1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/slider.cpp
3 // Purpose: wxSlider, using the Win95 (and later) trackbar control
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart 1998
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 // ============================================================================
15 // ============================================================================
17 // ----------------------------------------------------------------------------
19 // ----------------------------------------------------------------------------
21 // For compilers that support precompilation, includes "wx.h".
22 #include "wx/wxprec.h"
30 #include "wx/slider.h"
33 #include "wx/msw/wrapcctl.h" // include <commctrl.h> "properly"
37 #include "wx/msw/subwin.h"
39 // ----------------------------------------------------------------------------
41 // ----------------------------------------------------------------------------
46 // indices of labels in wxSlider::m_labels
55 // the gaps between the slider and the labels, in pixels
58 // the width of the borders including white space
59 const int BORDERPAD
= 8;
60 // these 2 values are arbitrary:
64 } // anonymous namespace
66 // ----------------------------------------------------------------------------
68 // ----------------------------------------------------------------------------
70 #if wxUSE_EXTENDED_RTTI
71 WX_DEFINE_FLAGS( wxSliderStyle
)
73 wxBEGIN_FLAGS( wxSliderStyle
)
74 // new style border flags, we put them first to
75 // use them for streaming out
76 wxFLAGS_MEMBER(wxBORDER_SIMPLE
)
77 wxFLAGS_MEMBER(wxBORDER_SUNKEN
)
78 wxFLAGS_MEMBER(wxBORDER_DOUBLE
)
79 wxFLAGS_MEMBER(wxBORDER_RAISED
)
80 wxFLAGS_MEMBER(wxBORDER_STATIC
)
81 wxFLAGS_MEMBER(wxBORDER_NONE
)
83 // old style border flags
84 wxFLAGS_MEMBER(wxSIMPLE_BORDER
)
85 wxFLAGS_MEMBER(wxSUNKEN_BORDER
)
86 wxFLAGS_MEMBER(wxDOUBLE_BORDER
)
87 wxFLAGS_MEMBER(wxRAISED_BORDER
)
88 wxFLAGS_MEMBER(wxSTATIC_BORDER
)
89 wxFLAGS_MEMBER(wxBORDER
)
91 // standard window styles
92 wxFLAGS_MEMBER(wxTAB_TRAVERSAL
)
93 wxFLAGS_MEMBER(wxCLIP_CHILDREN
)
94 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW
)
95 wxFLAGS_MEMBER(wxWANTS_CHARS
)
96 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE
)
97 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB
)
98 wxFLAGS_MEMBER(wxVSCROLL
)
99 wxFLAGS_MEMBER(wxHSCROLL
)
101 wxFLAGS_MEMBER(wxSL_HORIZONTAL
)
102 wxFLAGS_MEMBER(wxSL_VERTICAL
)
103 wxFLAGS_MEMBER(wxSL_AUTOTICKS
)
104 wxFLAGS_MEMBER(wxSL_LEFT
)
105 wxFLAGS_MEMBER(wxSL_TOP
)
106 wxFLAGS_MEMBER(wxSL_RIGHT
)
107 wxFLAGS_MEMBER(wxSL_BOTTOM
)
108 wxFLAGS_MEMBER(wxSL_BOTH
)
109 wxFLAGS_MEMBER(wxSL_SELRANGE
)
110 wxFLAGS_MEMBER(wxSL_INVERSE
)
111 wxFLAGS_MEMBER(wxSL_MIN_MAX_LABELS
)
112 wxFLAGS_MEMBER(wxSL_VALUE_LABEL
)
113 wxFLAGS_MEMBER(wxSL_LABELS
)
115 wxEND_FLAGS( wxSliderStyle
)
117 IMPLEMENT_DYNAMIC_CLASS_XTI(wxSlider
, wxControl
,"wx/slider.h")
119 wxBEGIN_PROPERTIES_TABLE(wxSlider
)
120 wxEVENT_RANGE_PROPERTY( Scroll
, wxEVT_SCROLL_TOP
, wxEVT_SCROLL_CHANGED
, wxScrollEvent
)
121 wxEVENT_PROPERTY( Updated
, wxEVT_COMMAND_SLIDER_UPDATED
, wxCommandEvent
)
123 wxPROPERTY( Value
, int , SetValue
, GetValue
, 0, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
124 wxPROPERTY( Minimum
, int , SetMin
, GetMin
, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
125 wxPROPERTY( Maximum
, int , SetMax
, GetMax
, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
126 wxPROPERTY( PageSize
, int , SetPageSize
, GetLineSize
, 1 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
127 wxPROPERTY( LineSize
, int , SetLineSize
, GetLineSize
, 1 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
128 wxPROPERTY( ThumbLength
, int , SetThumbLength
, GetThumbLength
, 1 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
129 wxPROPERTY_FLAGS( WindowStyle
, wxSliderStyle
, long , SetWindowStyleFlag
, GetWindowStyleFlag
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
130 wxEND_PROPERTIES_TABLE()
132 wxBEGIN_HANDLERS_TABLE(wxSlider
)
133 wxEND_HANDLERS_TABLE()
135 wxCONSTRUCTOR_8( wxSlider
, wxWindow
* , Parent
, wxWindowID
, Id
, int , Value
, int , Minimum
, int , Maximum
, wxPoint
, Position
, wxSize
, Size
, long , WindowStyle
)
137 IMPLEMENT_DYNAMIC_CLASS(wxSlider
, wxControl
)
140 // ============================================================================
141 // wxSlider implementation
142 // ============================================================================
144 // ----------------------------------------------------------------------------
146 // ----------------------------------------------------------------------------
148 void wxSlider::Init()
158 m_isDragging
= false;
161 bool wxSlider::Create(wxWindow
*parent
,
169 const wxValidator
& validator
,
170 const wxString
& name
)
172 wxCHECK_MSG( minValue
< maxValue
, false,
173 wxT("Slider minimum must be strictly less than the maximum.") );
175 // our styles are redundant: wxSL_LEFT/RIGHT imply wxSL_VERTICAL and
176 // wxSL_TOP/BOTTOM imply wxSL_HORIZONTAL, but for backwards compatibility
177 // reasons we can't really change it, instead try to infer the orientation
178 // from the flags given to us here
179 switch ( style
& (wxSL_LEFT
| wxSL_RIGHT
| wxSL_TOP
| wxSL_BOTTOM
) )
183 style
|= wxSL_VERTICAL
;
188 style
|= wxSL_HORIZONTAL
;
192 // no specific direction, do we have at least the orientation?
193 if ( !(style
& (wxSL_HORIZONTAL
| wxSL_VERTICAL
)) )
195 // no, choose default
196 style
|= wxSL_BOTTOM
| wxSL_HORIZONTAL
;
200 wxASSERT_MSG( !(style
& wxSL_VERTICAL
) || !(style
& wxSL_HORIZONTAL
),
201 wxT("incompatible slider direction and orientation") );
204 // initialize everything
205 if ( !CreateControl(parent
, id
, pos
, size
, style
, validator
, name
) )
208 // ensure that we have correct values for GetLabelsSize()
209 m_rangeMin
= minValue
;
210 m_rangeMax
= maxValue
;
212 // create the labels first, so that our DoGetBestSize() could take them
215 // note that we could simply create 3 wxStaticTexts here but it could
216 // result in some observable side effects at wx level (e.g. the parent of
217 // wxSlider would have 3 more children than expected) and so we prefer not
218 // to do it like this
219 if ( m_windowStyle
& wxSL_LABELS
)
221 m_labels
= new wxSubwindows(SliderLabel_Last
);
223 HWND hwndParent
= GetHwndOf(parent
);
224 for ( size_t n
= 0; n
< SliderLabel_Last
; n
++ )
226 wxWindowIDRef lblid
= NewControlId();
228 HWND wnd
= ::CreateWindow
232 WS_CHILD
| WS_VISIBLE
| SS_CENTER
,
235 (HMENU
)wxUIntToPtr(lblid
.GetValue()),
240 m_labels
->Set(n
, wnd
, lblid
);
242 m_labels
->SetFont(GetFont());
245 // now create the main control too
246 if ( !MSWCreateControl(TRACKBAR_CLASS
, wxEmptyString
, pos
, size
) )
249 // and initialize everything
250 SetRange(minValue
, maxValue
);
252 SetPageSize((maxValue
- minValue
)/10);
254 // we need to position the labels correctly if we have them and if
255 // SetSize() hadn't been called before (when best size was determined by
256 // MSWCreateControl()) as in this case they haven't been put in place yet
257 if ( m_labels
&& size
.x
!= wxDefaultCoord
&& size
.y
!= wxDefaultCoord
)
265 WXDWORD
wxSlider::MSWGetStyle(long style
, WXDWORD
*exstyle
) const
267 WXDWORD msStyle
= wxControl::MSWGetStyle(style
, exstyle
);
269 // TBS_HORZ, TBS_RIGHT and TBS_BOTTOM are 0 but do include them for clarity
270 msStyle
|= style
& wxSL_VERTICAL
? TBS_VERT
: TBS_HORZ
;
272 if ( style
& wxSL_BOTH
)
274 // this fully specifies the style combined with TBS_VERT/HORZ above
277 else // choose one direction
279 if ( style
& wxSL_LEFT
)
281 else if ( style
& wxSL_RIGHT
)
282 msStyle
|= TBS_RIGHT
;
283 else if ( style
& wxSL_TOP
)
285 else if ( style
& wxSL_BOTTOM
)
286 msStyle
|= TBS_BOTTOM
;
289 if ( style
& wxSL_AUTOTICKS
)
290 msStyle
|= TBS_AUTOTICKS
;
292 msStyle
|= TBS_NOTICKS
;
294 if ( style
& wxSL_SELRANGE
)
295 msStyle
|= TBS_ENABLESELRANGE
;
300 wxSlider::~wxSlider()
305 // ----------------------------------------------------------------------------
307 // ----------------------------------------------------------------------------
309 bool wxSlider::MSWOnScroll(int WXUNUSED(orientation
),
311 WXWORD
WXUNUSED(pos
),
314 wxEventType scrollEvent
;
318 scrollEvent
= wxEVT_SCROLL_TOP
;
322 scrollEvent
= wxEVT_SCROLL_BOTTOM
;
326 scrollEvent
= wxEVT_SCROLL_LINEUP
;
330 scrollEvent
= wxEVT_SCROLL_LINEDOWN
;
334 scrollEvent
= wxEVT_SCROLL_PAGEUP
;
338 scrollEvent
= wxEVT_SCROLL_PAGEDOWN
;
342 scrollEvent
= wxEVT_SCROLL_THUMBTRACK
;
346 case SB_THUMBPOSITION
:
349 scrollEvent
= wxEVT_SCROLL_THUMBRELEASE
;
350 m_isDragging
= false;
354 // this seems to only happen when the mouse wheel is used: in
355 // this case, as it might be unexpected to get THUMBRELEASE
356 // without preceding THUMBTRACKs, we don't generate it at all
357 // but generate CHANGED event because the control itself does
358 // not send us SB_ENDSCROLL for whatever reason when mouse
360 scrollEvent
= wxEVT_SCROLL_CHANGED
;
365 scrollEvent
= wxEVT_SCROLL_CHANGED
;
369 // unknown scroll event?
373 int newPos
= ValueInvertOrNot((int) ::SendMessage((HWND
) control
, TBM_GETPOS
, 0, 0));
374 if ( (newPos
< GetMin()) || (newPos
> GetMax()) )
376 // out of range - but we did process it
382 wxScrollEvent
event(scrollEvent
, m_windowId
);
383 event
.SetPosition(newPos
);
384 event
.SetEventObject( this );
385 HandleWindowEvent(event
);
387 wxCommandEvent
cevent( wxEVT_COMMAND_SLIDER_UPDATED
, GetId() );
388 cevent
.SetInt( newPos
);
389 cevent
.SetEventObject( this );
391 return HandleWindowEvent( cevent
);
394 void wxSlider::Command (wxCommandEvent
& event
)
396 SetValue (event
.GetInt());
397 ProcessCommand (event
);
400 // ----------------------------------------------------------------------------
402 // ----------------------------------------------------------------------------
404 wxRect
wxSlider::GetBoundingBox() const
406 // take care not to call our own functions which would call us recursively
408 wxSliderBase::DoGetPosition(&x
, &y
);
409 wxSliderBase::DoGetSize(&w
, &h
);
411 wxRect
rect(x
, y
, w
, h
);
414 wxRect lrect
= m_labels
->GetBoundingBox();
415 GetParent()->ScreenToClient(&lrect
.x
, &lrect
.y
);
422 void wxSlider::DoGetSize(int *width
, int *height
) const
424 wxRect rect
= GetBoundingBox();
429 *height
= rect
.height
;
432 void wxSlider::DoGetPosition(int *x
, int *y
) const
434 wxRect rect
= GetBoundingBox();
442 int wxSlider::GetLabelsSize(int *widthMin
, int *widthMax
) const
444 if ( widthMin
&& widthMax
)
446 if ( HasFlag(wxSL_MIN_MAX_LABELS
) )
448 *widthMin
= GetTextExtent(Format(m_rangeMin
)).x
;
449 *widthMax
= GetTextExtent(Format(m_rangeMax
)).x
;
458 return HasFlag(wxSL_LABELS
) ? GetCharHeight() : 0;
461 void wxSlider::DoMoveWindow(int x
, int y
, int width
, int height
)
463 // all complications below are because we need to position the labels,
464 // without them everything is easy
467 wxSliderBase::DoMoveWindow(x
, y
, width
, height
);
471 const int labelHeight
= GetLabelsSize(&m_minLabelWidth
, &m_maxLabelWidth
);
472 const int maxLabelWidth
= wxMax(m_minLabelWidth
, m_maxLabelWidth
);
476 if ( HasFlag(wxSL_TICKS
))
478 if ( HasFlag(wxSL_BOTH
))
481 // be careful to position the slider itself after moving the labels as
482 // otherwise our GetBoundingBox(), which is called from WM_SIZE handler,
483 // would return a wrong result and wrong size would be cached internally
484 if ( HasFlag(wxSL_VERTICAL
) )
490 int xLabel
= (wxMax((THUMB
+ (BORDERPAD
* 2)), maxLabelWidth
) / 2) -
491 (maxLabelWidth
/ 2) + x
;
492 if ( HasFlag(wxSL_LEFT
) )
494 if ( HasFlag(wxSL_MIN_MAX_LABELS
) )
497 holdTopWidth
= m_minLabelWidth
;
498 holdBottomX
= xLabel
- ((m_maxLabelWidth
- m_minLabelWidth
) / 2);
499 holdBottomWidth
= m_maxLabelWidth
;
500 if ( HasFlag(wxSL_INVERSE
) )
502 wxSwap(holdTopWidth
, holdBottomWidth
);
503 wxSwap(holdTopX
, holdBottomX
);
505 DoMoveSibling((HWND
)(*m_labels
)[SliderLabel_Min
],
508 holdTopWidth
, labelHeight
);
509 DoMoveSibling((HWND
)(*m_labels
)[SliderLabel_Max
],
511 y
+ height
- labelHeight
,
512 holdBottomWidth
, labelHeight
);
514 if ( HasFlag(wxSL_VALUE_LABEL
) )
515 DoMoveSibling((HWND
)(*m_labels
)[SliderLabel_Value
],
516 x
+ THUMB
+ tickOffset
+ HGAP
,
517 y
+ (height
- labelHeight
)/2,
518 maxLabelWidth
, labelHeight
);
522 if ( HasFlag(wxSL_MIN_MAX_LABELS
) )
524 holdTopX
= xLabel
+ maxLabelWidth
+ ((m_maxLabelWidth
- m_minLabelWidth
) / 2);
525 holdTopWidth
= m_minLabelWidth
;
526 holdBottomX
= xLabel
+ maxLabelWidth
;
527 holdBottomWidth
= m_maxLabelWidth
;
528 if ( HasFlag(wxSL_INVERSE
) )
530 wxSwap(holdTopWidth
, holdBottomWidth
);
531 wxSwap(holdTopX
, holdBottomX
);
533 DoMoveSibling((HWND
)(*m_labels
)[SliderLabel_Min
],
536 holdTopWidth
, labelHeight
);
537 DoMoveSibling((HWND
)(*m_labels
)[SliderLabel_Max
],
539 y
+ height
- labelHeight
,
540 holdBottomWidth
, labelHeight
);
542 if ( HasFlag(wxSL_VALUE_LABEL
) )
543 labelOffset
= maxLabelWidth
+ HGAP
;
544 DoMoveSibling((HWND
)(*m_labels
)[SliderLabel_Value
],
546 y
+ (height
- labelHeight
)/2,
547 maxLabelWidth
, labelHeight
);
550 // position the slider itself along the left/right edge
551 wxSliderBase::DoMoveWindow(
554 THUMB
+ tickOffset
+ HGAP
,
555 height
- (labelHeight
* 2));
564 (y
+ ((THUMB
+ tickOffset
) / 2)) - (labelHeight
/ 2);
566 x
+ m_minLabelWidth
+
567 ((width
- (m_minLabelWidth
+ m_maxLabelWidth
)) / 2) -
568 (m_maxLabelWidth
/ 2);
570 if ( HasFlag(wxSL_BOTTOM
) )
572 if ( HasFlag(wxSL_MIN_MAX_LABELS
) )
575 holdLeftWidth
= m_minLabelWidth
;
576 holdRightX
= x
+ width
- m_maxLabelWidth
;
577 holdRightWidth
= m_maxLabelWidth
;
578 if ( HasFlag(wxSL_INVERSE
) )
580 wxSwap(holdLeftWidth
, holdRightWidth
);
581 wxSwap(holdLeftX
, holdRightX
);
583 DoMoveSibling((HWND
)(*m_labels
)[SliderLabel_Min
],
586 holdLeftWidth
, labelHeight
);
587 DoMoveSibling((HWND
)(*m_labels
)[SliderLabel_Max
],
590 holdRightWidth
, labelHeight
);
592 if ( HasFlag(wxSL_VALUE_LABEL
) )
594 DoMoveSibling((HWND
)(*m_labels
)[SliderLabel_Value
],
597 maxLabelWidth
, labelHeight
);
602 if ( HasFlag(wxSL_MIN_MAX_LABELS
) )
605 holdLeftWidth
= m_minLabelWidth
;
606 holdRightX
= x
+ width
- m_maxLabelWidth
;
607 holdRightWidth
= m_maxLabelWidth
;
608 if ( HasFlag(wxSL_INVERSE
) )
610 wxSwap(holdLeftWidth
, holdRightWidth
);
611 wxSwap(holdLeftX
, holdRightX
);
613 DoMoveSibling((HWND
)(*m_labels
)[SliderLabel_Min
],
616 holdLeftWidth
, labelHeight
);
617 DoMoveSibling((HWND
)(*m_labels
)[SliderLabel_Max
],
620 holdRightWidth
, labelHeight
);
622 if ( HasFlag(wxSL_VALUE_LABEL
) )
623 DoMoveSibling((HWND
)(*m_labels
)[SliderLabel_Value
],
625 y
+ THUMB
+ tickOffset
,
626 maxLabelWidth
, labelHeight
);
629 // position the slider itself along the top/bottom edge
630 if ( HasFlag(wxSL_MIN_MAX_LABELS
) || HasFlag(wxSL_VALUE_LABEL
) )
631 labelOffset
= labelHeight
;
632 wxSliderBase::DoMoveWindow(
633 x
+ m_minLabelWidth
+ VGAP
,
635 width
- (m_minLabelWidth
+ m_maxLabelWidth
+ (VGAP
*2)),
640 wxSize
wxSlider::DoGetBestSize() const
642 // this value is arbitrary:
643 static const int length
= 100;
647 if ( HasFlag(wxSL_VERTICAL
) )
657 int hLabel
= GetLabelsSize(&widthMin
, &widthMax
);
659 // account for the labels
660 size
.x
+= HGAP
+ wxMax(widthMin
, widthMax
);
662 // labels are indented relative to the slider itself
674 // labels add extra height
675 int labelSize
= GetLabelsSize();
676 if ( HasFlag(wxSL_MIN_MAX_LABELS
) )
678 if ( HasFlag(wxSL_VALUE_LABEL
) )
679 size
.y
+= labelSize
*2.75;
683 // need extra space to show ticks
684 if ( HasFlag(wxSL_TICKS
) )
687 // and maybe twice as much if we show them on both sides
688 if ( HasFlag(wxSL_BOTH
) )
694 // ----------------------------------------------------------------------------
695 // slider-specific methods
696 // ----------------------------------------------------------------------------
698 int wxSlider::GetValue() const
700 return ValueInvertOrNot(::SendMessage(GetHwnd(), TBM_GETPOS
, 0, 0));
703 void wxSlider::SetValue(int value
)
705 ::SendMessage(GetHwnd(), TBM_SETPOS
, (WPARAM
)TRUE
, (LPARAM
)ValueInvertOrNot(value
));
709 ::SetWindowText((*m_labels
)[SliderLabel_Value
], Format(value
).wx_str());
713 void wxSlider::SetRange(int minValue
, int maxValue
)
715 m_rangeMin
= minValue
;
716 m_rangeMax
= maxValue
;
718 ::SendMessage(GetHwnd(), TBM_SETRANGEMIN
, TRUE
, m_rangeMin
);
719 ::SendMessage(GetHwnd(), TBM_SETRANGEMAX
, TRUE
, m_rangeMax
);
723 ::SetWindowText((*m_labels
)[SliderLabel_Min
],
724 Format(ValueInvertOrNot(m_rangeMin
)).wx_str());
725 ::SetWindowText((*m_labels
)[SliderLabel_Max
],
726 Format(ValueInvertOrNot(m_rangeMax
)).wx_str());
730 void wxSlider::SetTickFreq(int n
, int pos
)
733 ::SendMessage( GetHwnd(), TBM_SETTICFREQ
, (WPARAM
) n
, (LPARAM
) pos
);
736 void wxSlider::SetPageSize(int pageSize
)
738 ::SendMessage( GetHwnd(), TBM_SETPAGESIZE
, (WPARAM
) 0, (LPARAM
) pageSize
);
739 m_pageSize
= pageSize
;
742 int wxSlider::GetPageSize() const
747 void wxSlider::ClearSel()
749 ::SendMessage(GetHwnd(), TBM_CLEARSEL
, (WPARAM
) TRUE
, (LPARAM
) 0);
752 void wxSlider::ClearTicks()
754 ::SendMessage(GetHwnd(), TBM_CLEARTICS
, (WPARAM
) TRUE
, (LPARAM
) 0);
757 void wxSlider::SetLineSize(int lineSize
)
759 m_lineSize
= lineSize
;
760 ::SendMessage(GetHwnd(), TBM_SETLINESIZE
, (WPARAM
) 0, (LPARAM
) lineSize
);
763 int wxSlider::GetLineSize() const
765 return (int)::SendMessage(GetHwnd(), TBM_GETLINESIZE
, 0, 0);
768 int wxSlider::GetSelEnd() const
770 return (int)::SendMessage(GetHwnd(), TBM_GETSELEND
, 0, 0);
773 int wxSlider::GetSelStart() const
775 return (int)::SendMessage(GetHwnd(), TBM_GETSELSTART
, 0, 0);
778 void wxSlider::SetSelection(int minPos
, int maxPos
)
780 ::SendMessage(GetHwnd(), TBM_SETSEL
,
781 (WPARAM
) TRUE
/* redraw */,
782 (LPARAM
) MAKELONG( minPos
, maxPos
) );
785 void wxSlider::SetThumbLength(int len
)
787 ::SendMessage(GetHwnd(), TBM_SETTHUMBLENGTH
, (WPARAM
) len
, (LPARAM
) 0);
790 int wxSlider::GetThumbLength() const
792 return (int)::SendMessage( GetHwnd(), TBM_GETTHUMBLENGTH
, 0, 0);
795 void wxSlider::SetTick(int tickPos
)
797 ::SendMessage( GetHwnd(), TBM_SETTIC
, (WPARAM
) 0, (LPARAM
) tickPos
);
800 // ----------------------------------------------------------------------------
801 // composite control methods
802 // ----------------------------------------------------------------------------
804 WXHWND
wxSlider::GetStaticMin() const
806 return m_labels
? (WXHWND
)(*m_labels
)[SliderLabel_Min
] : NULL
;
809 WXHWND
wxSlider::GetStaticMax() const
811 return m_labels
? (WXHWND
)(*m_labels
)[SliderLabel_Max
] : NULL
;
814 WXHWND
wxSlider::GetEditValue() const
816 return m_labels
? (WXHWND
)(*m_labels
)[SliderLabel_Value
] : NULL
;
819 WX_FORWARD_STD_METHODS_TO_SUBWINDOWS(wxSlider
, wxSliderBase
, m_labels
)
821 #endif // wxUSE_SLIDER