]> git.saurik.com Git - wxWidgets.git/blob - interface/scrolbar.h
Replaced @returns with @return for more standard command use and compatibility.
[wxWidgets.git] / interface / scrolbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: scrolbar.h
3 // Purpose: interface of wxScrollBar
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxScrollBar
11 @wxheader{scrolbar.h}
12
13 A wxScrollBar is a control that represents a horizontal or
14 vertical scrollbar. It is distinct from the two scrollbars that some windows
15 provide automatically, but the two types of scrollbar share the way
16 events are received.
17
18 @beginStyleTable
19 @style{wxSB_HORIZONTAL}
20 Specifies a horizontal scrollbar.
21 @style{wxSB_VERTICAL}
22 Specifies a vertical scrollbar.
23 @endStyleTable
24
25 @library{wxcore}
26 @category{ctrl}
27 <!-- @appearance{scrollbar.png} -->
28
29 @see @ref overview_scrolling, @ref overview_eventhandling, wxScrolled
30 */
31 class wxScrollBar : public wxControl
32 {
33 public:
34 //@{
35 /**
36 Constructor, creating and showing a scrollbar.
37
38 @param parent
39 Parent window. Must be non-@NULL.
40 @param id
41 Window identifier. The value wxID_ANY indicates a default value.
42 @param pos
43 Window position. If wxDefaultPosition is specified then a default
44 position is chosen.
45 @param size
46 Window size. If wxDefaultSize is specified then a default size
47 is chosen.
48 @param style
49 Window style. See wxScrollBar.
50 @param validator
51 Window validator.
52 @param name
53 Window name.
54
55 @see Create(), wxValidator
56 */
57 wxScrollBar();
58 wxScrollBar(wxWindow* parent, wxWindowID id,
59 const wxPoint& pos = wxDefaultPosition,
60 const wxSize& size = wxDefaultSize,
61 long style = wxSB_HORIZONTAL,
62 const wxValidator& validator = wxDefaultValidator,
63 const wxString& name = "scrollBar");
64 //@}
65
66 /**
67 Destructor, destroying the scrollbar.
68 */
69 ~wxScrollBar();
70
71 /**
72 Scrollbar creation function called by the scrollbar constructor.
73 See wxScrollBar() for details.
74 */
75 bool Create(wxWindow* parent, wxWindowID id,
76 const wxPoint& pos = wxDefaultPosition,
77 const wxSize& size = wxDefaultSize,
78 long style = wxSB_HORIZONTAL,
79 const wxValidator& validator = wxDefaultValidator,
80 const wxString& name = "scrollBar");
81
82 /**
83 Returns the page size of the scrollbar. This is the number of scroll units
84 that will be scrolled when the user pages up or down. Often it is the
85 same as the thumb size.
86
87 @see SetScrollbar()
88 */
89 int GetPageSize() const;
90
91 /**
92 Returns the length of the scrollbar.
93
94 @see SetScrollbar()
95 */
96 int GetRange() const;
97
98 /**
99 Returns the current position of the scrollbar thumb.
100
101 @see SetThumbPosition()
102 */
103 int GetThumbPosition() const;
104
105 /**
106 Returns the thumb or 'view' size.
107
108 @see SetScrollbar()
109 */
110 int GetThumbSize() const;
111
112 /**
113 Sets the scrollbar properties.
114
115 @param position
116 The position of the scrollbar in scroll units.
117 @param thumbSize
118 The size of the thumb, or visible portion of the scrollbar, in scroll units.
119 @param range
120 The maximum position of the scrollbar.
121 @param pageSize
122 The size of the page size in scroll units. This is the number of units
123 the scrollbar will scroll when it is paged up or down. Often it is the same
124 as
125 the thumb size.
126 @param refresh
127 @true to redraw the scrollbar, @false otherwise.
128
129 @remarks Let's say you wish to display 50 lines of text, using the same
130 font. The window is sized so that you can only see 16
131 lines at a time.
132 */
133 virtual void SetScrollbar(int position, int thumbSize, int range,
134 int pageSize,
135 bool refresh = true);
136
137 /**
138 Sets the position of the scrollbar.
139
140 @param viewStart
141 The position of the scrollbar thumb.
142
143 @see GetThumbPosition()
144 */
145 void SetThumbPosition(int viewStart);
146 };
147