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