2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: scrolbar.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxScrollBar
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxScrollBar
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00: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 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@beginStyleTable
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxSB_HORIZONTAL}
|
2008-03-08 13:52:38 +00:00
|
|
|
Specifies a horizontal scrollbar.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxSB_VERTICAL}
|
2008-03-08 13:52:38 +00:00
|
|
|
Specifies a vertical scrollbar.
|
|
|
|
@endStyleTable
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{ctrl}
|
2008-04-17 07:06:20 +00:00
|
|
|
<!-- @appearance{scrollbar.png} -->
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-17 07:06:20 +00:00
|
|
|
@see @ref overview_scrolling, @ref overview_eventhandling, wxScrolled
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxScrollBar : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
2008-05-29 14:10:52 +00:00
|
|
|
/**
|
|
|
|
Default constructor
|
|
|
|
*/
|
|
|
|
wxScrollBar();
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
Constructor, creating and showing a scrollbar.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param parent
|
2008-03-09 12:33:59 +00:00
|
|
|
Parent window. Must be non-@NULL.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-03-09 12:33:59 +00:00
|
|
|
Window identifier. The value wxID_ANY indicates a default value.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param pos
|
2008-03-09 12:33:59 +00:00
|
|
|
Window position. If wxDefaultPosition is specified then a default
|
|
|
|
position is chosen.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param size
|
2008-03-09 12:33:59 +00:00
|
|
|
Window size. If wxDefaultSize is specified then a default size
|
|
|
|
is chosen.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-03-09 12:33:59 +00:00
|
|
|
Window style. See wxScrollBar.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param validator
|
2008-03-09 12:33:59 +00:00
|
|
|
Window validator.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-03-09 12:33:59 +00:00
|
|
|
Window name.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see Create(), wxValidator
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-08 14:43:31 +00: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 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor, destroying the scrollbar.
|
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual ~wxScrollBar();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
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 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetScrollbar()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual int GetPageSize() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the length of the scrollbar.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetScrollbar()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual int GetRange() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the current position of the scrollbar thumb.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetThumbPosition()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual int GetThumbPosition() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the thumb or 'view' size.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetScrollbar()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual int GetThumbSize() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the scrollbar properties.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param position
|
2008-03-09 12:33:59 +00:00
|
|
|
The position of the scrollbar in scroll units.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param thumbSize
|
2008-03-09 12:33:59 +00:00
|
|
|
The size of the thumb, or visible portion of the scrollbar, in scroll units.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param range
|
2008-03-09 12:33:59 +00:00
|
|
|
The maximum position of the scrollbar.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param pageSize
|
2008-03-09 12:33:59 +00: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 14:43:31 +00:00
|
|
|
@param refresh
|
2008-03-09 12:33:59 +00:00
|
|
|
@true to redraw the scrollbar, @false otherwise.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@remarks Let's say you wish to display 50 lines of text, using the same
|
2008-03-09 12:33:59 +00:00
|
|
|
font. The window is sized so that you can only see 16
|
|
|
|
lines at a time.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
virtual void SetScrollbar(int position, int thumbSize, int range,
|
|
|
|
int pageSize,
|
2008-03-09 12:33:59 +00:00
|
|
|
bool refresh = true);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the position of the scrollbar.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param viewStart
|
2008-03-09 12:33:59 +00:00
|
|
|
The position of the scrollbar thumb.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see GetThumbPosition()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual void SetThumbPosition(int viewStart);
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|