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