]> git.saurik.com Git - wxWidgets.git/blob - include/wx/osx/slider.h
Remove all lines containing cvs/svn "$Id$" keyword.
[wxWidgets.git] / include / wx / osx / slider.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/slider.h
3 // Purpose: wxSlider class
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 1998-01-01
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_SLIDER_H_
12 #define _WX_SLIDER_H_
13
14 #include "wx/control.h"
15 #include "wx/slider.h"
16 #include "wx/stattext.h"
17
18 // Slider
19 class WXDLLIMPEXP_CORE wxSlider: public wxSliderBase
20 {
21 DECLARE_DYNAMIC_CLASS(wxSlider)
22
23 public:
24 wxSlider();
25
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)
33 {
34 Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
35 }
36
37 virtual ~wxSlider();
38
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);
46
47 virtual int GetValue() const ;
48 virtual void SetValue(int);
49
50 void SetRange(int minValue, int maxValue);
51
52 inline int GetMin() const { return m_rangeMin; }
53 inline int GetMax() const { return m_rangeMax; }
54
55 void SetMin(int minValue) { SetRange(minValue, m_rangeMax); }
56 void SetMax(int maxValue) { SetRange(m_rangeMin, maxValue); }
57
58 // For trackbars only
59 inline int GetTickFreq() const { return m_tickFreq; }
60 void SetPageSize(int pageSize);
61 int GetPageSize() const ;
62 void ClearSel() ;
63 void ClearTicks() ;
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) ;
72
73 void Command(wxCommandEvent& event);
74 // osx specific event handling common for all osx-ports
75
76 virtual bool OSXHandleClicked( double timestampsec );
77 virtual void TriggerScrollEvent( wxEventType scrollEvent ) ;
78
79 protected:
80 // Platform-specific implementation of SetTickFreq
81 virtual void DoSetTickFreq(int freq);
82
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);
86
87 // set min/max size of the slider
88 virtual void DoSetSizeHints( int minW, int minH,
89 int maxW, int maxH,
90 int incW, int incH);
91
92 // Common processing to invert slider values based on wxSL_INVERSE
93 virtual int ValueInvertOrNot(int value) const;
94
95 wxStaticText* m_macMinimumStatic ;
96 wxStaticText* m_macMaximumStatic ;
97 wxStaticText* m_macValueStatic ;
98
99 int m_rangeMin;
100 int m_rangeMax;
101 int m_pageSize;
102 int m_lineSize;
103 int m_tickFreq;
104 private :
105 DECLARE_EVENT_TABLE()
106 };
107
108 #endif
109 // _WX_SLIDER_H_