1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSlider class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/control.h"
16 #include "wx/slider.h"
17 #include "wx/stattext.h"
20 class WXDLLIMPEXP_CORE wxSlider
: public wxSliderBase
22 DECLARE_DYNAMIC_CLASS(wxSlider
)
27 inline wxSlider(wxWindow
*parent
, wxWindowID id
,
28 int value
, int minValue
, int maxValue
,
29 const wxPoint
& pos
= wxDefaultPosition
,
30 const wxSize
& size
= wxDefaultSize
,
31 long style
= wxSL_HORIZONTAL
,
32 const wxValidator
& validator
= wxDefaultValidator
,
33 const wxString
& name
= wxSliderNameStr
)
35 Create(parent
, id
, value
, minValue
, maxValue
, pos
, size
, style
, validator
, name
);
40 bool Create(wxWindow
*parent
, wxWindowID id
,
41 int value
, int minValue
, int maxValue
,
42 const wxPoint
& pos
= wxDefaultPosition
,
43 const wxSize
& size
= wxDefaultSize
,
44 long style
= wxSL_HORIZONTAL
,
45 const wxValidator
& validator
= wxDefaultValidator
,
46 const wxString
& name
= wxSliderNameStr
);
48 virtual int GetValue() const ;
49 virtual void SetValue(int);
51 void SetRange(int minValue
, int maxValue
);
53 inline int GetMin() const { return m_rangeMin
; }
54 inline int GetMax() const { return m_rangeMax
; }
56 void SetMin(int minValue
) { SetRange(minValue
, m_rangeMax
); }
57 void SetMax(int maxValue
) { SetRange(m_rangeMin
, maxValue
); }
60 inline int GetTickFreq() const { return m_tickFreq
; }
61 void SetPageSize(int pageSize
);
62 int GetPageSize() const ;
65 void SetLineSize(int lineSize
);
66 int GetLineSize() const ;
67 int GetSelEnd() const ;
68 int GetSelStart() const ;
69 void SetSelection(int minPos
, int maxPos
);
70 void SetThumbLength(int len
) ;
71 int GetThumbLength() const ;
72 void SetTick(int tickPos
) ;
74 void Command(wxCommandEvent
& event
);
75 // osx specific event handling common for all osx-ports
77 virtual bool OSXHandleClicked( double timestampsec
);
78 virtual void TriggerScrollEvent( wxEventType scrollEvent
) ;
81 // Platform-specific implementation of SetTickFreq
82 virtual void DoSetTickFreq(int freq
);
84 virtual wxSize
DoGetBestSize() const;
85 virtual void DoSetSize(int x
, int y
, int w
, int h
, int sizeFlags
);
86 virtual void DoMoveWindow(int x
, int y
, int w
, int h
);
88 // set min/max size of the slider
89 virtual void DoSetSizeHints( int minW
, int minH
,
93 // Common processing to invert slider values based on wxSL_INVERSE
94 virtual int ValueInvertOrNot(int value
) const;
96 wxStaticText
* m_macMinimumStatic
;
97 wxStaticText
* m_macMaximumStatic
;
98 wxStaticText
* m_macValueStatic
;
106 DECLARE_EVENT_TABLE()