]>
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.
22 Specifies a vertical scrollbar.
27 <!-- @appearance{scrollbar.png} -->
29 @see @ref overview_scrolling, @ref overview_eventhandling, wxScrolled
31 class wxScrollBar
: public wxControl
40 Constructor, creating and showing a scrollbar.
43 Parent window. Must be non-@NULL.
45 Window identifier. The value wxID_ANY indicates a default value.
47 Window position. If wxDefaultPosition is specified then a default
50 Window size. If wxDefaultSize is specified then a default size
53 Window style. See wxScrollBar.
59 @see Create(), wxValidator
61 wxScrollBar(wxWindow
* parent
, wxWindowID id
,
62 const wxPoint
& pos
= wxDefaultPosition
,
63 const wxSize
& size
= wxDefaultSize
,
64 long style
= wxSB_HORIZONTAL
,
65 const wxValidator
& validator
= wxDefaultValidator
,
66 const wxString
& name
= "scrollBar");
69 Destructor, destroying the scrollbar.
74 Scrollbar creation function called by the scrollbar constructor.
75 See wxScrollBar() for details.
77 bool Create(wxWindow
* parent
, wxWindowID id
,
78 const wxPoint
& pos
= wxDefaultPosition
,
79 const wxSize
& size
= wxDefaultSize
,
80 long style
= wxSB_HORIZONTAL
,
81 const wxValidator
& validator
= wxDefaultValidator
,
82 const wxString
& name
= "scrollBar");
85 Returns the page size of the scrollbar. This is the number of scroll units
86 that will be scrolled when the user pages up or down. Often it is the
87 same as the thumb size.
91 int GetPageSize() const;
94 Returns the length of the scrollbar.
101 Returns the current position of the scrollbar thumb.
103 @see SetThumbPosition()
105 int GetThumbPosition() const;
108 Returns the thumb or 'view' size.
112 int GetThumbSize() const;
115 Sets the scrollbar properties.
118 The position of the scrollbar in scroll units.
120 The size of the thumb, or visible portion of the scrollbar, in scroll units.
122 The maximum position of the scrollbar.
124 The size of the page size in scroll units. This is the number of units
125 the scrollbar will scroll when it is paged up or down. Often it is the same
129 @true to redraw the scrollbar, @false otherwise.
131 @remarks Let's say you wish to display 50 lines of text, using the same
132 font. The window is sized so that you can only see 16
135 virtual void SetScrollbar(int position
, int thumbSize
, int range
,
137 bool refresh
= true);
140 Sets the position of the scrollbar.
143 The position of the scrollbar thumb.
145 @see GetThumbPosition()
147 void SetThumbPosition(int viewStart
);