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