]>
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 | ||
10 | ||
11 | #ifndef __GTKSLIDERH__ | |
12 | #define __GTKSLIDERH__ | |
13 | ||
14 | #ifdef __GNUG__ | |
15 | #pragma interface | |
16 | #endif | |
17 | ||
18 | #include "wx/defs.h" | |
19 | #include "wx/object.h" | |
20 | #include "wx/list.h" | |
21 | #include "wx/control.h" | |
22 | ||
23 | //----------------------------------------------------------------------------- | |
24 | // classes | |
25 | //----------------------------------------------------------------------------- | |
26 | ||
27 | class wxSlider; | |
28 | ||
29 | //----------------------------------------------------------------------------- | |
30 | // global data | |
31 | //----------------------------------------------------------------------------- | |
32 | ||
33 | extern const char *wxSliderNameStr; | |
34 | ||
35 | //----------------------------------------------------------------------------- | |
36 | // wxSlider | |
37 | //----------------------------------------------------------------------------- | |
38 | ||
39 | class wxSlider: public wxControl | |
40 | { | |
41 | DECLARE_DYNAMIC_CLASS(wxSlider) | |
42 | ||
43 | public: | |
44 | wxSlider(void); | |
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 | } | |
55 | ~wxSlider(void); | |
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, |
6de97a3b RR |
61 | const wxValidator& validator = wxDefaultValidator, |
62 | const wxString& name = wxSliderNameStr ); | |
c801d85f | 63 | virtual int GetValue(void) const; |
debe6624 | 64 | virtual void SetValue( int ); |
debe6624 | 65 | void SetRange( int minValue, int maxValue ); |
c801d85f KB |
66 | int GetMin(void) const; |
67 | int GetMax(void) const; | |
debe6624 | 68 | void SetTickFreq( int n, int pos ); |
c801d85f | 69 | int GetTickFreq(void) const; |
debe6624 | 70 | void SetPageSize( int pageSize ); |
c801d85f KB |
71 | int GetPageSize(void) const; |
72 | void ClearSel(void); | |
73 | void ClearTicks(void); | |
debe6624 | 74 | void SetLineSize( int lineSize ); |
c801d85f KB |
75 | int GetLineSize(void) const; |
76 | int GetSelEnd(void) const; | |
77 | int GetSelStart(void) const; | |
debe6624 JS |
78 | void SetSelection( int minPos, int maxPos ); |
79 | void SetThumbLength( int len ); | |
c801d85f | 80 | int GetThumbLength(void) const; |
debe6624 | 81 | void SetTick( int tickPos ); |
c801d85f | 82 | |
b4071e91 RR |
83 | // implementation |
84 | ||
85 | bool IsOwnGtkWindow( GdkWindow *window ); | |
58614078 | 86 | void ApplyWidgetStyle(); |
b4071e91 | 87 | |
c801d85f KB |
88 | GtkAdjustment *m_adjust; |
89 | float m_oldPos; | |
90 | ||
91 | }; | |
92 | ||
93 | #endif // __GTKSLIDERH__ |