1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk1/scrolbar.h
4 // Author: Robert Roebling
5 // Copyright: (c) 1998 Robert Roebling
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
9 #ifndef __GTKSCROLLBARH__
10 #define __GTKSCROLLBARH__
14 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
18 class WXDLLIMPEXP_FWD_CORE wxScrollBar
;
20 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
24 class WXDLLIMPEXP_CORE wxScrollBar
: public wxScrollBarBase
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
)
36 Create( parent
, id
, pos
, size
, style
, validator
, name
);
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;
49 virtual void SetThumbPosition( int viewStart
);
50 virtual void SetScrollbar( int position
, int thumbSize
, int range
, int pageSize
,
51 bool refresh
= TRUE
);
53 // Backward compatibility
54 // ----------------------
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
);
65 static wxVisualAttributes
66 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
71 bool IsOwnGtkWindow( GdkWindow
*window
);
73 GtkAdjustment
*m_adjust
;
77 virtual wxSize
DoGetBestSize() const;
80 DECLARE_DYNAMIC_CLASS(wxScrollBar
)