]>
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 | |
77ffb593 | 7 | // Licence: wxWidgets licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
10 | ||
11 | #ifndef __GTKSCROLLBARH__ | |
12 | #define __GTKSCROLLBARH__ | |
13 | ||
12028905 | 14 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
2b5f62a0 | 15 | #pragma interface "scrolbar.h" |
c801d85f KB |
16 | #endif |
17 | ||
18 | #include "wx/defs.h" | |
dcf924a3 | 19 | |
c801d85f KB |
20 | //----------------------------------------------------------------------------- |
21 | // classes | |
22 | //----------------------------------------------------------------------------- | |
23 | ||
24 | class wxScrollBar; | |
25 | ||
c801d85f KB |
26 | //----------------------------------------------------------------------------- |
27 | // wxScrollBar | |
28 | //----------------------------------------------------------------------------- | |
29 | ||
1e6feb95 | 30 | class wxScrollBar: public wxScrollBarBase |
c801d85f | 31 | { |
20e05ffb | 32 | public: |
1e6feb95 | 33 | wxScrollBar() |
9826157f | 34 | { m_adjust = (GtkAdjustment *) NULL; m_oldPos = 0.0; } |
6de97a3b | 35 | inline wxScrollBar( wxWindow *parent, wxWindowID id, |
c801d85f KB |
36 | const wxPoint& pos = wxDefaultPosition, |
37 | const wxSize& size = wxDefaultSize, | |
debe6624 | 38 | long style = wxSB_HORIZONTAL, |
6de97a3b RR |
39 | const wxValidator& validator = wxDefaultValidator, |
40 | const wxString& name = wxScrollBarNameStr ) | |
41 | { | |
9826157f | 42 | Create( parent, id, pos, size, style, validator, name ); |
6de97a3b RR |
43 | } |
44 | bool Create( wxWindow *parent, wxWindowID id, | |
c801d85f KB |
45 | const wxPoint& pos = wxDefaultPosition, |
46 | const wxSize& size = wxDefaultSize, | |
debe6624 | 47 | long style = wxSB_HORIZONTAL, |
6de97a3b RR |
48 | const wxValidator& validator = wxDefaultValidator, |
49 | const wxString& name = wxScrollBarNameStr ); | |
9826157f RR |
50 | ~wxScrollBar(); |
51 | int GetThumbPosition() const; | |
c801d85f KB |
52 | int GetThumbSize() const; |
53 | int GetPageSize() const; | |
54 | int GetRange() const; | |
4fabb575 | 55 | virtual void SetThumbPosition( int viewStart ); |
debe6624 JS |
56 | virtual void SetScrollbar( int position, int thumbSize, int range, int pageSize, |
57 | bool refresh = TRUE ); | |
c801d85f | 58 | |
20e05ffb RR |
59 | // Backward compatibility |
60 | // ---------------------- | |
1e6feb95 | 61 | |
c801d85f | 62 | int GetValue(void) const; |
debe6624 | 63 | void SetValue( int viewStart ); |
c801d85f KB |
64 | void GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength) const; |
65 | int GetViewLength() const; | |
66 | int GetObjectLength() const; | |
debe6624 JS |
67 | void SetPageSize( int pageLength ); |
68 | void SetObjectLength( int objectLength ); | |
69 | void SetViewLength( int viewLength ); | |
70 | ||
9d522606 RD |
71 | static wxVisualAttributes |
72 | GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); | |
73 | ||
20e05ffb RR |
74 | // implementation |
75 | // -------------- | |
1e6feb95 | 76 | |
b4071e91 | 77 | bool IsOwnGtkWindow( GdkWindow *window ); |
58614078 | 78 | void ApplyWidgetStyle(); |
1e6feb95 | 79 | |
c801d85f KB |
80 | GtkAdjustment *m_adjust; |
81 | float m_oldPos; | |
1e6feb95 | 82 | |
7f980cff VS |
83 | protected: |
84 | virtual wxSize DoGetBestSize() const; | |
85 | ||
20e05ffb RR |
86 | private: |
87 | DECLARE_DYNAMIC_CLASS(wxScrollBar) | |
c801d85f KB |
88 | }; |
89 | ||
90 | #endif | |
91 | // __GTKSCROLLBARH__ |