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