]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: scrolbar.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
58614078 RR |
5 | // Id: $Id$ |
6 | // Copyright: (c) 1998 Robert Roebling | |
c801d85f KB |
7 | // Licence: wxWindows licence |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | ||
11 | #ifndef __GTKSCROLLBARH__ | |
12 | #define __GTKSCROLLBARH__ | |
13 | ||
14 | #ifdef __GNUG__ | |
15 | #pragma interface | |
16 | #endif | |
17 | ||
18 | #include "wx/defs.h" | |
dcf924a3 RR |
19 | |
20 | #if wxUSE_SCROLLBAR | |
21 | ||
c801d85f KB |
22 | #include "wx/object.h" |
23 | #include "wx/control.h" | |
24 | ||
25 | //----------------------------------------------------------------------------- | |
26 | // classes | |
27 | //----------------------------------------------------------------------------- | |
28 | ||
29 | class wxScrollBar; | |
30 | ||
31 | //----------------------------------------------------------------------------- | |
32 | // global data | |
33 | //----------------------------------------------------------------------------- | |
34 | ||
35 | extern const char *wxScrollBarNameStr; | |
36 | ||
37 | //----------------------------------------------------------------------------- | |
38 | // wxScrollBar | |
39 | //----------------------------------------------------------------------------- | |
40 | ||
41 | class wxScrollBar: public wxControl | |
42 | { | |
20e05ffb | 43 | public: |
c67daf87 | 44 | wxScrollBar(void) { m_adjust = (GtkAdjustment *) NULL; m_oldPos = 0.0; }; |
6de97a3b | 45 | inline wxScrollBar( wxWindow *parent, wxWindowID id, |
c801d85f KB |
46 | const wxPoint& pos = wxDefaultPosition, |
47 | const wxSize& size = wxDefaultSize, | |
debe6624 | 48 | long style = wxSB_HORIZONTAL, |
6de97a3b RR |
49 | const wxValidator& validator = wxDefaultValidator, |
50 | const wxString& name = wxScrollBarNameStr ) | |
51 | { | |
52 | Create( parent, id, pos, size, style, validator, name ); | |
53 | } | |
54 | bool Create( wxWindow *parent, wxWindowID id, | |
c801d85f KB |
55 | const wxPoint& pos = wxDefaultPosition, |
56 | const wxSize& size = wxDefaultSize, | |
debe6624 | 57 | long style = wxSB_HORIZONTAL, |
6de97a3b RR |
58 | const wxValidator& validator = wxDefaultValidator, |
59 | const wxString& name = wxScrollBarNameStr ); | |
60 | ~wxScrollBar(void); | |
4fabb575 | 61 | int GetThumbPosition(void) const; |
c801d85f KB |
62 | int GetThumbSize() const; |
63 | int GetPageSize() const; | |
64 | int GetRange() const; | |
4fabb575 | 65 | virtual void SetThumbPosition( int viewStart ); |
debe6624 JS |
66 | virtual void SetScrollbar( int position, int thumbSize, int range, int pageSize, |
67 | bool refresh = TRUE ); | |
c801d85f | 68 | |
20e05ffb RR |
69 | // Backward compatibility |
70 | // ---------------------- | |
58614078 | 71 | |
c801d85f | 72 | int GetValue(void) const; |
debe6624 | 73 | void SetValue( int viewStart ); |
c801d85f KB |
74 | void GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength) const; |
75 | int GetViewLength() const; | |
76 | int GetObjectLength() const; | |
debe6624 JS |
77 | void SetPageSize( int pageLength ); |
78 | void SetObjectLength( int objectLength ); | |
79 | void SetViewLength( int viewLength ); | |
80 | ||
20e05ffb RR |
81 | // implementation |
82 | // -------------- | |
b4071e91 RR |
83 | |
84 | bool IsOwnGtkWindow( GdkWindow *window ); | |
58614078 | 85 | void ApplyWidgetStyle(); |
c801d85f KB |
86 | |
87 | GtkAdjustment *m_adjust; | |
88 | float m_oldPos; | |
20e05ffb RR |
89 | |
90 | private: | |
91 | DECLARE_DYNAMIC_CLASS(wxScrollBar) | |
c801d85f KB |
92 | }; |
93 | ||
dcf924a3 RR |
94 | #endif |
95 | ||
c801d85f KB |
96 | #endif |
97 | // __GTKSCROLLBARH__ |