]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: slider.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
58614078 | 5 | // Id: $Id$ |
c801d85f KB |
6 | // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
c801d85f KB |
10 | #ifndef __GTKSLIDERH__ |
11 | #define __GTKSLIDERH__ | |
12 | ||
13 | #ifdef __GNUG__ | |
14 | #pragma interface | |
15 | #endif | |
16 | ||
17 | #include "wx/defs.h" | |
dcf924a3 RR |
18 | |
19 | #if wxUSE_SLIDER | |
20 | ||
c801d85f KB |
21 | #include "wx/object.h" |
22 | #include "wx/list.h" | |
23 | #include "wx/control.h" | |
24 | ||
25 | //----------------------------------------------------------------------------- | |
26 | // classes | |
27 | //----------------------------------------------------------------------------- | |
28 | ||
29 | class wxSlider; | |
30 | ||
31 | //----------------------------------------------------------------------------- | |
32 | // global data | |
33 | //----------------------------------------------------------------------------- | |
34 | ||
35 | extern const char *wxSliderNameStr; | |
36 | ||
37 | //----------------------------------------------------------------------------- | |
38 | // wxSlider | |
39 | //----------------------------------------------------------------------------- | |
40 | ||
41 | class wxSlider: public wxControl | |
42 | { | |
a075e27b | 43 | public: |
aa9a4ae1 | 44 | wxSlider(); |
6de97a3b | 45 | inline wxSlider( wxWindow *parent, wxWindowID id, |
debe6624 | 46 | int value, int minValue, int maxValue, |
c801d85f KB |
47 | const wxPoint& pos = wxDefaultPosition, |
48 | const wxSize& size = wxDefaultSize, | |
debe6624 | 49 | long style = wxSL_HORIZONTAL, |
6de97a3b RR |
50 | const wxValidator& validator = wxDefaultValidator, |
51 | const wxString& name = wxSliderNameStr ) | |
52 | { | |
53 | Create( parent, id, value, minValue, maxValue, pos, size, style, validator, name ); | |
54 | } | |
aa9a4ae1 | 55 | ~wxSlider(); |
6de97a3b | 56 | bool Create(wxWindow *parent, wxWindowID id, |
debe6624 | 57 | int value, int minValue, int maxValue, |
c801d85f KB |
58 | const wxPoint& pos = wxDefaultPosition, |
59 | const wxSize& size = wxDefaultSize, | |
debe6624 | 60 | long style = wxSL_HORIZONTAL, |
aa9a4ae1 | 61 | const wxValidator& validator = wxDefaultValidator, |
6de97a3b | 62 | const wxString& name = wxSliderNameStr ); |
a075e27b | 63 | virtual int GetValue() const; |
debe6624 | 64 | virtual void SetValue( int ); |
debe6624 | 65 | void SetRange( int minValue, int maxValue ); |
a075e27b RR |
66 | int GetMin() const; |
67 | int GetMax() const; | |
debe6624 | 68 | void SetTickFreq( int n, int pos ); |
a075e27b | 69 | int GetTickFreq() const; |
debe6624 | 70 | void SetPageSize( int pageSize ); |
a075e27b RR |
71 | int GetPageSize() const; |
72 | void ClearSel(); | |
73 | void ClearTicks(); | |
debe6624 | 74 | void SetLineSize( int lineSize ); |
a075e27b RR |
75 | int GetLineSize() const; |
76 | int GetSelEnd() const; | |
77 | int GetSelStart() const; | |
debe6624 JS |
78 | void SetSelection( int minPos, int maxPos ); |
79 | void SetThumbLength( int len ); | |
a075e27b | 80 | int GetThumbLength() const; |
debe6624 | 81 | void SetTick( int tickPos ); |
c801d85f | 82 | |
aa9a4ae1 | 83 | // implementation |
a075e27b | 84 | // -------------- |
aa9a4ae1 | 85 | |
b4071e91 | 86 | bool IsOwnGtkWindow( GdkWindow *window ); |
58614078 | 87 | void ApplyWidgetStyle(); |
aa9a4ae1 | 88 | |
c801d85f KB |
89 | GtkAdjustment *m_adjust; |
90 | float m_oldPos; | |
aa9a4ae1 | 91 | |
a075e27b RR |
92 | private: |
93 | DECLARE_DYNAMIC_CLASS(wxSlider) | |
c801d85f KB |
94 | }; |
95 | ||
dcf924a3 RR |
96 | #endif |
97 | ||
c801d85f | 98 | #endif // __GTKSLIDERH__ |