]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/scrolbar.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / scrolbar.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/scrolbar.h
3// Purpose: wxScrollBar base header
4// Author: Julian Smart
5// Modified by:
6// Created:
7// Copyright: (c) Julian Smart
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_SCROLBAR_H_BASE_
12#define _WX_SCROLBAR_H_BASE_
13
14#include "wx/defs.h"
15
16#if wxUSE_SCROLLBAR
17
18#include "wx/control.h"
19
20extern WXDLLIMPEXP_DATA_CORE(const char) wxScrollBarNameStr[];
21
22// ----------------------------------------------------------------------------
23// wxScrollBar: a scroll bar control
24// ----------------------------------------------------------------------------
25
26class WXDLLIMPEXP_CORE wxScrollBarBase : public wxControl
27{
28public:
29 wxScrollBarBase() { }
30
31 /*
32 Derived classes should provide the following method and ctor with the
33 same parameters:
34
35 bool Create(wxWindow *parent,
36 wxWindowID id,
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);
42 */
43
44 // accessors
45 virtual int GetThumbPosition() const = 0;
46 virtual int GetThumbSize() const = 0;
47 virtual int GetPageSize() const = 0;
48 virtual int GetRange() const = 0;
49
50 bool IsVertical() const { return (m_windowStyle & wxVERTICAL) != 0; }
51
52 // operations
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;
57
58 // implementation-only
59 bool IsNeeded() const { return GetRange() > GetThumbSize(); }
60
61private:
62 wxDECLARE_NO_COPY_CLASS(wxScrollBarBase);
63};
64
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"
81#endif
82
83#endif // wxUSE_SCROLLBAR
84
85#endif
86 // _WX_SCROLBAR_H_BASE_