]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/slider.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSlider interface
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1996-2001 wxWindows team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_SLIDER_H_BASE_
13 #define _WX_SLIDER_H_BASE_
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
23 #include "wx/control.h"
25 WXDLLEXPORT_DATA(extern const wxChar
*) wxSliderNameStr
;
27 // ----------------------------------------------------------------------------
28 // wxSliderBase: define wxSlider interface
29 // ----------------------------------------------------------------------------
31 class WXDLLEXPORT wxSliderBase
: public wxControl
34 /* the ctor of the derived class should have the following form:
36 wxSlider(wxWindow *parent,
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);
47 // get/set the current slider value (should be in range)
48 virtual int GetValue() const = 0;
49 virtual void SetValue(int value
) = 0;
51 // retrieve/change the range
52 virtual void SetRange(int minValue
, int maxValue
) = 0;
53 virtual int GetMin() const = 0;
54 virtual int GetMax() const = 0;
56 // the line/page size is the increment by which the slider moves when
57 // cursor arrow key/page up or down are pressed (clicking the mouse is like
58 // pressing PageUp/Down) and are by default set to 1 and 1/10 of the range
59 virtual void SetLineSize(int lineSize
) = 0;
60 virtual void SetPageSize(int pageSize
) = 0;
61 virtual int GetLineSize() const = 0;
62 virtual int GetPageSize() const = 0;
64 // these methods get/set the length of the slider pointer in pixels
65 virtual void SetThumbLength(int lenPixels
) = 0;
66 virtual int GetThumbLength() const = 0;
68 // warning: most of subsequent methods are currently only implemented in
69 // wxMSW under Win95 and are silently ignored on other platforms
71 virtual void SetTickFreq(int WXUNUSED(n
), int WXUNUSED(pos
)) { }
72 virtual int GetTickFreq() const { return 0; }
73 virtual void ClearTicks() { }
74 virtual void SetTick(int WXUNUSED(tickPos
)) { }
76 virtual void ClearSel() { }
77 virtual int GetSelEnd() const { return GetMin(); }
78 virtual int GetSelStart() const { return GetMax(); }
79 virtual void SetSelection(int WXUNUSED(min
), int WXUNUSED(max
)) { }
82 DECLARE_NO_COPY_CLASS(wxSliderBase
)
85 // ----------------------------------------------------------------------------
86 // include the real class declaration
87 // ----------------------------------------------------------------------------
89 #if defined(__WXUNIVERSAL__)
90 #include "wx/univ/slider.h"
91 #elif defined(__WXMSW__)
92 #include "wx/msw/slider95.h"
93 #define wxSlider wxSlider95
94 #define sm_classwxSlider sm_classwxSlider95
95 #elif defined(__WXMOTIF__)
96 #include "wx/motif/slider.h"
97 #elif defined(__WXGTK__)
98 #include "wx/gtk/slider.h"
99 #elif defined(__WXMAC__)
100 #include "wx/mac/slider.h"
101 #elif defined(__WXCOCOA__)
102 #include "wx/cocoa/slider.h"
103 #elif defined(__WXPM__)
104 #include "wx/os2/slider.h"
107 #endif // wxUSE_SLIDER
110 // _WX_SLIDER_H_BASE_