]>
Commit | Line | Data |
---|---|---|
0dbd6262 SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: slider.h | |
3 | // Purpose: wxSlider class | |
a31a5f85 | 4 | // Author: Stefan Csomor |
0dbd6262 | 5 | // Modified by: |
a31a5f85 | 6 | // Created: 1998-01-01 |
0dbd6262 | 7 | // RCS-ID: $Id$ |
a31a5f85 | 8 | // Copyright: (c) Stefan Csomor |
e40298d5 | 9 | // Licence: wxWindows licence |
0dbd6262 SC |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_SLIDER_H_ | |
13 | #define _WX_SLIDER_H_ | |
14 | ||
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
0dbd6262 SC |
16 | #pragma interface "slider.h" |
17 | #endif | |
18 | ||
19 | #include "wx/control.h" | |
03e11df5 GD |
20 | #include "wx/slider.h" |
21 | #include "wx/stattext.h" | |
0dbd6262 | 22 | |
c4e41ce3 | 23 | WXDLLEXPORT_DATA(extern const wxChar*) wxSliderNameStr; |
0dbd6262 SC |
24 | |
25 | // Slider | |
26 | class WXDLLEXPORT wxSlider: public wxControl | |
27 | { | |
28 | DECLARE_DYNAMIC_CLASS(wxSlider) | |
29 | ||
30 | public: | |
31 | wxSlider(); | |
32 | ||
33 | inline wxSlider(wxWindow *parent, wxWindowID id, | |
34 | int value, int minValue, int maxValue, | |
35 | const wxPoint& pos = wxDefaultPosition, | |
36 | const wxSize& size = wxDefaultSize, | |
37 | long style = wxSL_HORIZONTAL, | |
38 | const wxValidator& validator = wxDefaultValidator, | |
39 | const wxString& name = wxSliderNameStr) | |
40 | { | |
41 | Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name); | |
42 | } | |
43 | ||
44 | ~wxSlider(); | |
45 | ||
46 | bool Create(wxWindow *parent, wxWindowID id, | |
47 | int value, int minValue, int maxValue, | |
48 | const wxPoint& pos = wxDefaultPosition, | |
49 | const wxSize& size = wxDefaultSize, | |
50 | long style = wxSL_HORIZONTAL, | |
51 | const wxValidator& validator = wxDefaultValidator, | |
52 | const wxString& name = wxSliderNameStr); | |
53 | ||
54 | virtual int GetValue() const ; | |
55 | virtual void SetValue(int); | |
0dbd6262 SC |
56 | |
57 | void SetRange(int minValue, int maxValue); | |
58 | ||
59 | inline int GetMin() const { return m_rangeMin; } | |
60 | inline int GetMax() const { return m_rangeMax; } | |
61 | ||
af17155e RD |
62 | void SetMin(int minValue) { SetRange(minValue, m_rangeMax); } |
63 | void SetMax(int maxValue) { SetRange(m_rangeMin, maxValue); } | |
64 | ||
0dbd6262 SC |
65 | // For trackbars only |
66 | void SetTickFreq(int n, int pos); | |
67 | inline int GetTickFreq() const { return m_tickFreq; } | |
68 | void SetPageSize(int pageSize); | |
69 | int GetPageSize() const ; | |
70 | void ClearSel() ; | |
71 | void ClearTicks() ; | |
72 | void SetLineSize(int lineSize); | |
73 | int GetLineSize() const ; | |
74 | int GetSelEnd() const ; | |
75 | int GetSelStart() const ; | |
76 | void SetSelection(int minPos, int maxPos); | |
77 | void SetThumbLength(int len) ; | |
78 | int GetThumbLength() const ; | |
79 | void SetTick(int tickPos) ; | |
80 | ||
9453cf2b SC |
81 | |
82 | // set min/max size of the slider | |
83 | virtual void SetSizeHints( int minW, int minH, | |
84 | int maxW = -1, int maxH = -1, | |
85 | int incW = -1, int incH = -1 ); | |
86 | ||
87 | protected: | |
88 | virtual wxSize DoGetBestSize() const; | |
89 | virtual void DoSetSize(int x, int y, int w, int h, int sizeFlags); | |
90 | virtual void DoMoveWindow(int x, int y, int w, int h); | |
91 | ||
0dbd6262 | 92 | void Command(wxCommandEvent& event); |
69b85ca4 | 93 | void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; |
e40298d5 | 94 | virtual void MacUpdateDimensions() ; |
9453cf2b | 95 | |
e40298d5 JS |
96 | wxStaticText* m_macMinimumStatic ; |
97 | wxStaticText* m_macMaximumStatic ; | |
98 | wxStaticText* m_macValueStatic ; | |
519cb848 | 99 | |
0dbd6262 SC |
100 | int m_rangeMin; |
101 | int m_rangeMax; | |
102 | int m_pageSize; | |
103 | int m_lineSize; | |
104 | int m_tickFreq; | |
9453cf2b | 105 | private : |
0dbd6262 SC |
106 | DECLARE_EVENT_TABLE() |
107 | }; | |
108 | ||
109 | #endif | |
110 | // _WX_SLIDER_H_ |