]>
Commit | Line | Data |
---|---|---|
9b6dbb09 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: slider.h | |
3 | // Purpose: wxSlider class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_SLIDER_H_ | |
13 | #define _WX_SLIDER_H_ | |
14 | ||
15 | #ifdef __GNUG__ | |
16 | #pragma interface "slider.h" | |
17 | #endif | |
18 | ||
19 | #include "wx/control.h" | |
20 | ||
21 | WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr; | |
22 | ||
23 | // Slider | |
93e73c74 | 24 | class WXDLLEXPORT wxSlider: public wxSliderBase |
9b6dbb09 | 25 | { |
83df96d6 JS |
26 | DECLARE_DYNAMIC_CLASS(wxSlider) |
27 | ||
9b6dbb09 | 28 | public: |
bfc6fde4 | 29 | wxSlider(); |
83df96d6 | 30 | |
bfc6fde4 | 31 | wxSlider(wxWindow *parent, wxWindowID id, |
83df96d6 JS |
32 | int value, int minValue, int maxValue, |
33 | const wxPoint& pos = wxDefaultPosition, | |
34 | const wxSize& size = wxDefaultSize, | |
35 | long style = wxSL_HORIZONTAL, | |
36 | const wxValidator& validator = wxDefaultValidator, | |
37 | const wxString& name = wxSliderNameStr) | |
bfc6fde4 VZ |
38 | { |
39 | Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name); | |
40 | } | |
83df96d6 | 41 | |
bfc6fde4 | 42 | ~wxSlider(); |
83df96d6 | 43 | |
bfc6fde4 | 44 | bool Create(wxWindow *parent, wxWindowID id, |
83df96d6 JS |
45 | int value, int minValue, int maxValue, |
46 | const wxPoint& pos = wxDefaultPosition, | |
47 | const wxSize& size = wxDefaultSize, | |
48 | long style = wxSL_HORIZONTAL, | |
49 | const wxValidator& validator = wxDefaultValidator, | |
50 | const wxString& name = wxSliderNameStr); | |
51 | ||
bfc6fde4 VZ |
52 | virtual int GetValue() const ; |
53 | virtual void SetValue(int); | |
83df96d6 | 54 | |
bfc6fde4 | 55 | void SetRange(int minValue, int maxValue); |
83df96d6 | 56 | |
bfc6fde4 VZ |
57 | inline int GetMin() const { return m_rangeMin; } |
58 | inline int GetMax() const { return m_rangeMax; } | |
83df96d6 | 59 | |
bfc6fde4 | 60 | // For trackbars only |
bfc6fde4 VZ |
61 | void SetPageSize(int pageSize); |
62 | int GetPageSize() const ; | |
bfc6fde4 VZ |
63 | void SetLineSize(int lineSize); |
64 | int GetLineSize() const ; | |
bfc6fde4 VZ |
65 | void SetThumbLength(int len) ; |
66 | int GetThumbLength() const ; | |
83df96d6 | 67 | |
bfc6fde4 | 68 | void Command(wxCommandEvent& event); |
83df96d6 | 69 | |
bfc6fde4 VZ |
70 | protected: |
71 | int m_rangeMin; | |
72 | int m_rangeMax; | |
73 | int m_pageSize; | |
74 | int m_lineSize; | |
83df96d6 | 75 | |
bfc6fde4 | 76 | virtual void DoSetSize(int x, int y, |
83df96d6 JS |
77 | int width, int height, |
78 | int sizeFlags = wxSIZE_AUTO); | |
79 | ||
bfc6fde4 VZ |
80 | private: |
81 | DECLARE_EVENT_TABLE() | |
9b6dbb09 JS |
82 | }; |
83 | ||
84 | #endif | |
83df96d6 | 85 | // _WX_SLIDER_H_ |