1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxScrollBar base header
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_SCROLBAR_H_BASE_
13 #define _WX_SCROLBAR_H_BASE_
19 #include "wx/control.h"
21 extern WXDLLIMPEXP_DATA_CORE(const char) wxScrollBarNameStr
[];
23 // ----------------------------------------------------------------------------
24 // wxScrollBar: a scroll bar control
25 // ----------------------------------------------------------------------------
27 class WXDLLIMPEXP_CORE wxScrollBarBase
: public wxControl
33 Derived classes should provide the following method and ctor with the
36 bool Create(wxWindow *parent,
38 const wxPoint& pos = wxDefaultPosition,
39 const wxSize& size = wxDefaultSize,
40 long style = wxSB_HORIZONTAL,
41 const wxValidator& validator = wxDefaultValidator,
42 const wxString& name = wxScrollBarNameStr);
46 virtual int GetThumbPosition() const = 0;
47 virtual int GetThumbSize() const = 0;
48 virtual int GetPageSize() const = 0;
49 virtual int GetRange() const = 0;
51 bool IsVertical() const { return (m_windowStyle
& wxVERTICAL
) != 0; }
54 virtual void SetThumbPosition(int viewStart
) = 0;
55 virtual void SetScrollbar(int position
, int thumbSize
,
56 int range
, int pageSize
,
57 bool refresh
= true) = 0;
59 // implementation-only
60 bool IsNeeded() const { return GetRange() > GetThumbSize(); }
63 wxDECLARE_NO_COPY_CLASS(wxScrollBarBase
);
66 #if defined(__WXUNIVERSAL__)
67 #include "wx/univ/scrolbar.h"
68 #elif defined(__WXMSW__)
69 #include "wx/msw/scrolbar.h"
70 #elif defined(__WXMOTIF__)
71 #include "wx/motif/scrolbar.h"
72 #elif defined(__WXGTK20__)
73 #include "wx/gtk/scrolbar.h"
74 #elif defined(__WXGTK__)
75 #include "wx/gtk1/scrolbar.h"
76 #elif defined(__WXMAC__)
77 #include "wx/osx/scrolbar.h"
78 #elif defined(__WXCOCOA__)
79 #include "wx/cocoa/scrolbar.h"
80 #elif defined(__WXPM__)
81 #include "wx/os2/scrolbar.h"
84 #endif // wxUSE_SCROLLBAR
87 // _WX_SCROLBAR_H_BASE_