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