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