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