2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: scrolbar.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxScrollBar
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxScrollBar
|
|
|
|
@wxheader{scrolbar.h}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
A wxScrollBar is a control that represents a horizontal or
|
|
|
|
vertical scrollbar. It is distinct from the two scrollbars that some windows
|
|
|
|
provide automatically, but the two types of scrollbar share the way
|
|
|
|
events are received.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@beginStyleTable
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSB_HORIZONTAL}
|
2008-03-08 08:52:38 -05:00
|
|
|
Specifies a horizontal scrollbar.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSB_VERTICAL}
|
2008-03-08 08:52:38 -05:00
|
|
|
Specifies a vertical scrollbar.
|
|
|
|
@endStyleTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{ctrl}
|
2008-04-17 03:06:20 -04:00
|
|
|
<!-- @appearance{scrollbar.png} -->
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-17 03:06:20 -04:00
|
|
|
@see @ref overview_scrolling, @ref overview_eventhandling, wxScrolled
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxScrollBar : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
2008-05-29 10:10:52 -04:00
|
|
|
/**
|
|
|
|
Default constructor
|
|
|
|
*/
|
|
|
|
wxScrollBar();
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Constructor, creating and showing a scrollbar.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
Parent window. Must be non-@NULL.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
Window identifier. The value wxID_ANY indicates a default value.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
Window position. If wxDefaultPosition is specified then a default
|
|
|
|
position is chosen.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2008-03-09 08:33:59 -04:00
|
|
|
Window size. If wxDefaultSize is specified then a default size
|
|
|
|
is chosen.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
Window style. See wxScrollBar.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param validator
|
2008-03-09 08:33:59 -04:00
|
|
|
Window validator.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
Window name.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see Create(), wxValidator
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxScrollBar(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSB_HORIZONTAL,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = "scrollBar");
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor, destroying the scrollbar.
|
|
|
|
*/
|
|
|
|
~wxScrollBar();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Scrollbar creation function called by the scrollbar constructor.
|
|
|
|
See wxScrollBar() for details.
|
|
|
|
*/
|
|
|
|
bool Create(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSB_HORIZONTAL,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = "scrollBar");
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the page size of the scrollbar. This is the number of scroll units
|
|
|
|
that will be scrolled when the user pages up or down. Often it is the
|
|
|
|
same as the thumb size.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetScrollbar()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetPageSize() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the length of the scrollbar.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetScrollbar()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetRange() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the current position of the scrollbar thumb.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetThumbPosition()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetThumbPosition() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the thumb or 'view' size.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetScrollbar()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetThumbSize() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the scrollbar properties.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param position
|
2008-03-09 08:33:59 -04:00
|
|
|
The position of the scrollbar in scroll units.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param thumbSize
|
2008-03-09 08:33:59 -04:00
|
|
|
The size of the thumb, or visible portion of the scrollbar, in scroll units.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param range
|
2008-03-09 08:33:59 -04:00
|
|
|
The maximum position of the scrollbar.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pageSize
|
2008-03-09 08:33:59 -04:00
|
|
|
The size of the page size in scroll units. This is the number of units
|
|
|
|
the scrollbar will scroll when it is paged up or down. Often it is the same
|
|
|
|
as
|
|
|
|
the thumb size.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param refresh
|
2008-03-09 08:33:59 -04:00
|
|
|
@true to redraw the scrollbar, @false otherwise.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks Let's say you wish to display 50 lines of text, using the same
|
2008-03-09 08:33:59 -04:00
|
|
|
font. The window is sized so that you can only see 16
|
|
|
|
lines at a time.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
virtual void SetScrollbar(int position, int thumbSize, int range,
|
|
|
|
int pageSize,
|
2008-03-09 08:33:59 -04:00
|
|
|
bool refresh = true);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the position of the scrollbar.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param viewStart
|
2008-03-09 08:33:59 -04:00
|
|
|
The position of the scrollbar thumb.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetThumbPosition()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetThumbPosition(int viewStart);
|
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|