1998-05-20 10:25:30 -04:00
|
|
|
\section{\class{wxScrolledWindow}}\label{wxscrolledwindow}
|
|
|
|
|
|
|
|
The wxScrolledWindow class manages scrolling for its client area, transforming
|
|
|
|
the coordinates according to the scrollbar positions, and setting the
|
|
|
|
scroll positions, thumb sizes and ranges according to the area in view.
|
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
Starting from version 2.4 of wxWindows, there are several ways to use a
|
|
|
|
wxScrolledWindow. In particular, there are now three ways to set the
|
|
|
|
size of the scrolling area:
|
|
|
|
|
|
|
|
One way is to set the scrollbars directly using a call to
|
|
|
|
\helpref{wxScrolledWindow::SetScrollbars}{wxscrolledwindowsetscrollbars}.
|
|
|
|
This is the way it used to be in any previous version of wxWindows
|
|
|
|
and it will be kept for backwards compatibility.
|
|
|
|
|
|
|
|
An additional method of manual control, which requires a little less
|
|
|
|
computation of your own, is to set the total size of the scrolling area by
|
|
|
|
calling either \helpref{wxWindow::SetVirtualSize}{wxwindowsetvirtualsize},
|
|
|
|
or \helpref{wxWindow::FitInside}{wxwindowfitinside}, and setting the
|
2002-12-28 13:42:23 -05:00
|
|
|
scrolling increments for it by calling
|
2002-12-04 09:11:26 -05:00
|
|
|
\helpref{wxScrolledWindow::SetScrollRate}{wxscrolledwindowsetscrollrate}.
|
|
|
|
Scrolling in some orientation is enabled by setting a non zero increment
|
|
|
|
for it.
|
|
|
|
|
|
|
|
The most automatic and newest way is to simply let sizers determine the
|
|
|
|
scrolling area. This is now the default when you set an interior sizer
|
|
|
|
into a wxScrolledWindow with \helpref{wxWindow::SetSizer}{wxwindowsetsizer}.
|
|
|
|
The scrolling area will be set to the size requested by the sizer and
|
|
|
|
the scrollbars will be assigned for each orientation according to the need
|
|
|
|
for them and the scrolling increment set by
|
|
|
|
\helpref{wxScrolledWindow::SetScrollRate}{wxscrolledwindowsetscrollrate}.
|
|
|
|
As above, scrolling is only enabled in orientations with a non-zero
|
|
|
|
increment. You can influence the minimum size of the scrolled area
|
|
|
|
controlled by a sizer by calling
|
|
|
|
\helpref{wxWindow::SetVirtualSizeHints}{wxwindowsetvirtualsizehints}.
|
|
|
|
(calling \helpref{wxScrolledWindow::SetScrollbars}{wxscrolledwindowsetscrollbars}
|
|
|
|
has analogous effects in wxWindows 2.4 -- in later versions it may not continue
|
|
|
|
to override the sizer)
|
|
|
|
|
|
|
|
Note: if Maximum size hints are still supported by SetVirtualSizeHints, use
|
|
|
|
them at your own dire risk. They may or may not have been removed for 2.4,
|
|
|
|
but it really only makes sense to set minimum size hints here. We should
|
|
|
|
probably replace SetVirtualSizeHints with SetMinVirtualSize or similar
|
|
|
|
and remove it entirely in future.
|
|
|
|
|
|
|
|
As with all windows, an application can draw onto a wxScrolledWindow using
|
|
|
|
a \helpref{device context}{dcoverview}.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1999-08-05 11:51:32 -04:00
|
|
|
You have the option of handling the OnPaint handler
|
1998-05-20 10:25:30 -04:00
|
|
|
or overriding the \helpref{OnDraw}{wxscrolledwindowondraw} function, which is passed
|
|
|
|
a pre-scrolled device context (prepared by \helpref{PrepareDC}{wxscrolledwindowpreparedc}).
|
|
|
|
|
|
|
|
If you don't wish to calculate your own scrolling, you must call PrepareDC when not drawing from
|
|
|
|
within OnDraw, to set the device origin for the device context according to the current
|
|
|
|
scroll position.
|
|
|
|
|
1999-10-17 06:22:45 -04:00
|
|
|
A wxScrolledWindow will normally scroll itself and therefore its child windows as well. It
|
|
|
|
might however be desired to scroll a different window than itself: e.g. when designing a
|
2000-07-15 15:51:35 -04:00
|
|
|
spreadsheet, you will normally only have to scroll the (usually white) cell area, whereas the
|
1999-10-17 06:22:45 -04:00
|
|
|
(usually grey) label area will scroll very differently. For this special purpose, you can
|
|
|
|
call \helpref{SetTargetWindow}{wxscrolledwindowsettargetwindow} which means that pressing
|
|
|
|
the scrollbars will scroll a different window.
|
|
|
|
|
1999-10-11 06:48:43 -04:00
|
|
|
Note that the underlying system knows nothing about scrolling coordinates, so that all system
|
1999-10-29 18:16:53 -04:00
|
|
|
functions (mouse events, expose events, refresh calls etc) as well as the position of subwindows
|
1999-10-11 06:48:43 -04:00
|
|
|
are relative to the "physical" origin of the scrolled window. If the user insert a child window at
|
|
|
|
position (10,10) and scrolls the window down 100 pixels (moving the child window out of the visible
|
|
|
|
area), the child window will report a position of (10,-90).
|
|
|
|
|
1999-10-17 06:22:45 -04:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{Derived from}
|
|
|
|
|
1999-08-12 15:24:39 -04:00
|
|
|
\helpref{wxPanel}{wxpanel}\\
|
1998-05-20 10:25:30 -04:00
|
|
|
\helpref{wxWindow}{wxwindow}\\
|
|
|
|
\helpref{wxEvtHandler}{wxevthandler}\\
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/scrolwin.h>
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{Window styles}
|
|
|
|
|
|
|
|
\twocolwidtha{5cm}
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
|
|
|
\twocolitem{\windowstyle{wxRETAINED}}{Uses a backing pixmap to speed refreshes. Motif only.}
|
|
|
|
\end{twocollist}
|
|
|
|
|
|
|
|
See also \helpref{window styles overview}{windowstyles}.
|
|
|
|
|
|
|
|
\wxheading{Remarks}
|
|
|
|
|
|
|
|
Use wxScrolledWindow for applications where the user scrolls by a fixed amount, and
|
|
|
|
where a `page' can be interpreted to be the current visible portion of the window. For
|
|
|
|
more sophisticated applications, use the wxScrolledWindow implementation as a guide
|
|
|
|
to build your own scroll behaviour.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
2003-05-30 17:08:31 -04:00
|
|
|
\helpref{wxScrollBar}{wxscrollbar}, \helpref{wxClientDC}{wxclientdc},\\
|
|
|
|
\helpref{wxPaintDC}{wxpaintdc}, \helpref{wxVScrolledWindow}{wxvscrolledwindow}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
\membersection{wxScrolledWindow::wxScrolledWindow}\label{wxscrolledwindowconstr}
|
|
|
|
|
|
|
|
\func{}{wxScrolledWindow}{\void}
|
|
|
|
|
|
|
|
Default constructor.
|
|
|
|
|
1998-06-14 08:11:50 -04:00
|
|
|
\func{}{wxScrolledWindow}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id = -1},\rtfsp
|
1998-05-20 10:25:30 -04:00
|
|
|
\param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
1998-06-14 08:11:50 -04:00
|
|
|
\param{long}{ style = wxHSCROLL \pipe wxVSCROLL}, \param{const wxString\& }{name = ``scrolledWindow"}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Constructor.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{parent}{Parent window.}
|
|
|
|
|
|
|
|
\docparam{id}{Window identifier. A value of -1 indicates a default value.}
|
|
|
|
|
|
|
|
\docparam{pos}{Window position. If a position of (-1, -1) is specified then a default position
|
|
|
|
is chosen.}
|
|
|
|
|
|
|
|
\docparam{size}{Window size. If a size of (-1, -1) is specified then the window is sized
|
|
|
|
appropriately.}
|
|
|
|
|
|
|
|
\docparam{style}{Window style. See \helpref{wxScrolledWindow}{wxscrolledwindow}.}
|
|
|
|
|
|
|
|
\docparam{name}{Window name.}
|
|
|
|
|
|
|
|
\wxheading{Remarks}
|
|
|
|
|
|
|
|
The window is initially created without visible scrollbars.
|
|
|
|
Call \helpref{wxScrolledWindow::SetScrollbars}{wxscrolledwindowsetscrollbars} to
|
|
|
|
specify how big the virtual window size should be.
|
|
|
|
|
|
|
|
\membersection{wxScrolledWindow::\destruct{wxScrolledWindow}}
|
|
|
|
|
|
|
|
\func{}{\destruct{wxScrolledWindow}}{\void}
|
|
|
|
|
|
|
|
Destructor.
|
|
|
|
|
1999-07-05 17:09:00 -04:00
|
|
|
\membersection{wxScrolledWindow::CalcScrolledPosition}\label{wxscrolledwindowcalcscrolledposition}
|
|
|
|
|
|
|
|
\constfunc{void}{CalcScrolledPosition}{
|
|
|
|
\param{int }{x},
|
|
|
|
\param{int }{y},
|
|
|
|
\param{int *}{xx}
|
|
|
|
\param{int *}{yy}}
|
|
|
|
|
|
|
|
Translates the logical coordinates to the device ones. For example, if a window is
|
|
|
|
scrolled 10 pixels to the bottom, the device coordinates of the origin are (0, 0)
|
|
|
|
(as always), but the logical coordinates are (0, 10) and so the call to
|
2001-08-20 09:18:52 -04:00
|
|
|
CalcScrolledPosition(0, 10, \&xx, \&yy) will return 0 in yy.
|
1999-07-05 17:09:00 -04:00
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{CalcUnscrolledPosition}{wxscrolledwindowcalcunscrolledposition}
|
|
|
|
|
1999-10-29 18:16:53 -04:00
|
|
|
\pythonnote{The wxPython version of this methods accepts only two
|
|
|
|
parameters and returns xx and yy as a tuple of values.}
|
|
|
|
|
2000-12-20 11:10:46 -05:00
|
|
|
\perlnote{In wxPerl this method takes two parameters and returns a
|
|
|
|
2-element list {\tt ( xx, yy )}.}
|
|
|
|
|
1999-07-05 17:09:00 -04:00
|
|
|
\membersection{wxScrolledWindow::CalcUnscrolledPosition}\label{wxscrolledwindowcalcunscrolledposition}
|
|
|
|
|
|
|
|
\constfunc{void}{CalcUnscrolledPosition}{
|
|
|
|
\param{int }{x},
|
|
|
|
\param{int }{y},
|
|
|
|
\param{int *}{xx}
|
|
|
|
\param{int *}{yy}}
|
|
|
|
|
|
|
|
Translates the device coordinates to the logical ones. For example, if a window is
|
|
|
|
scrolled 10 pixels to the bottom, the device coordinates of the origin are (0, 0)
|
|
|
|
(as always), but the logical coordinates are (0, 10) and so the call to
|
2001-08-20 09:18:52 -04:00
|
|
|
CalcUnscrolledPosition(0, 0, \&xx, \&yy) will return 10 in yy.
|
1999-07-05 17:09:00 -04:00
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{CalcScrolledPosition}{wxscrolledwindowcalcscrolledposition}
|
|
|
|
|
1999-10-29 18:16:53 -04:00
|
|
|
\pythonnote{The wxPython version of this methods accepts only two
|
|
|
|
parameters and returns xx and yy as a tuple of values.}
|
|
|
|
|
2000-12-20 11:10:46 -05:00
|
|
|
\perlnote{In wxPerl this method takes two parameters and returns a
|
|
|
|
2-element list {\tt ( xx, yy )}.}
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxScrolledWindow::Create}\label{wxscrolledwindowcreate}
|
|
|
|
|
1998-06-14 08:11:50 -04:00
|
|
|
\func{bool}{Create}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id = -1},\rtfsp
|
1998-05-20 10:25:30 -04:00
|
|
|
\param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
1998-06-14 08:11:50 -04:00
|
|
|
\param{long}{ style = wxHSCROLL \pipe wxVSCROLL}, \param{const wxString\& }{name = ``scrolledWindow"}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Creates the window for two-step construction. Derived classes
|
|
|
|
should call or replace this function. See \helpref{wxScrolledWindow::wxScrolledWindow}{wxscrolledwindowconstr}\rtfsp
|
|
|
|
for details.
|
|
|
|
|
|
|
|
\membersection{wxScrolledWindow::EnableScrolling}\label{wxscrolledwindowenablescrolling}
|
|
|
|
|
|
|
|
\func{void}{EnableScrolling}{\param{const bool}{ xScrolling}, \param{const bool}{ yScrolling}}
|
|
|
|
|
|
|
|
Enable or disable physical scrolling in the given direction. Physical
|
|
|
|
scrolling is the physical transfer of bits up or down the
|
|
|
|
screen when a scroll event occurs. If the application scrolls by a
|
|
|
|
variable amount (e.g. if there are different font sizes) then physical
|
1999-10-11 06:48:43 -04:00
|
|
|
scrolling will not work, and you should switch it off. Note that you
|
|
|
|
will have to reposition child windows yourself, if physical scrolling
|
|
|
|
is disabled.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\docparam{xScrolling}{If true, enables physical scrolling in the x direction.}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\docparam{yScrolling}{If true, enables physical scrolling in the y direction.}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\wxheading{Remarks}
|
|
|
|
|
|
|
|
Physical scrolling may not be available on all platforms. Where it is available, it is enabled
|
|
|
|
by default.
|
|
|
|
|
|
|
|
\membersection{wxScrolledWindow::GetScrollPixelsPerUnit}\label{wxscrolledwindowgetscrollpixelsperunit}
|
|
|
|
|
|
|
|
\constfunc{void}{GetScrollPixelsPerUnit}{\param{int* }{xUnit}, \param{int* }{yUnit}}
|
|
|
|
|
|
|
|
Get the number of pixels per scroll unit (line), in each direction, as set
|
|
|
|
by \helpref{wxScrolledWindow::SetScrollbars}{wxscrolledwindowsetscrollbars}. A value of zero indicates no
|
|
|
|
scrolling in that direction.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{xUnit}{Receives the number of pixels per horizontal unit.}
|
|
|
|
|
|
|
|
\docparam{yUnit}{Receives the number of pixels per vertical unit.}
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxScrolledWindow::SetScrollbars}{wxscrolledwindowsetscrollbars},\rtfsp
|
1998-07-31 05:33:36 -04:00
|
|
|
\helpref{wxScrolledWindow::GetVirtualSize}{wxscrolledwindowgetvirtualsize}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1999-10-29 18:16:53 -04:00
|
|
|
\pythonnote{The wxPython version of this methods accepts no
|
|
|
|
parameters and returns a tuple of values for xUnit and yUnit.}
|
|
|
|
|
2000-12-20 11:10:46 -05:00
|
|
|
\perlnote{In wxPerl this method takes no parameters and returns a
|
|
|
|
2-element list {\tt ( xUnit, yUnit )}.}
|
1999-10-29 18:16:53 -04:00
|
|
|
|
2002-05-05 05:35:44 -04:00
|
|
|
\membersection{wxScrolledWindow::GetViewStart}\label{wxscrolledwindowgetviewstart}
|
|
|
|
|
|
|
|
\constfunc{void}{GetViewStart}{\param{int* }{x}, \param{int* }{ y}}
|
|
|
|
|
|
|
|
Get the position at which the visible portion of the window starts.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{x}{Receives the first visible x position in scroll units.}
|
|
|
|
|
|
|
|
\docparam{y}{Receives the first visible y position in scroll units.}
|
|
|
|
|
|
|
|
\wxheading{Remarks}
|
|
|
|
|
|
|
|
If either of the scrollbars is not at the home position, {\it x} and/or
|
|
|
|
\rtfsp{\it y} will be greater than zero. Combined with \helpref{wxWindow::GetClientSize}{wxwindowgetclientsize},
|
|
|
|
the application can use this function to efficiently redraw only the
|
|
|
|
visible portion of the window. The positions are in logical scroll
|
|
|
|
units, not pixels, so to convert to pixels you will have to multiply
|
|
|
|
by the number of pixels per scroll increment.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxScrolledWindow::SetScrollbars}{wxscrolledwindowsetscrollbars}
|
|
|
|
|
|
|
|
\pythonnote{The wxPython version of this methods accepts no
|
|
|
|
parameters and returns a tuple of values for x and y.}
|
|
|
|
|
|
|
|
\perlnote{In wxPerl this method takes no parameters and returns a
|
|
|
|
2-element list {\tt ( x, y )}.}
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxScrolledWindow::GetVirtualSize}\label{wxscrolledwindowgetvirtualsize}
|
|
|
|
|
|
|
|
\constfunc{void}{GetVirtualSize}{\param{int* }{x}, \param{int* }{y}}
|
|
|
|
|
|
|
|
Gets the size in device units of the scrollable window area (as
|
|
|
|
opposed to the client size, which is the area of the window currently
|
|
|
|
visible).
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{x}{Receives the length of the scrollable window, in pixels.}
|
|
|
|
|
|
|
|
\docparam{y}{Receives the height of the scrollable window, in pixels.}
|
|
|
|
|
|
|
|
\wxheading{Remarks}
|
|
|
|
|
|
|
|
Use \helpref{wxDC::DeviceToLogicalX}{wxdcdevicetologicalx} and \helpref{wxDC::DeviceToLogicalY}{wxdcdevicetologicaly}\rtfsp
|
|
|
|
to translate these units to logical units.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxScrolledWindow::SetScrollbars}{wxscrolledwindowsetscrollbars},\rtfsp
|
1998-07-31 05:33:36 -04:00
|
|
|
\helpref{wxScrolledWindow::GetScrollPixelsPerUnit}{wxscrolledwindowgetscrollpixelsperunit}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1999-10-29 18:16:53 -04:00
|
|
|
\pythonnote{The wxPython version of this methods accepts no
|
|
|
|
parameters and returns a tuple of values for x and y.}
|
|
|
|
|
2000-12-20 11:10:46 -05:00
|
|
|
\perlnote{In wxPerl this method takes no parameters and returns a
|
|
|
|
2-element list {\tt ( x, y )}.}
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxScrolledWindow::IsRetained}\label{wxscrolledwindowisretained}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsRetained}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Motif only: true if the window has a backing bitmap.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxScrolledWindow::PrepareDC}\label{wxscrolledwindowpreparedc}
|
|
|
|
|
|
|
|
\func{void}{PrepareDC}{\param{wxDC\& }{dc}}
|
|
|
|
|
|
|
|
Call this function to prepare the device context for drawing a scrolled image. It
|
|
|
|
sets the device origin according to the current scroll position.
|
|
|
|
|
1999-08-05 11:51:32 -04:00
|
|
|
PrepareDC is called automatically within the default wxScrolledWindow::OnPaint event
|
1998-05-20 10:25:30 -04:00
|
|
|
handler, so your \helpref{wxScrolledWindow::OnDraw}{wxscrolledwindowondraw} override
|
|
|
|
will be passed a 'pre-scrolled' device context. However, if you wish to draw from
|
|
|
|
outside of OnDraw (via OnPaint), or you wish to implement OnPaint yourself, you must
|
|
|
|
call this function yourself. For example:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
1998-06-14 16:48:39 -04:00
|
|
|
void MyWindow::OnEvent(wxMouseEvent& event)
|
1998-05-20 10:25:30 -04:00
|
|
|
{
|
|
|
|
wxClientDC dc(this);
|
|
|
|
PrepareDC(dc);
|
|
|
|
|
|
|
|
dc.SetPen(*wxBLACK_PEN);
|
|
|
|
float x, y;
|
|
|
|
event.Position(&x, &y);
|
|
|
|
if (xpos > -1 && ypos > -1 && event.Dragging())
|
|
|
|
{
|
|
|
|
dc.DrawLine(xpos, ypos, x, y);
|
|
|
|
}
|
|
|
|
xpos = x;
|
|
|
|
ypos = y;
|
|
|
|
}
|
|
|
|
\end{verbatim}
|
|
|
|
|
|
|
|
\membersection{wxScrolledWindow::OnDraw}\label{wxscrolledwindowondraw}
|
|
|
|
|
|
|
|
\func{virtual void}{OnDraw}{\param{wxDC\& }{dc}}
|
|
|
|
|
1999-07-05 17:09:00 -04:00
|
|
|
Called by the default paint event handler to allow the application to define
|
1999-10-29 18:16:53 -04:00
|
|
|
painting behaviour without having to worry about calling
|
1999-07-05 17:09:00 -04:00
|
|
|
\helpref{wxScrolledWindow::PrepareDC}{wxscrolledwindowpreparedc}.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1999-07-05 17:09:00 -04:00
|
|
|
Instead of overriding this function you may also just process the paint event
|
|
|
|
in the derived class as usual, but then you will have to call PrepareDC()
|
|
|
|
yourself.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxScrolledWindow::Scroll}\label{wxscrolledwindowscroll}
|
|
|
|
|
|
|
|
\func{void}{Scroll}{\param{int}{ x}, \param{int}{ y}}
|
|
|
|
|
|
|
|
Scrolls a window so the view start is at the given point.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{x}{The x position to scroll to, in scroll units.}
|
|
|
|
|
|
|
|
\docparam{y}{The y position to scroll to, in scroll units.}
|
|
|
|
|
|
|
|
\wxheading{Remarks}
|
|
|
|
|
|
|
|
The positions are in scroll units, not pixels, so to convert to pixels you
|
|
|
|
will have to multiply by the number of pixels per scroll increment.
|
|
|
|
If either parameter is -1, that position will be ignored (no change in
|
|
|
|
that direction).
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxScrolledWindow::SetScrollbars}{wxscrolledwindowsetscrollbars},\rtfsp
|
|
|
|
\helpref{wxScrolledWindow::GetScrollPixelsPerUnit}{wxscrolledwindowgetscrollpixelsperunit}
|
|
|
|
|
|
|
|
\membersection{wxScrolledWindow::SetScrollbars}\label{wxscrolledwindowsetscrollbars}
|
|
|
|
|
|
|
|
\func{void}{SetScrollbars}{\param{int}{ pixelsPerUnitX}, \param{int}{ pixelsPerUnitY},\rtfsp
|
|
|
|
\param{int}{ noUnitsX}, \param{int}{ noUnitsY},\rtfsp
|
2000-01-26 19:03:32 -05:00
|
|
|
\param{int }{xPos = 0}, \param{int}{ yPos = 0},\rtfsp
|
2003-01-17 19:16:34 -05:00
|
|
|
\param{bool }{noRefresh = false}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Sets up vertical and/or horizontal scrollbars.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{pixelsPerUnitX}{Pixels per scroll unit in the horizontal direction.}
|
|
|
|
|
|
|
|
\docparam{pixelsPerUnitY}{Pixels per scroll unit in the vertical direction.}
|
|
|
|
|
|
|
|
\docparam{noUnitsX}{Number of units in the horizontal direction.}
|
|
|
|
|
|
|
|
\docparam{noUnitsY}{Number of units in the vertical direction.}
|
|
|
|
|
|
|
|
\docparam{xPos}{Position to initialize the scrollbars in the horizontal direction, in scroll units.}
|
|
|
|
|
|
|
|
\docparam{yPos}{Position to initialize the scrollbars in the vertical direction, in scroll units.}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\docparam{noRefresh}{Will not refresh window if true.}
|
2000-01-26 19:03:32 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{Remarks}
|
|
|
|
|
|
|
|
The first pair of parameters give the number of pixels per `scroll step', i.e. amount
|
|
|
|
moved when the up or down scroll arrows are pressed.
|
|
|
|
The second pair gives the length of scrollbar in scroll steps, which sets the size of the virtual
|
|
|
|
window.
|
|
|
|
|
|
|
|
{\it xPos} and {\it yPos} optionally specify a position to scroll to immediately.
|
|
|
|
|
|
|
|
For example, the following gives a window horizontal and vertical
|
|
|
|
scrollbars with 20 pixels per scroll step, and a size of 50 steps (1000
|
|
|
|
pixels) in each direction.
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
window->SetScrollbars(20, 20, 50, 50);
|
|
|
|
\end{verbatim}
|
|
|
|
|
|
|
|
wxScrolledWindow manages the page size itself,
|
|
|
|
using the current client window size as the page size.
|
|
|
|
|
|
|
|
Note that for more sophisticated scrolling applications, for example where
|
|
|
|
scroll steps may be variable according to the position in the document, it will be
|
|
|
|
necessary to derive a new class from wxWindow, overriding {\bf OnSize} and
|
|
|
|
adjusting the scrollbars appropriately.
|
|
|
|
|
2002-04-19 18:12:38 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxWindow::SetVirtualSize}{wxwindowsetvirtualsize}
|
|
|
|
|
|
|
|
\membersection{wxScrolledWindow::SetScrollRate}\label{wxscrolledwindowsetscrollrate}
|
|
|
|
|
2002-12-28 13:42:23 -05:00
|
|
|
\func{void}{SetScrollRate}{\param{int}{ xstep}, \param{int}{ ystep}}
|
2002-04-19 18:12:38 -04:00
|
|
|
|
2002-12-28 13:42:23 -05:00
|
|
|
Set the horizontal and vertical scrolling increment only. See the pixelsPerUnit
|
2002-04-19 18:12:38 -04:00
|
|
|
parameter in SetScrollbars.
|
|
|
|
|
1999-10-17 06:22:45 -04:00
|
|
|
\membersection{wxScrolledWindow::SetTargetWindow}\label{wxscrolledwindowsettargetwindow}
|
|
|
|
|
|
|
|
\func{void}{SetTargetWindow}{\param{wxWindow* }{window}}
|
|
|
|
|
2002-04-19 18:12:38 -04:00
|
|
|
Call this function to tell wxScrolledWindow to perform the actual scrolling on
|
2002-12-28 13:42:23 -05:00
|
|
|
a different window (and not on itself).
|
1999-10-17 06:22:45 -04:00
|
|
|
|