]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/scrolbar.h
wxClipboard::IsOpened() and wxCLipboardLocker helper class added
[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
20 #if wxUSE_SCROLLBAR
21
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 {
43 DECLARE_DYNAMIC_CLASS(wxScrollBar)
44
45 public:
46
47 wxScrollBar(void) { m_adjust = (GtkAdjustment *) NULL; m_oldPos = 0.0; };
48 inline wxScrollBar( wxWindow *parent, wxWindowID id,
49 const wxPoint& pos = wxDefaultPosition,
50 const wxSize& size = wxDefaultSize,
51 long style = wxSB_HORIZONTAL,
52 const wxValidator& validator = wxDefaultValidator,
53 const wxString& name = wxScrollBarNameStr )
54 {
55 Create( parent, id, pos, size, style, validator, name );
56 }
57 bool Create( wxWindow *parent, wxWindowID id,
58 const wxPoint& pos = wxDefaultPosition,
59 const wxSize& size = wxDefaultSize,
60 long style = wxSB_HORIZONTAL,
61 const wxValidator& validator = wxDefaultValidator,
62 const wxString& name = wxScrollBarNameStr );
63 ~wxScrollBar(void);
64 int GetThumbPosition(void) const;
65 int GetThumbSize() const;
66 int GetPageSize() const;
67 int GetRange() const;
68 virtual void SetThumbPosition( int viewStart );
69 virtual void SetScrollbar( int position, int thumbSize, int range, int pageSize,
70 bool refresh = TRUE );
71
72 // Backward compatibility
73
74 int GetValue(void) const;
75 void SetValue( int viewStart );
76 void GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength) const;
77 int GetViewLength() const;
78 int GetObjectLength() const;
79 void SetPageSize( int pageLength );
80 void SetObjectLength( int objectLength );
81 void SetViewLength( int viewLength );
82
83 // implementation
84
85 bool IsOwnGtkWindow( GdkWindow *window );
86 void ApplyWidgetStyle();
87
88 GtkAdjustment *m_adjust;
89 float m_oldPos;
90 };
91
92 #endif
93
94 #endif
95 // __GTKSCROLLBARH__