]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/scrolbar.h
No real changes, just make wxWindow::CanScroll() virtual.
[wxWidgets.git] / include / wx / gtk1 / scrolbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk1/scrolbar.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Copyright: (c) 1998 Robert Roebling
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
8
9 #ifndef __GTKSCROLLBARH__
10 #define __GTKSCROLLBARH__
11
12 #include "wx/defs.h"
13
14 //-----------------------------------------------------------------------------
15 // classes
16 //-----------------------------------------------------------------------------
17
18 class WXDLLIMPEXP_FWD_CORE wxScrollBar;
19
20 //-----------------------------------------------------------------------------
21 // wxScrollBar
22 //-----------------------------------------------------------------------------
23
24 class WXDLLIMPEXP_CORE wxScrollBar: public wxScrollBarBase
25 {
26 public:
27 wxScrollBar()
28 { m_adjust = NULL; m_oldPos = 0.0; }
29 inline wxScrollBar( wxWindow *parent, wxWindowID id,
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize,
32 long style = wxSB_HORIZONTAL,
33 const wxValidator& validator = wxDefaultValidator,
34 const wxString& name = wxScrollBarNameStr )
35 {
36 Create( parent, id, pos, size, style, validator, name );
37 }
38 bool Create( wxWindow *parent, wxWindowID id,
39 const wxPoint& pos = wxDefaultPosition,
40 const wxSize& size = wxDefaultSize,
41 long style = wxSB_HORIZONTAL,
42 const wxValidator& validator = wxDefaultValidator,
43 const wxString& name = wxScrollBarNameStr );
44 virtual ~wxScrollBar();
45 int GetThumbPosition() const;
46 int GetThumbSize() const;
47 int GetPageSize() const;
48 int GetRange() const;
49 virtual void SetThumbPosition( int viewStart );
50 virtual void SetScrollbar( int position, int thumbSize, int range, int pageSize,
51 bool refresh = TRUE );
52
53 // Backward compatibility
54 // ----------------------
55
56 int GetValue(void) const;
57 void SetValue( int viewStart );
58 void GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength) const;
59 int GetViewLength() const;
60 int GetObjectLength() const;
61 void SetPageSize( int pageLength );
62 void SetObjectLength( int objectLength );
63 void SetViewLength( int viewLength );
64
65 static wxVisualAttributes
66 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
67
68 // implementation
69 // --------------
70
71 bool IsOwnGtkWindow( GdkWindow *window );
72
73 GtkAdjustment *m_adjust;
74 float m_oldPos;
75
76 protected:
77 virtual wxSize DoGetBestSize() const;
78
79 private:
80 DECLARE_DYNAMIC_CLASS(wxScrollBar)
81 };
82
83 #endif
84 // __GTKSCROLLBARH__