]>
git.saurik.com Git - wxWidgets.git/blob - interface/scrolbar.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxScrollBar
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}
29 @see @ref overview_scrollingoverview "Scrolling overview", @ref
30 overview_eventhandlingoverview, wxScrolledWindow
32 class wxScrollBar
: public wxControl
37 Constructor, creating and showing a scrollbar.
40 Parent window. Must be non-@NULL.
42 Window identifier. The value wxID_ANY indicates a default value.
44 Window position. If wxDefaultPosition is specified then a default
47 Window size. If wxDefaultSize is specified then a default size
50 Window style. See wxScrollBar.
56 @see Create(), wxValidator
59 wxScrollBar(wxWindow
* parent
, wxWindowID id
,
60 const wxPoint
& pos
= wxDefaultPosition
,
61 const wxSize
& size
= wxDefaultSize
,
62 long style
= wxSB_HORIZONTAL
,
63 const wxValidator
& validator
= wxDefaultValidator
,
64 const wxString
& name
= "scrollBar");
68 Destructor, destroying the scrollbar.
73 Scrollbar creation function called by the scrollbar constructor.
74 See wxScrollBar() for details.
76 bool Create(wxWindow
* parent
, wxWindowID id
,
77 const wxPoint
& pos
= wxDefaultPosition
,
78 const wxSize
& size
= wxDefaultSize
,
79 long style
= wxSB_HORIZONTAL
,
80 const wxValidator
& validator
= wxDefaultValidator
,
81 const wxString
& name
= "scrollBar");
84 Returns the page size of the scrollbar. This is the number of scroll units
85 that will be scrolled when the user pages up or down. Often it is the
86 same as the thumb size.
90 int GetPageSize() const;
93 Returns the length of the scrollbar.
100 Returns the current position of the scrollbar thumb.
102 @see SetThumbPosition()
104 int GetThumbPosition() const;
107 Returns the thumb or 'view' size.
111 int GetThumbSize() const;
114 Sets the scrollbar properties.
117 The position of the scrollbar in scroll units.
119 The size of the thumb, or visible portion of the scrollbar, in scroll units.
121 The maximum position of the scrollbar.
123 The size of the page size in scroll units. This is the number of units
124 the scrollbar will scroll when it is paged up or down. Often it is the same
128 @true to redraw the scrollbar, @false otherwise.
130 @remarks Let's say you wish to display 50 lines of text, using the same
131 font. The window is sized so that you can only see 16
134 virtual void SetScrollbar(int position
, int thumbSize
, int range
,
136 bool refresh
= true);
139 Sets the position of the scrollbar.
142 The position of the scrollbar thumb.
144 @see GetThumbPosition()
146 void SetThumbPosition(int viewStart
);