]>
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
36 Constructor, creating and showing a scrollbar.
39 Parent window. Must be non-@NULL.
41 Window identifier. The value wxID_ANY indicates a default value.
43 Window position. If wxDefaultPosition is specified then a default
46 Window size. If wxDefaultSize is specified then a default size
49 Window style. See wxScrollBar.
55 @see Create(), wxValidator
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");
67 Destructor, destroying the scrollbar.
72 Scrollbar creation function called by the scrollbar constructor.
73 See wxScrollBar() for details.
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");
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.
89 int GetPageSize() const;
92 Returns the length of the scrollbar.
99 Returns the current position of the scrollbar thumb.
101 @see SetThumbPosition()
103 int GetThumbPosition() const;
106 Returns the thumb or 'view' size.
110 int GetThumbSize() const;
113 Sets the scrollbar properties.
116 The position of the scrollbar in scroll units.
118 The size of the thumb, or visible portion of the scrollbar, in scroll units.
120 The maximum position of the scrollbar.
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
127 @true to redraw the scrollbar, @false otherwise.
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
133 virtual void SetScrollbar(int position
, int thumbSize
, int range
,
135 bool refresh
= true);
138 Sets the position of the scrollbar.
141 The position of the scrollbar thumb.
143 @see GetThumbPosition()
145 void SetThumbPosition(int viewStart
);