]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/scrolbar.h
Added --with-wave/--without-wave for conditional wxWave support.
[wxWidgets.git] / include / wx / gtk1 / scrolbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: scrolbar.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
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"
19 #include "wx/object.h"
20 #include "wx/control.h"
21
22 //-----------------------------------------------------------------------------
23 // classes
24 //-----------------------------------------------------------------------------
25
26 class wxScrollBar;
27
28 //-----------------------------------------------------------------------------
29 // global data
30 //-----------------------------------------------------------------------------
31
32 extern const char *wxScrollBarNameStr;
33
34 //-----------------------------------------------------------------------------
35 // wxScrollBar
36 //-----------------------------------------------------------------------------
37
38 class wxScrollBar: public wxControl
39 {
40 DECLARE_DYNAMIC_CLASS(wxScrollBar)
41
42 public:
43
44 wxScrollBar(void) { m_adjust = (GtkAdjustment *) NULL; m_oldPos = 0.0; };
45 inline wxScrollBar( wxWindow *parent, wxWindowID id,
46 const wxPoint& pos = wxDefaultPosition,
47 const wxSize& size = wxDefaultSize,
48 long style = wxSB_HORIZONTAL,
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,
55 const wxPoint& pos = wxDefaultPosition,
56 const wxSize& size = wxDefaultSize,
57 long style = wxSB_HORIZONTAL,
58 const wxValidator& validator = wxDefaultValidator,
59 const wxString& name = wxScrollBarNameStr );
60 ~wxScrollBar(void);
61 int GetThumbPosition(void) const;
62 int GetThumbSize() const;
63 int GetPageSize() const;
64 int GetRange() const;
65 virtual void SetThumbPosition( int viewStart );
66 virtual void SetScrollbar( int position, int thumbSize, int range, int pageSize,
67 bool refresh = TRUE );
68
69 // Backward compatibility
70
71 int GetValue(void) const;
72 void SetValue( int viewStart );
73 void GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength) const;
74 int GetViewLength() const;
75 int GetObjectLength() const;
76 void SetPageSize( int pageLength );
77 void SetObjectLength( int objectLength );
78 void SetViewLength( int viewLength );
79
80 // implementation
81
82 bool IsOwnGtkWindow( GdkWindow *window );
83 void ApplyWidgetStyle();
84
85 GtkAdjustment *m_adjust;
86 float m_oldPos;
87 };
88
89 #endif
90 // __GTKSCROLLBARH__