]>
Commit | Line | Data |
---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/slider.h | |
3 | // Purpose: wxSlider interface | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 09.02.01 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 1996-2001 wxWindows team | |
9 | // Licence: wxWindows licence | |
10 | /////////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_SLIDER_H_BASE_ | |
13 | #define _WX_SLIDER_H_BASE_ | |
14 | ||
15 | // ---------------------------------------------------------------------------- | |
16 | // headers | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
19 | #include "wx/defs.h" | |
20 | ||
21 | #if wxUSE_SLIDER | |
22 | ||
23 | #include "wx/control.h" | |
24 | ||
25 | WXDLLEXPORT_DATA(extern const wxChar*) wxSliderNameStr; | |
26 | ||
27 | // ---------------------------------------------------------------------------- | |
28 | // wxSliderBase: define wxSlider interface | |
29 | // ---------------------------------------------------------------------------- | |
30 | ||
31 | class WXDLLEXPORT wxSliderBase : public wxControl | |
32 | { | |
33 | public: | |
34 | /* the ctor of the derived class should have the following form: | |
35 | ||
36 | wxSlider(wxWindow *parent, | |
37 | 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 | ||
46 | // get/set the current slider value (should be in range) | |
47 | virtual int GetValue() const = 0; | |
48 | virtual void SetValue(int value) = 0; | |
49 | ||
50 | // retrieve/change the range | |
51 | virtual void SetRange(int minValue, int maxValue) = 0; | |
52 | virtual int GetMin() const = 0; | |
53 | virtual int GetMax() const = 0; | |
54 | ||
55 | // the line/page size is the increment by which the slider moves when | |
56 | // cursor arrow key/page up or down are pressed (clicking the mouse is like | |
57 | // pressing PageUp/Down) and are by default set to 1 and 1/10 of the range | |
58 | virtual void SetLineSize(int lineSize) = 0; | |
59 | virtual void SetPageSize(int pageSize) = 0; | |
60 | virtual int GetLineSize() const = 0; | |
61 | virtual int GetPageSize() const = 0; | |
62 | ||
63 | // these methods get/set the length of the slider pointer in pixels | |
64 | virtual void SetThumbLength(int lenPixels) = 0; | |
65 | virtual int GetThumbLength() const = 0; | |
66 | ||
67 | // warning: most of subsequent methods are currently only implemented in | |
68 | // wxMSW under Win95 and are silently ignored on other platforms | |
69 | ||
70 | virtual void SetTickFreq(int WXUNUSED(n), int WXUNUSED(pos)) { } | |
71 | virtual int GetTickFreq() const { return 0; } | |
72 | virtual void ClearTicks() { } | |
73 | virtual void SetTick(int WXUNUSED(tickPos)) { } | |
74 | ||
75 | virtual void ClearSel() { } | |
76 | virtual int GetSelEnd() const { return GetMin(); } | |
77 | virtual int GetSelStart() const { return GetMax(); } | |
78 | virtual void SetSelection(int WXUNUSED(min), int WXUNUSED(max)) { } | |
79 | }; | |
80 | ||
81 | // ---------------------------------------------------------------------------- | |
82 | // include the real class declaration | |
83 | // ---------------------------------------------------------------------------- | |
84 | ||
85 | #if defined(__WXUNIVERSAL__) | |
86 | #include "wx/univ/slider.h" | |
87 | #elif defined(__WXMSW__) | |
88 | #ifdef __WIN95__ | |
89 | #include "wx/msw/slider95.h" | |
90 | #define wxSlider wxSlider95 | |
91 | #define sm_classwxSlider sm_classwxSlider95 | |
92 | #else // Win16 | |
93 | #include "wx/msw/slidrmsw.h" | |
94 | #define wxSlider wxSliderMSW | |
95 | #define sm_classwxSlider sm_classwxSliderMSW | |
96 | #endif // Win32/Win16 | |
97 | #elif defined(__WXMOTIF__) | |
98 | #include "wx/motif/slider.h" | |
99 | #elif defined(__WXGTK__) | |
100 | #include "wx/gtk/slider.h" | |
101 | #elif defined(__WXMAC__) | |
102 | #include "wx/mac/slider.h" | |
103 | #elif defined(__WXPM__) | |
104 | #include "wx/os2/slider.h" | |
105 | #elif defined(__WXSTUBS__) | |
106 | #include "wx/stubs/slider.h" | |
107 | #endif | |
108 | ||
109 | #endif // wxUSE_SLIDER | |
110 | ||
111 | #endif | |
112 | // _WX_SLIDER_H_BASE_ |