]>
Commit | Line | Data |
---|---|---|
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 | ||
45 | wxScrollBar(void) { m_adjust = NULL; m_oldPos = 0.0; }; | |
46 | wxScrollBar(wxWindow *parent, wxWindowID id, | |
47 | const wxPoint& pos = wxDefaultPosition, | |
48 | const wxSize& size = wxDefaultSize, | |
49 | long style = wxSB_HORIZONTAL, | |
50 | const wxString& name = wxScrollBarNameStr ); | |
51 | ~wxScrollBar(void); | |
52 | bool Create(wxWindow *parent, wxWindowID id, | |
53 | const wxPoint& pos = wxDefaultPosition, | |
54 | const wxSize& size = wxDefaultSize, | |
55 | long style = wxSB_HORIZONTAL, | |
56 | const wxString& name = wxScrollBarNameStr); | |
57 | int GetPosition(void) const; | |
58 | int GetThumbSize() const; | |
59 | int GetPageSize() const; | |
60 | int GetRange() const; | |
61 | virtual void SetPosition( int viewStart ); | |
62 | virtual void SetScrollbar( int position, int thumbSize, int range, int pageSize, | |
63 | bool refresh = TRUE ); | |
64 | ||
65 | // Backward compatibility | |
66 | int GetValue(void) const; | |
67 | void SetValue( int viewStart ); | |
68 | void GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength) const; | |
69 | int GetViewLength() const; | |
70 | int GetObjectLength() const; | |
71 | void SetPageSize( int pageLength ); | |
72 | void SetObjectLength( int objectLength ); | |
73 | void SetViewLength( int viewLength ); | |
74 | ||
75 | public: | |
76 | ||
77 | GtkAdjustment *m_adjust; | |
78 | float m_oldPos; | |
79 | }; | |
80 | ||
81 | #endif | |
82 | // __GTKSCROLLBARH__ |