]>
git.saurik.com Git - wxWidgets.git/blob - interface/scrolbar.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxScrollBar class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
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
19 @style{wxSB_HORIZONTAL}:
20 Specifies a horizontal scrollbar.
21 @style{wxSB_VERTICAL}:
22 Specifies a vertical scrollbar.
27 @appearance{scrollbar.png}
30 @ref overview_scrollingoverview "Scrolling overview", @ref
31 overview_eventhandlingoverview "Event handling overview", wxScrolledWindow
33 class wxScrollBar
: public wxControl
38 Constructor, creating and showing a scrollbar.
41 Parent window. Must be non-@NULL.
44 Window identifier. The value wxID_ANY indicates a default value.
47 Window position. If wxDefaultPosition is specified then a default position
51 Window size. If wxDefaultSize is specified then a default size is
55 Window style. See wxScrollBar.
63 @sa Create(), wxValidator
66 wxScrollBar(wxWindow
* parent
, wxWindowID id
,
67 const wxPoint
& pos
= wxDefaultPosition
,
68 const wxSize
& size
= wxDefaultSize
,
69 long style
= wxSB_HORIZONTAL
,
70 const wxValidator
& validator
= wxDefaultValidator
,
71 const wxString
& name
= "scrollBar");
75 Destructor, destroying the scrollbar.
80 Scrollbar creation function called by the scrollbar constructor.
81 See wxScrollBar() for details.
83 bool Create(wxWindow
* parent
, wxWindowID id
,
84 const wxPoint
& pos
= wxDefaultPosition
,
85 const wxSize
& size
= wxDefaultSize
,
86 long style
= wxSB_HORIZONTAL
,
87 const wxValidator
& validator
= wxDefaultValidator
,
88 const wxString
& name
= "scrollBar");
91 Returns the page size of the scrollbar. This is the number of scroll units
92 that will be scrolled when the user pages up or down. Often it is the
93 same as the thumb size.
100 Returns the length of the scrollbar.
107 Returns the current position of the scrollbar thumb.
109 @sa SetThumbPosition()
111 int GetThumbPosition();
114 Returns the thumb or 'view' size.
121 Sets the scrollbar properties.
124 The position of the scrollbar in scroll units.
127 The size of the thumb, or visible portion of the scrollbar, in scroll units.
130 The maximum position of the scrollbar.
133 The size of the page size in scroll units. This is the number of units
134 the scrollbar will scroll when it is paged up or down. Often it is the same as
138 @true to redraw the scrollbar, @false otherwise.
140 @remarks Let's say you wish to display 50 lines of text, using the same
141 font. The window is sized so that you can only see 16
144 virtual void SetScrollbar(int position
, int thumbSize
, int range
,
146 bool refresh
= @
true);
149 Sets the position of the scrollbar.
152 The position of the scrollbar thumb.
154 @sa GetThumbPosition()
156 void SetThumbPosition(int viewStart
);