The great wxVScrolledWindow refactoring: allow using it both horizontal and
vertical directions (slightly modified patch 1671181) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45330 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -196,6 +196,7 @@
|
||||
\input hprovcnt.tex
|
||||
\input helpevt.tex
|
||||
\input helpprov.tex
|
||||
\input hscrolledwindow.tex
|
||||
\input htcell.tex
|
||||
\input htcolor.tex
|
||||
\input htcontnr.tex
|
||||
@@ -217,6 +218,7 @@
|
||||
\input htwinprs.tex
|
||||
\input htwinhnd.tex
|
||||
\input http.tex
|
||||
\input hvscrolledwindow.tex
|
||||
\input hyperlink.tex
|
||||
\input icon.tex
|
||||
\input iconbndl.tex
|
||||
@@ -294,6 +296,7 @@
|
||||
\input pickerbase.tex
|
||||
\input platinfo.tex
|
||||
\input point.tex
|
||||
\input position.tex
|
||||
\input postscpt.tex
|
||||
\input powerevt.tex
|
||||
\input prevwin.tex
|
||||
@@ -430,10 +433,14 @@
|
||||
\input url.tex
|
||||
\input urldataob.tex
|
||||
\input validatr.tex
|
||||
\input varhscrollhelper.tex
|
||||
\input varhvscrollhelper.tex
|
||||
\input variant.tex
|
||||
\input varscrollhelperbase.tex
|
||||
\input varvscrollhelper.tex
|
||||
\input view.tex
|
||||
\input vlbox.tex
|
||||
\input vscroll.tex
|
||||
\input vscrolledwindow.tex
|
||||
\input window.tex
|
||||
\input wupdlock.tex
|
||||
\input createevt.tex
|
||||
|
99
docs/latex/wx/hscrolledwindow.tex
Normal file
99
docs/latex/wx/hscrolledwindow.tex
Normal file
@@ -0,0 +1,99 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Name: hscrolledwindow.tex
|
||||
%% Purpose: wxHScrolledWindow Documentation
|
||||
%% Author: Bryan Petty
|
||||
%% Modified by:
|
||||
%% Created: 2007-04-04
|
||||
%% RCS-ID: $Id$
|
||||
%% Copyright: (c) 2007 wxWidgets Team
|
||||
%% License: wxWindows Licence
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\section{\class{wxHScrolledWindow}}\label{wxhscrolledwindow}
|
||||
|
||||
In the name of this class, "H" stands for "horizontal" because it can be
|
||||
used for scrolling columns of variable widths. It is not necessary to know
|
||||
the widths of all columns in advance -- only those which are shown on the
|
||||
screen need to be measured.
|
||||
|
||||
In any case, this is a generalization of the
|
||||
\helpref{wxScrolledWindow}{wxscrolledwindow} class which can be only used when
|
||||
all columns have the same widths. It lacks some other wxScrolledWindow features
|
||||
however, notably it can't scroll only a rectangle of the window and not its
|
||||
entire client area.
|
||||
|
||||
To use this class, you need to derive from it and implement the
|
||||
\helpref{OnGetColumnWidth()}{wxvarhscrollhelperongetcolumnwidth} pure virtual
|
||||
method. You also must call \helpref{SetColumnCount()}{wxvarhscrollhelpersetcolumncount}
|
||||
to let the base class know how many columns it should display, but from that
|
||||
moment on the scrolling is handled entirely by wxHScrolledWindow. You only
|
||||
need to draw the visible part of contents in your {\tt OnPaint()} method as
|
||||
usual. You should use \helpref{GetVisibleColumnsBegin()}{wxvarhscrollhelpergetvisiblecolumnsbegin}
|
||||
and \helpref{GetVisibleColumnsEnd()}{wxvarhscrollhelpergetvisiblecolumnsend} to
|
||||
select the lines to display. Note that the device context origin is not shifted
|
||||
so the first visible column always appears at the point $(0, 0)$ in physical as
|
||||
well as logical coordinates.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
\helpref{wxPanel}{wxpanel}\\
|
||||
\helpref{wxWindow}{wxwindow}\\
|
||||
\helpref{wxEvtHandler}{wxevthandler}\\
|
||||
\helpref{wxObject}{wxobject}
|
||||
|
||||
\helpref{wxVarHScrollHelper}{wxvarhscrollhelper}\\
|
||||
\helpref{wxVarScrollHelperBase}{wxvarscrollhelperbase}
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/vscroll.h>
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxHVScrolledWindow}{wxhvscrolledwindow},
|
||||
\rtfsp\helpref{wxVScrolledWindow}{wxvscrolledwindow}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
|
||||
\membersection{wxHScrolledWindow::wxHScrolledWindow}\label{wxhscrolledwindowwxhscrolledwindow}
|
||||
|
||||
\func{}{wxHScrolledWindow}{\void}
|
||||
|
||||
Default constructor, you must call \helpref{Create()}{wxhscrolledwindowcreate}
|
||||
later.
|
||||
|
||||
\func{}{wxHScrolledWindow}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}, \param{const wxString\& }{name = wxPanelNameStr}}
|
||||
|
||||
This is the normal constructor, no need to call {\tt Create()} after using this one.
|
||||
|
||||
Note that {\tt wxHSCROLL} is always automatically added to our style, there is
|
||||
no need to specify it explicitly.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{parent}{The parent window, must not be {\tt NULL}}
|
||||
|
||||
\docparam{id}{The identifier of this window, {\tt wxID\_ANY} by default}
|
||||
|
||||
\docparam{pos}{The initial window position}
|
||||
|
||||
\docparam{size}{The initial window size}
|
||||
|
||||
\docparam{style}{The window style. There are no special style bits defined for
|
||||
this class.}
|
||||
|
||||
\docparam{name}{The name for this window; usually not used}
|
||||
|
||||
|
||||
\membersection{wxHScrolledWindow::Create}\label{wxhscrolledwindowcreate}
|
||||
|
||||
\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}, \param{const wxString\& }{name = wxPanelNameStr}}
|
||||
|
||||
Same as the \helpref{non-default constuctor}{wxhscrolledwindowwxhscrolledwindow}
|
||||
but returns status code: {\tt true} if ok, {\tt false} if the window couldn't
|
||||
be created.
|
||||
|
||||
Just as with the constructor above, the {\tt wxHSCROLL} style is always used,
|
||||
there is no need to specify it explicitly.
|
||||
|
105
docs/latex/wx/hvscrolledwindow.tex
Normal file
105
docs/latex/wx/hvscrolledwindow.tex
Normal file
@@ -0,0 +1,105 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Name: hvscrolledwindow.tex
|
||||
%% Purpose: wxHVScrolledWindow Documentation
|
||||
%% Author: Bryan Petty
|
||||
%% Modified by:
|
||||
%% Created: 2007-04-04
|
||||
%% RCS-ID: $Id$
|
||||
%% Copyright: (c) 2007 wxWidgets Team
|
||||
%% License: wxWindows Licence
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\section{\class{wxHVScrolledWindow}}\label{wxhvscrolledwindow}
|
||||
|
||||
This window inherits all functionality of both vertical and horizontal,
|
||||
variable scrolled windows. It automatically handles everything needed to
|
||||
scroll both axis simultaneously with both variable row heights and variable
|
||||
column widths.
|
||||
|
||||
This is a generalization of the \helpref{wxScrolledWindow}{wxscrolledwindow}
|
||||
class which can be only used when all rows and columns are the same size. It
|
||||
lacks some other wxScrolledWindow features however, notably it can't scroll
|
||||
only a rectangle of the window and not its entire client area.
|
||||
|
||||
To use this class, you must derive from it and implement both the
|
||||
\helpref{OnGetRowHeight()}{wxvarvscrollhelperongetrowheight} and
|
||||
\helpref{OnGetColumnWidth()}{wxvarhscrollhelperongetcolumnwidth} pure virtual
|
||||
methods to let the base class know how many rows and columns it should
|
||||
display. You also need to set the total rows and columns the window contains,
|
||||
but from that moment on the scrolling is handled entirely by
|
||||
wxHVScrolledWindow. You only need to draw the visible part of contents in
|
||||
your {\tt OnPaint()} method as usual. You should use
|
||||
\helpref{GetVisibleBegin()}{wxvarhvscrollhelpergetvisiblebegin}
|
||||
and \helpref{GetVisibleEnd()}{wxvarhvscrollhelpergetvisibleend} to select the
|
||||
lines to display. Note that the device context origin is not shifted so the
|
||||
first visible row and column always appear at the point $(0, 0)$ in physical
|
||||
as well as logical coordinates.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
\helpref{wxPanel}{wxpanel}\\
|
||||
\helpref{wxWindow}{wxwindow}\\
|
||||
\helpref{wxEvtHandler}{wxevthandler}\\
|
||||
\helpref{wxObject}{wxobject}
|
||||
|
||||
\helpref{wxVarHVScrollHelper}{wxvarhvscrollhelper}
|
||||
|
||||
\helpref{wxVarVScrollHelper}{wxvarvscrollhelper}\\
|
||||
\helpref{wxVarScrollHelperBase}{wxvarscrollhelperbase}
|
||||
|
||||
\helpref{wxVarHScrollHelper}{wxvarhscrollhelper}\\
|
||||
\helpref{wxVarScrollHelperBase}{wxvarscrollhelperbase}
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/vscroll.h>
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxHScrolledWindow}{wxhscrolledwindow},
|
||||
\rtfsp\helpref{wxVScrolledWindow}{wxvscrolledwindow}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
|
||||
\membersection{wxHVScrolledWindow::wxHVScrolledWindow}\label{wxhvscrolledwindowwxhvscrolledwindow}
|
||||
|
||||
\func{}{wxHVScrolledWindow}{\void}
|
||||
|
||||
Default constructor, you must call \helpref{Create()}{wxhvscrolledwindowcreate}
|
||||
later.
|
||||
|
||||
\func{}{wxHVScrolledWindow}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}, \param{const wxString\& }{name = wxPanelNameStr}}
|
||||
|
||||
This is the normal constructor, no need to call {\tt Create()} after using this one.
|
||||
|
||||
Note that {\tt wxHSCROLL} and {\tt wxVSCROLL} are always automatically added
|
||||
to our styles, there is no need to specify it explicitly.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{parent}{The parent window, must not be {\tt NULL}}
|
||||
|
||||
\docparam{id}{The identifier of this window, {\tt wxID\_ANY} by default}
|
||||
|
||||
\docparam{pos}{The initial window position}
|
||||
|
||||
\docparam{size}{The initial window size}
|
||||
|
||||
\docparam{style}{The window style. There are no special style bits defined for
|
||||
this class.}
|
||||
|
||||
\docparam{name}{The name for this window; usually not used}
|
||||
|
||||
|
||||
\membersection{wxHVScrolledWindow::Create}\label{wxhvscrolledwindowcreate}
|
||||
|
||||
\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}, \param{const wxString\& }{name = wxPanelNameStr}}
|
||||
|
||||
Same as the \helpref{non-default constuctor}{wxhvscrolledwindowwxhvscrolledwindow}
|
||||
but returns status code: {\tt true} if ok, {\tt false} if the window couldn't
|
||||
be created.
|
||||
|
||||
Just as with the constructor above, the {\tt wxHSCROLL} and {\tt wxVSCROLL}
|
||||
styles are always used, there is no need to specify it explicitly.
|
||||
|
@@ -35,7 +35,7 @@
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}
|
||||
|
||||
% put your file(s) in an \input{} statement here
|
||||
\input{arrstrng.tex}
|
||||
\input{locale.tex}
|
||||
|
||||
\addcontentsline{toc}{chapter}{Index}
|
||||
\setheader{{\it INDEX}}{}{}{}{}{{\it INDEX}}%
|
||||
|
108
docs/latex/wx/position.tex
Executable file
108
docs/latex/wx/position.tex
Executable file
@@ -0,0 +1,108 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Name: position.tex (moved from gbposition.tex)
|
||||
%% Purpose: wxPosition Documentation
|
||||
%% Author: Robin Dunn, Bryan Petty
|
||||
%% Modified by:
|
||||
%% Created: 2003-11-06, modified 2007-04-05
|
||||
%% RCS-ID: $Id$
|
||||
%% Copyright: (c) 2003, 2007 wxWidgets Team
|
||||
%% License: wxWindows Licence
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\section{\class{wxPosition}}\label{wxposition}
|
||||
|
||||
This class represents the position of an item in any kind of grid of rows and
|
||||
columns such as \helpref{wxGridBagSizer}{wxgridbagsizer}, or
|
||||
\helpref{wxHVScrolledWindow}{wxhvscrolledwindow}.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
No base class
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/position.h>
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxPoint}{wxpoint}, \helpref{wxSize}{wxsize}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
|
||||
\membersection{wxPosition::wxPosition}\label{wxpositionwxposition}
|
||||
|
||||
\func{}{wxPosition}{\void}
|
||||
|
||||
\func{}{wxPosition}{\param{int }{row}, \param{int }{col}}
|
||||
|
||||
Construct a new wxPosition, optionally setting the row and column. The
|
||||
default value is $(0, 0)$.
|
||||
|
||||
|
||||
\membersection{wxPosition::GetCol}\label{wxpositiongetcol}
|
||||
|
||||
\constfunc{int}{GetCol}{\void}
|
||||
|
||||
A synonym for \helpref{GetColumn()}{wxpositiongetcolumn}.
|
||||
|
||||
|
||||
\membersection{wxPosition::GetColumn}\label{wxpositiongetcolumn}
|
||||
|
||||
\constfunc{int}{GetColumn}{\void}
|
||||
|
||||
Get the current row value.
|
||||
|
||||
|
||||
\membersection{wxPosition::GetRow}\label{wxpositiongetrow}
|
||||
|
||||
\constfunc{int}{GetRow}{\void}
|
||||
|
||||
Get the current row value.
|
||||
|
||||
|
||||
\membersection{wxPosition::SetCol}\label{wxpositionsetcol}
|
||||
|
||||
\func{void}{SetCol}{\param{int }{column}}
|
||||
|
||||
A synonym for \helpref{SetColumn()}{wxpositionsetcolumn}.
|
||||
|
||||
|
||||
\membersection{wxPosition::SetColumn}\label{wxpositionsetcolumn}
|
||||
|
||||
\func{void}{SetColumn}{\param{int }{column}}
|
||||
|
||||
Set a new column value.
|
||||
|
||||
|
||||
\membersection{wxPosition::SetRow}\label{wxpositionsetrow}
|
||||
|
||||
\func{void}{SetRow}{\param{int }{row}}
|
||||
|
||||
Set a new row value.
|
||||
|
||||
|
||||
\membersection{Operators}\label{wxpositionoperators}
|
||||
|
||||
\constfunc{bool}{operator $==$}{\param{const wxPosition\& }{p}}
|
||||
|
||||
\constfunc{bool}{operator $!=$}{\param{const wxPosition\& }{p}}
|
||||
|
||||
Compare equality of two wxPositions.
|
||||
|
||||
\func{wxPosition\&}{operator $+=$}{\param{const wxPosition\& }{p}}
|
||||
|
||||
\func{wxPosition\&}{operator $-=$}{\param{const wxPosition\& }{p}}
|
||||
|
||||
\func{wxPosition\&}{operator $+=$}{\param{const wxSize\& }{s}}
|
||||
|
||||
\func{wxPosition\&}{operator $-=$}{\param{const wxSize\& }{s}}
|
||||
|
||||
\constfunc{wxPosition}{operator $+$}{\param{const wxPosition\& }{p}}
|
||||
|
||||
\constfunc{wxPosition}{operator $-$}{\param{const wxPosition\& }{p}}
|
||||
|
||||
\constfunc{wxPosition}{operator $+$}{\param{const wxSize\& }{s}}
|
||||
|
||||
\constfunc{wxPosition}{operator $-$}{\param{const wxSize\& }{s}}
|
||||
|
178
docs/latex/wx/varhscrollhelper.tex
Normal file
178
docs/latex/wx/varhscrollhelper.tex
Normal file
@@ -0,0 +1,178 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Name: varhscrollhelper.tex
|
||||
%% Purpose: wxVarHScrollHelper Documentation
|
||||
%% Author: Bryan Petty
|
||||
%% Modified by:
|
||||
%% Created: 2007-04-04
|
||||
%% RCS-ID: $Id$
|
||||
%% Copyright: (c) 2007 wxWidgets Team
|
||||
%% License: wxWindows Licence
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\section{\class{wxVarHScrollHelper}}\label{wxvarhscrollhelper}
|
||||
|
||||
This class provides functions wrapping the
|
||||
\helpref{wxVarScrollHelperBase}{wxvarscrollhelperbase} class, targeted for
|
||||
horizontal-specific scrolling using \helpref{wxHScrolledWindow}{wxhscrolledwindow}.
|
||||
|
||||
Like wxVarScrollHelperBase, this class is mostly only useful to those classes
|
||||
built into wxWidgets deriving from here, and this documentation is mostly
|
||||
only provided for referencing those functions provided. You will likely want
|
||||
to derive your window from wxHScrolledWindow rather than from here directly.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
\helpref{wxVarScrollHelperBase}{wxvarscrollhelperbase}
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/vscroll.h>
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxHScrolledWindow}{wxhscrolledwindow},
|
||||
\rtfsp\helpref{wxHVScrolledWindow}{wxhvscrolledwindow},
|
||||
\rtfsp\helpref{wxVScrolledWindow}{wxvscrolledwindow}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
|
||||
\membersection{wxVarHScrollHelper::wxVarHScrollHelper}\label{wxvarhscrollhelperwxvarhscrollhelper}
|
||||
|
||||
\func{}{wxVarHScrollHelper}{\param{wxWindow* }{winToScroll}}
|
||||
|
||||
Constructor taking the target window to be scrolled by this helper class.
|
||||
This will attach scroll event handlers to the target window to catch and
|
||||
handle scroll events appropriately.
|
||||
|
||||
|
||||
\membersection{wxVarHScrollHelper::EstimateTotalWidth}\label{wxvarhscrollhelperestimatetotalwidth}
|
||||
|
||||
\constfunc{virtual wxCoord}{EstimateTotalWidth}{\void}
|
||||
|
||||
This class forwards calls from
|
||||
\helpref{wxVarScrollHelperBase::EstimateTotalSize}{wxvarscrollhelperbaseestimatetotalsize}
|
||||
to this function so derived classes can override either just the height or
|
||||
the width estimation, or just estimate both differently if desired in any
|
||||
\helpref{wxHVScrolledWindow}{wxhvscrolledwindow} derived class.
|
||||
|
||||
Please note that this function will not be called if {\tt EstimateTotalSize()}
|
||||
is overridden in your derived class.
|
||||
|
||||
|
||||
\membersection{wxVarHScrollHelper::GetColumnCount}\label{wxvarhscrollhelpergetcolumncount}
|
||||
|
||||
\constfunc{size\_t}{GetColumnCount}{\void}
|
||||
|
||||
Returns the number of columns the target window contains.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{SetColumnCount()}{wxvarhscrollhelpersetcolumncount}
|
||||
|
||||
|
||||
\membersection{wxVarHScrollHelper::GetVisibleColumnsBegin}\label{wxvarhscrollhelpergetvisiblecolumnsbegin}
|
||||
|
||||
\constfunc{size\_t}{GetVisibleColumnsBegin}{\void}
|
||||
|
||||
Returns the index of the first visible column based on the scroll position.
|
||||
|
||||
|
||||
\membersection{wxVarHScrollHelper::GetVisibleColumnsEnd}\label{wxvarhscrollhelpergetvisiblecolumnsend}
|
||||
|
||||
\constfunc{size\_t}{GetVisibleColumnsEnd}{\void}
|
||||
|
||||
Returns the index of the last visible column based on the scroll position. This
|
||||
includes the last column even if it is only partially visible.
|
||||
|
||||
|
||||
\membersection{wxVarHScrollHelper::IsColumnVisible}\label{wxvarhscrollhelperiscolumnvisible}
|
||||
|
||||
\constfunc{bool}{IsColumnVisible}{\param{size\_t }{column}}
|
||||
|
||||
Returns {\tt true} if the given column is currently visible (even if only
|
||||
partially visible) or {\tt false} otherwise.
|
||||
|
||||
|
||||
\membersection{wxVarHScrollHelper::OnGetColumnWidth}\label{wxvarhscrollhelperongetcolumnwidth}
|
||||
|
||||
\constfunc{virtual wxCoord}{OnGetColumnWidth}{\param{size\_t }{column}}
|
||||
|
||||
This function must be overridden in the derived class, and should return the
|
||||
width of the given column in pixels.
|
||||
|
||||
|
||||
\membersection{wxVarHScrollHelper::OnGetColumnsWidthHint}\label{wxvarhscrollhelperongetcolumnswidthhint}
|
||||
|
||||
\constfunc{virtual void}{OnGetColumnsWidthHint}{\param{size\_t }{columnMin}, \param{size\_t }{columnMax}}
|
||||
|
||||
This function doesn't have to be overridden but it may be useful to do so if
|
||||
calculating the columns' sizes is a relatively expensive operation as it gives
|
||||
your code a chance to calculate several of them at once and cache the result
|
||||
if necessary.
|
||||
|
||||
{\tt OnGetColumnsWidthHint()} is normally called just before
|
||||
\helpref{OnGetColumnWidth()}{wxvarhscrollhelperongetcolumnwidth} but you
|
||||
shouldn't rely on the latter being called for all columns in the interval
|
||||
specified here. It is also possible that OnGetColumnWidth() will be called for
|
||||
units outside of this interval, so this is really just a hint, not a promise.
|
||||
|
||||
Finally, note that columnMin is inclusive, while columnMax is exclusive.
|
||||
|
||||
|
||||
\membersection{wxVarHScrollHelper::RefreshColumn}\label{wxvarhscrollhelperrefreshcolumn}
|
||||
|
||||
\func{virtual void}{RefreshColumn}{\param{size\_t }{column}}
|
||||
|
||||
Triggers a refresh for just the given column's area of the window if it's visible.
|
||||
|
||||
|
||||
\membersection{wxVarHScrollHelper::RefreshColumns}\label{wxvarhscrollhelperrefreshcolumns}
|
||||
|
||||
\func{virtual void}{RefreshColumns}{\param{size\_t }{from}, \param{size\_t }{to}}
|
||||
|
||||
Triggers a refresh for the area between the specified range of columns given
|
||||
(inclusively).
|
||||
|
||||
|
||||
\membersection{wxVarHScrollHelper::ScrollColumnPages}\label{wxvarhscrollhelperscrollcolumnpages}
|
||||
|
||||
\func{virtual bool}{ScrollColumnPages}{\param{int }{pages}}
|
||||
|
||||
Scroll by the specified number of pages which may be positive (to scroll right)
|
||||
or negative (to scroll left).
|
||||
|
||||
|
||||
\membersection{wxVarHScrollHelper::ScrollColumns}\label{wxvarhscrollhelperscrollcolumns}
|
||||
|
||||
\func{virtual bool}{ScrollColumns}{\param{int }{columns}}
|
||||
|
||||
Scroll by the specified number of columns which may be positive (to scroll right)
|
||||
or negative (to scroll left).
|
||||
|
||||
Returns {\tt true} if the window was scrolled, {\tt false} otherwise (for
|
||||
example, if we're trying to scroll right but we are already showing the last
|
||||
column).
|
||||
|
||||
|
||||
\membersection{wxVarHScrollHelper::ScrollToColumn}\label{wxvarhscrollhelperscrolltocolumn}
|
||||
|
||||
\func{bool}{ScrollToColumn}{\param{size\_t }{column}}
|
||||
|
||||
Scroll to the specified column. It will become the first visible column in the window.
|
||||
|
||||
Returns {\tt true} if we scrolled the window, {\tt false} if nothing was done.
|
||||
|
||||
|
||||
\membersection{wxVarHScrollHelper::SetColumnCount}\label{wxvarhscrollhelpersetcolumncount}
|
||||
|
||||
\func{void}{SetColumnCount}{\param{size\_t }{columnCount}}
|
||||
|
||||
Set the number of columns the window contains. The derived class must provide
|
||||
the widths for all columns with indices up to the one given here in it's
|
||||
\helpref{OnGetColumnWidth()}{wxvarhscrollhelperongetcolumnwidth} implementation.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{GetColumnCount()}{wxvarhscrollhelpergetcolumncount}
|
||||
|
173
docs/latex/wx/varhvscrollhelper.tex
Normal file
173
docs/latex/wx/varhvscrollhelper.tex
Normal file
@@ -0,0 +1,173 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Name: varhvscrollhelper.tex
|
||||
%% Purpose: wxVarHVScrollHelper Documentation
|
||||
%% Author: Bryan Petty
|
||||
%% Modified by:
|
||||
%% Created: 2007-04-04
|
||||
%% RCS-ID: $Id$
|
||||
%% Copyright: (c) 2007 wxWidgets Team
|
||||
%% License: wxWindows Licence
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\section{\class{wxVarHVScrollHelper}}\label{wxvarhvscrollhelper}
|
||||
|
||||
This class provides functions wrapping the
|
||||
\helpref{wxVarHScrollHelper}{wxvarhscrollhelper} and
|
||||
\helpref{wxVarVScrollHelper}{wxvarvscrollhelper} classes, targeted for
|
||||
scrolling a window in both axis using
|
||||
\helpref{wxHVScrolledWindow}{wxhvscrolledwindow}. Since this class is also
|
||||
the join class of the horizontal and vertical scrolling functionality, it
|
||||
also addresses some wrappers that help avoid the need to specify class scope
|
||||
in your wxHVScrolledWindow-derived class when using wxVarScrollHelperBase
|
||||
functionality.
|
||||
|
||||
Like all three of it's scroll helper base classes, this class is mostly only
|
||||
useful to those classes built into wxWidgets deriving from here, and this
|
||||
documentation is mostly only provided for referencing those functions
|
||||
provided. You will likely want to derive your window from wxHVScrolledWindow
|
||||
rather than from here directly.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
\helpref{wxVarVScrollHelper}{wxvarvscrollhelper}\\
|
||||
\helpref{wxVarScrollHelperBase}{wxvarscrollhelperbase}
|
||||
|
||||
\helpref{wxVarHScrollHelper}{wxvarhscrollhelper}\\
|
||||
\helpref{wxVarScrollHelperBase}{wxvarscrollhelperbase}
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/vscroll.h>
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxHScrolledWindow}{wxhscrolledwindow},
|
||||
\rtfsp\helpref{wxHVScrolledWindow}{wxhvscrolledwindow},
|
||||
\rtfsp\helpref{wxVScrolledWindow}{wxvscrolledwindow}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
|
||||
\membersection{wxVarHVScrollHelper::wxVarHVScrollHelper}\label{wxvarhvscrollhelperwxvarhvscrollhelper}
|
||||
|
||||
\func{}{wxVarHVScrollHelper}{\param{wxWindow* }{winToScroll}}
|
||||
|
||||
Constructor taking the target window to be scrolled by this helper class.
|
||||
This will attach scroll event handlers to the target window to catch and
|
||||
handle scroll events appropriately.
|
||||
|
||||
|
||||
\membersection{wxVarHVScrollHelper::EnablePhysicalScrolling}\label{wxvarhvscrollhelperenablephysicalscrolling}
|
||||
|
||||
\func{void}{EnablePhysicalScrolling}{\param{bool }{vscrolling = true}, \param{bool }{hscrolling = true}}
|
||||
|
||||
With physical scrolling on (when this is {\tt true}), the device origin is
|
||||
changed properly when a \rtfsp\helpref{wxPaintDC}{wxpaintdc} is prepared,
|
||||
children are actually moved and laid out properly, and the contents of the
|
||||
window (pixels) are actually moved. When this is {\tt false}, you are
|
||||
responsible for repainting any invalidated areas of the window yourself to
|
||||
account for the new scroll position.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{vscrolling}{Specifies if physical scrolling should be turned on when scrolling vertically.}
|
||||
|
||||
\docparam{hscrolling}{Specifies if physical scrolling should be turned on when scrolling horizontally.}
|
||||
|
||||
|
||||
\membersection{wxVarHVScrollHelper::GetRowColumnCount}\label{wxvarhvscrollhelpergetrowcolumncount}
|
||||
|
||||
\constfunc{wxSize}{GetRowColumnCount}{\void}
|
||||
|
||||
Returns the number of columns and rows the target window contains.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{SetRowColumnCount()}{wxvarhvscrollhelpersetrowcolumncount}
|
||||
|
||||
|
||||
\membersection{wxVarHVScrollHelper::GetVisibleBegin}\label{wxvarhvscrollhelpergetvisiblebegin}
|
||||
|
||||
\constfunc{wxPosition}{GetVisibleBegin}{\void}
|
||||
|
||||
Returns the index of the first visible column and row based on the current
|
||||
scroll position.
|
||||
|
||||
|
||||
\membersection{wxVarHVScrollHelper::GetVisibleEnd}\label{wxvarhvscrollhelpergetvisibleend}
|
||||
|
||||
\constfunc{wxPosition}{GetVisibleEnd}{\void}
|
||||
|
||||
Returns the index of the last visible column and row based on the scroll
|
||||
position. This includes any partially visible columns or rows.
|
||||
|
||||
|
||||
\membersection{wxVarHVScrollHelper::HitTest}\label{wxvarhvscrollhelperhittest}
|
||||
|
||||
\constfunc{virtual wxPosition}{HitTest}{\param{wxCoord }{x}, \param{wxCoord }{y}}
|
||||
|
||||
\constfunc{virtual wxPosition}{HitTest}{\param{const wxPoint\& }{pos}}
|
||||
|
||||
Returns the scroll unit under the device unit given accounting for scroll
|
||||
position or {\tt wxNOT\_FOUND} (for the row, column, or possibly both values)
|
||||
if none.
|
||||
|
||||
|
||||
\membersection{wxVarHVScrollHelper::IsVisible}\label{wxvarhvscrollhelperisvisible}
|
||||
|
||||
\constfunc{bool}{IsVisible}{\param{size\_t }{row}, \param{size\_t }{column}}
|
||||
|
||||
\constfunc{bool}{IsVisible}{\param{const wxPosition\& }{pos}}
|
||||
|
||||
Returns {\tt true} if both the given row and column are currently visible
|
||||
(even if only partially visible) or {\tt false} otherwise.
|
||||
|
||||
|
||||
\membersection{wxVarHVScrollHelper::RefreshRowColumn}\label{wxvarhvscrollhelperrefreshrowcolumn}
|
||||
|
||||
\func{virtual void}{RefreshRowColumn}{\param{size\_t }{row}, \param{size\_t }{column}}
|
||||
|
||||
\func{virtual void}{RefreshRowColumn}{\param{const wxPosition\& }{pos}}
|
||||
|
||||
Triggers a refresh for just the area shared between the given row and column
|
||||
of the window if it is visible.
|
||||
|
||||
|
||||
\membersection{wxVarHVScrollHelper::RefreshRowsColumns}\label{wxvarhvscrollhelperrefreshrowscolumns}
|
||||
|
||||
\func{virtual void}{RefreshRowsColumns}{\param{size\_t }{fromRow}, \param{size\_t }{toRow}, \param{size\_t }{fromColumn}, \param{size\_t }{toColumn}}
|
||||
|
||||
\func{virtual void}{RefreshRowsColumns}{\param{const wxPosition\& }{from}, \param{const wxPosition\& }{to}}
|
||||
|
||||
Triggers a refresh for the visible area shared between all given rows and
|
||||
columns (inclusive) of the window. If the target window for both orientations
|
||||
is the same, the rectangle of cells is refreshed; if the target windows
|
||||
differ, the entire client size opposite the orientation direction is
|
||||
refreshed between the specified limits.
|
||||
|
||||
|
||||
\membersection{wxVarHVScrollHelper::ScrollToRowColumn}\label{wxvarhvscrollhelperscrolltorowcolumn}
|
||||
|
||||
\func{bool}{ScrollToRowColumn}{\param{size\_t }{row}, \param{size\_t }{column}}
|
||||
|
||||
\func{bool}{ScrollToRowColumn}{\param{const wxPosition\& }{pos}}
|
||||
|
||||
Scroll to the specified row and column. It will become the first visible row
|
||||
and column in the window. Returns {\tt true} if we scrolled the window,
|
||||
{\tt false} if nothing was done.
|
||||
|
||||
|
||||
\membersection{wxVarHVScrollHelper::SetRowColumnCount}\label{wxvarhvscrollhelpersetrowcolumncount}
|
||||
|
||||
\func{void}{SetRowColumnCount}{\param{size\_t }{rowCount}, \param{size\_t }{columnCount}}
|
||||
|
||||
Set the number of rows and columns the target window will contain. The
|
||||
derived class must provide the sizes for all rows and columns with indices up
|
||||
to the ones given here in it's \helpref{OnGetRowHeight()}{wxvarvscrollhelperongetrowheight}
|
||||
and \helpref{OnGetColumnWidth()}{wxvarhscrollhelperongetcolumnwidth} implementations,
|
||||
respectively.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{GetRowColumnCount()}{wxvarhvscrollhelpergetrowcolumncount}
|
||||
|
243
docs/latex/wx/varscrollhelperbase.tex
Normal file
243
docs/latex/wx/varscrollhelperbase.tex
Normal file
@@ -0,0 +1,243 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Name: varscrollhelperbase.tex
|
||||
%% Purpose: wxVarScrollHelperBase Documentation
|
||||
%% Author: Bryan Petty
|
||||
%% Modified by:
|
||||
%% Created: 2007-04-04
|
||||
%% RCS-ID: $Id$
|
||||
%% Copyright: (c) 2007 wxWidgets Team
|
||||
%% License: wxWindows Licence
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\section{\class{wxVarScrollHelperBase}}\label{wxvarscrollhelperbase}
|
||||
|
||||
This class provides all common base functionality for scroll calculations
|
||||
shared among all variable scrolled window implementations as well as
|
||||
automatic scrollbar functionality, saved scroll positions, controlling
|
||||
target windows to be scrolled, as well as defining all required virtual
|
||||
functions that need to be implemented for any orientation specific work.
|
||||
|
||||
Documentation of this class is provided specifically for referencing use
|
||||
of the functions provided by this class for use with the variable scrolled
|
||||
windows that derive from here. You will likely want to derive your window
|
||||
from one of the already implemented variable scrolled windows rather than
|
||||
from wxVarScrollHelperBase directly.
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/vscroll.h>
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxHScrolledWindow}{wxhscrolledwindow},
|
||||
\rtfsp\helpref{wxHVScrolledWindow}{wxhvscrolledwindow},
|
||||
\rtfsp\helpref{wxVScrolledWindow}{wxvscrolledwindow}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::wxVarScrollHelperBase}\label{wxvarscrollhelperbasewxvarscrollhelperbase}
|
||||
|
||||
\func{}{wxVarScrollHelperBase}{\param{wxWindow* }{winToScroll}}
|
||||
|
||||
Constructor taking the target window to be scrolled by this helper class.
|
||||
This will attach scroll event handlers to the target window to catch and
|
||||
handle scroll events appropriately.
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::\destruct{wxVarScrollHelperBase}}\label{wxvarscrollhelperbasedtor}
|
||||
|
||||
\func{virtual }{\destruct{wxVarScrollHelperBase}}{\void}
|
||||
|
||||
Virtual destructor for detaching scroll event handlers attached with this
|
||||
helper class.
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::CalcScrolledPosition}\label{wxvarscrollhelperbasecalcscrolledposition}
|
||||
|
||||
\constfunc{int}{CalcScrolledPosition}{\param{int }{coord}}
|
||||
|
||||
Translates the logical coordinate given to the current device coordinate.
|
||||
For example, if the window is scrolled 10 units and each scroll unit
|
||||
represents 10 device units (which may not be the case since this class allows
|
||||
for variable scroll unit sizes), a call to this function with a coordinate of
|
||||
15 will return -85.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{CalcUnscrolledPosition()}{wxvarscrollhelperbasecalcunscrolledposition}
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::CalcUnscrolledPosition}\label{wxvarscrollhelperbasecalcunscrolledposition}
|
||||
|
||||
\constfunc{int}{CalcUnscrolledPosition}{\param{int }{coord}}
|
||||
|
||||
Translates the device coordinate given to the corresponding logical
|
||||
coordinate. For example, if the window is scrolled 10 units and each scroll
|
||||
unit represents 10 device units (which may not be the case since this class
|
||||
allows for variable scroll unit sizes), a call to this function with a
|
||||
coordinate of 15 will return 115.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{CalcScrolledPosition()}{wxvarscrollhelperbasecalcscrolledposition}
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::EnablePhysicalScrolling}\label{wxvarscrollhelperbaseenablephysicalscrolling}
|
||||
|
||||
\func{void}{EnablePhysicalScrolling}{\param{bool }{scrolling = true}}
|
||||
|
||||
With physical scrolling on (when this is {\tt true}), the device origin is
|
||||
changed properly when a \rtfsp\helpref{wxPaintDC}{wxpaintdc} is prepared,
|
||||
children are actually moved and laid out properly, and the contents of the
|
||||
window (pixels) are actually moved. When this is {\tt false}, you are
|
||||
responsible for repainting any invalidated areas of the window yourself to
|
||||
account for the new scroll position.
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::EstimateTotalSize}\label{wxvarscrollhelperbaseestimatetotalsize}
|
||||
|
||||
\constfunc{virtual wxCoord}{EstimateTotalSize}{\void}
|
||||
|
||||
When the number of scroll units change, we try to estimate the total size of
|
||||
all units when the full window size is needed (i.e. to calculate the scrollbar
|
||||
thumb size). This is a rather expensive operation in terms of unit access, so
|
||||
if the user code may estimate the average size better or faster than we do, it
|
||||
should override this function to implement its own logic. This function should
|
||||
return the best guess for the total virtual window size.
|
||||
|
||||
Note that although returning a totally wrong value would still work, it risks
|
||||
resulting in very strange scrollbar behaviour so this function should really
|
||||
try to make the best guess possible.
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::GetNonOrientationTargetSize}\label{wxvarscrollhelperbasegetnonorientationtargetsize}
|
||||
|
||||
\constfunc{virtual int}{GetNonOrientationTargetSize}{\void}
|
||||
|
||||
This function needs to be overridden in the in the derived class to return the
|
||||
window size with respect to the opposing orientation. If this is a vertical
|
||||
scrolled window, it should return the height.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{GetOrientationTargetSize()}{wxvarscrollhelperbasegetorientationtargetsize}
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::GetOrientation}\label{wxvarscrollhelperbasegetorientation}
|
||||
|
||||
\constfunc{virtual wxOrientation}{GetOrientation}{\void}
|
||||
|
||||
This function need to be overridden to return the orientation that this helper
|
||||
is working with, either {\tt wxHORIZONTAL} or {\tt wxVERTICAL}.
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::GetOrientationTargetSize}\label{wxvarscrollhelperbasegetorientationtargetsize}
|
||||
|
||||
\constfunc{virtual int}{GetOrientationTargetSize}{\void}
|
||||
|
||||
This function needs to be overridden in the in the derived class to return the
|
||||
window size with respect to the orientation this helper is working with. If
|
||||
this is a vertical scrolled window, it should return the width.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{GetNonOrientationTargetSize()}{wxvarscrollhelperbasegetnonorientationtargetsize}
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::GetTargetWindow}\label{wxvarscrollhelperbasegettargetwindow}
|
||||
|
||||
\constfunc{wxWindow*}{GetTargetWindow}{\void}
|
||||
|
||||
This function will return the target window this helper class is currently
|
||||
scrolling.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{SetTargetWindow()}{wxvarscrollhelperbasesettargetwindow}
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::GetVisibleBegin}\label{wxvarscrollhelperbasegetvisiblebegin}
|
||||
|
||||
\constfunc{size\_t}{GetVisibleBegin}{\void}
|
||||
|
||||
Returns the index of the first visible unit based on the scroll position.
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::GetVisibleEnd}\label{wxvarscrollhelperbasegetvisibleend}
|
||||
|
||||
\constfunc{size\_t}{GetVisibleEnd}{\void}
|
||||
|
||||
Returns the index of the last visible unit based on the scroll position. This
|
||||
includes the last unit even if it is only partially visible.
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::HitTest}\label{wxvarscrollhelperbasehittest}
|
||||
|
||||
\constfunc{virtual int}{HitTest}{\param{wxCoord }{coord}}
|
||||
|
||||
Returns the scroll unit under the device unit given accounting for scroll
|
||||
position or {\tt wxNOT\_FOUND} if none (i.e. if it is below the last item).
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::IsVisible}\label{wxvarscrollhelperbaseisvisible}
|
||||
|
||||
\constfunc{bool}{IsVisible}{\param{size\_t }{unit}}
|
||||
|
||||
Returns {\tt true} if the given scroll unit is currently visible (even if only
|
||||
partially visible) or {\tt false} otherwise.
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::OnGetUnitSize}\label{wxvarscrollhelperbaseongetunitsize}
|
||||
|
||||
\constfunc{virtual wxCoord}{OnGetUnitSize}{\param{size\_t }{unit}}
|
||||
|
||||
This function must be overridden in the derived class, and should return the
|
||||
size of the given unit in pixels.
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::OnGetUnitsSizeHint}\label{wxvarscrollhelperbaseongetunitssizehint}
|
||||
|
||||
\constfunc{virtual void}{OnGetUnitsSizeHint}{\param{size\_t }{unitMin}, \param{size\_t }{unitMax}}
|
||||
|
||||
This function doesn't have to be overridden but it may be useful to do so if
|
||||
calculating the units' sizes is a relatively expensive operation as it gives
|
||||
your code a chance to calculate several of them at once and cache the result
|
||||
if necessary.
|
||||
|
||||
{\tt OnGetUnitsSizeHint()} is normally called just before
|
||||
\helpref{OnGetUnitSize()}{wxvarscrollhelperbaseongetunitsize} but you
|
||||
shouldn't rely on the latter being called for all units in the interval
|
||||
specified here. It is also possible that OnGetUnitSize() will be called for
|
||||
units outside of this interval, so this is really just a hint, not a promise.
|
||||
|
||||
Finally, note that unitMin is inclusive, while unitMax is exclusive.
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::RefreshAll}\label{wxvarscrollhelperbaserefreshall}
|
||||
|
||||
\func{virtual void}{RefreshAll}{\void}
|
||||
|
||||
Recalculate all parameters and repaint all units.
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::SetTargetWindow}\label{wxvarscrollhelperbasesettargetwindow}
|
||||
|
||||
\func{void}{SetTargetWindow}{\param{wxWindow* }{target}}
|
||||
|
||||
Normally the window will scroll itself, but in some rare occasions you might
|
||||
want it to scroll (part of) another window (e.g. a child of it in order to
|
||||
scroll only a portion the area between the scrollbars like a spreadsheet where
|
||||
only the cell area will move).
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{GetTargetWindow()}{wxvarscrollhelperbasegettargetwindow}
|
||||
|
||||
|
||||
\membersection{wxVarScrollHelperBase::UpdateScrollbar}\label{wxvarscrollhelperbaseupdatescrollbar}
|
||||
|
||||
\func{virtual void}{UpdateScrollbar}{\void}
|
||||
|
||||
Update the thumb size shown by the scrollbar.
|
||||
|
178
docs/latex/wx/varvscrollhelper.tex
Normal file
178
docs/latex/wx/varvscrollhelper.tex
Normal file
@@ -0,0 +1,178 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Name: varvscrollhelper.tex
|
||||
%% Purpose: wxVarVScrollHelper Documentation
|
||||
%% Author: Bryan Petty
|
||||
%% Modified by:
|
||||
%% Created: 2007-04-04
|
||||
%% RCS-ID: $Id$
|
||||
%% Copyright: (c) 2007 wxWidgets Team
|
||||
%% License: wxWindows Licence
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\section{\class{wxVarVScrollHelper}}\label{wxvarvscrollhelper}
|
||||
|
||||
This class provides functions wrapping the
|
||||
\helpref{wxVarScrollHelperBase}{wxvarscrollhelperbase} class, targeted for
|
||||
vertical-specific scrolling using \helpref{wxVScrolledWindow}{wxvscrolledwindow}.
|
||||
|
||||
Like wxVarScrollHelperBase, this class is mostly only useful to those classes
|
||||
built into wxWidgets deriving from here, and this documentation is mostly
|
||||
only provided for referencing those functions provided. You will likely want
|
||||
to derive your window from wxVScrolledWindow rather than from here directly.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
\helpref{wxVarScrollHelperBase}{wxvarscrollhelperbase}
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/vscroll.h>
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxHScrolledWindow}{wxhscrolledwindow},
|
||||
\rtfsp\helpref{wxHVScrolledWindow}{wxhvscrolledwindow},
|
||||
\rtfsp\helpref{wxVScrolledWindow}{wxvscrolledwindow}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
|
||||
\membersection{wxVarVScrollHelper::wxVarVScrollHelper}\label{wxvarvscrollhelperwxvarvscrollhelper}
|
||||
|
||||
\func{}{wxVarVScrollHelper}{\param{wxWindow* }{winToScroll}}
|
||||
|
||||
Constructor taking the target window to be scrolled by this helper class.
|
||||
This will attach scroll event handlers to the target window to catch and
|
||||
handle scroll events appropriately.
|
||||
|
||||
|
||||
\membersection{wxVarVScrollHelper::EstimateTotalHeight}\label{wxvarvscrollhelperestimatetotalheight}
|
||||
|
||||
\constfunc{virtual wxCoord}{EstimateTotalHeight}{\void}
|
||||
|
||||
This class forwards calls from
|
||||
\helpref{wxVarScrollHelperBase::EstimateTotalSize}{wxvarscrollhelperbaseestimatetotalsize}
|
||||
to this function so derived classes can override either just the height or
|
||||
the width estimation, or just estimate both differently if desired in any
|
||||
\helpref{wxHVScrolledWindow}{wxhvscrolledwindow} derived class.
|
||||
|
||||
Please note that this function will not be called if {\tt EstimateTotalSize()}
|
||||
is overridden in your derived class.
|
||||
|
||||
|
||||
\membersection{wxVarVScrollHelper::GetRowCount}\label{wxvarvscrollhelpergetrowcount}
|
||||
|
||||
\constfunc{size\_t}{GetRowCount}{\void}
|
||||
|
||||
Returns the number of rows the target window contains.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{SetRowCount()}{wxvarvscrollhelpersetrowcount}
|
||||
|
||||
|
||||
\membersection{wxVarVScrollHelper::GetVisibleRowsBegin}\label{wxvarvscrollhelpergetvisiblerowsbegin}
|
||||
|
||||
\constfunc{size\_t}{GetVisibleRowsBegin}{\void}
|
||||
|
||||
Returns the index of the first visible row based on the scroll position.
|
||||
|
||||
|
||||
\membersection{wxVarVScrollHelper::GetVisibleRowsEnd}\label{wxvarvscrollhelpergetvisiblerowsend}
|
||||
|
||||
\constfunc{size\_t}{GetVisibleRowsEnd}{\void}
|
||||
|
||||
Returns the index of the last visible row based on the scroll position. This
|
||||
includes the last row even if it is only partially visible.
|
||||
|
||||
|
||||
\membersection{wxVarVScrollHelper::IsRowVisible}\label{wxvarvscrollhelperisrowvisible}
|
||||
|
||||
\constfunc{bool}{IsRowVisible}{\param{size\_t }{row}}
|
||||
|
||||
Returns {\tt true} if the given row is currently visible (even if only
|
||||
partially visible) or {\tt false} otherwise.
|
||||
|
||||
|
||||
\membersection{wxVarVScrollHelper::OnGetRowHeight}\label{wxvarvscrollhelperongetrowheight}
|
||||
|
||||
\constfunc{virtual wxCoord}{OnGetRowHeight}{\param{size\_t }{row}}
|
||||
|
||||
This function must be overridden in the derived class, and should return the
|
||||
height of the given row in pixels.
|
||||
|
||||
|
||||
\membersection{wxVarVScrollHelper::OnGetRowsHeightHint}\label{wxvarvscrollhelperongetrowsheighthint}
|
||||
|
||||
\constfunc{virtual void}{OnGetRowsHeightHint}{\param{size\_t }{rowMin}, \param{size\_t }{rowMax}}
|
||||
|
||||
This function doesn't have to be overridden but it may be useful to do so if
|
||||
calculating the rows' sizes is a relatively expensive operation as it gives
|
||||
your code a chance to calculate several of them at once and cache the result
|
||||
if necessary.
|
||||
|
||||
{\tt OnGetRowsHeightHint()} is normally called just before
|
||||
\helpref{OnGetRowHeight()}{wxvarvscrollhelperongetrowheight} but you
|
||||
shouldn't rely on the latter being called for all rows in the interval
|
||||
specified here. It is also possible that OnGetRowHeight() will be called for
|
||||
units outside of this interval, so this is really just a hint, not a promise.
|
||||
|
||||
Finally, note that rowMin is inclusive, while rowMax is exclusive.
|
||||
|
||||
|
||||
\membersection{wxVarVScrollHelper::RefreshRow}\label{wxvarvscrollhelperrefreshrow}
|
||||
|
||||
\func{virtual void}{RefreshRow}{\param{size\_t }{row}}
|
||||
|
||||
Triggers a refresh for just the given row's area of the window if it's visible.
|
||||
|
||||
|
||||
\membersection{wxVarVScrollHelper::RefreshRows}\label{wxvarvscrollhelperrefreshrows}
|
||||
|
||||
\func{virtual void}{RefreshRows}{\param{size\_t }{from}, \param{size\_t }{to}}
|
||||
|
||||
Triggers a refresh for the area between the specified range of rows given
|
||||
(inclusively).
|
||||
|
||||
|
||||
\membersection{wxVarVScrollHelper::ScrollRowPages}\label{wxvarvscrollhelperscrollrowpages}
|
||||
|
||||
\func{virtual bool}{ScrollRowPages}{\param{int }{pages}}
|
||||
|
||||
Scroll by the specified number of pages which may be positive (to scroll down)
|
||||
or negative (to scroll up).
|
||||
|
||||
|
||||
\membersection{wxVarVScrollHelper::ScrollRows}\label{wxvarvscrollhelperscrollrows}
|
||||
|
||||
\func{virtual bool}{ScrollRows}{\param{int }{rows}}
|
||||
|
||||
Scroll by the specified number of rows which may be positive (to scroll down)
|
||||
or negative (to scroll up).
|
||||
|
||||
Returns {\tt true} if the window was scrolled, {\tt false} otherwise (for
|
||||
example, if we're trying to scroll down but we are already showing the last
|
||||
row).
|
||||
|
||||
|
||||
\membersection{wxVarVScrollHelper::ScrollToRow}\label{wxvarvscrollhelperscrolltorow}
|
||||
|
||||
\func{bool}{ScrollToRow}{\param{size\_t }{row}}
|
||||
|
||||
Scroll to the specified row. It will become the first visible row in the window.
|
||||
|
||||
Returns {\tt true} if we scrolled the window, {\tt false} if nothing was done.
|
||||
|
||||
|
||||
\membersection{wxVarVScrollHelper::SetRowCount}\label{wxvarvscrollhelpersetrowcount}
|
||||
|
||||
\func{void}{SetRowCount}{\param{size\_t }{rowCount}}
|
||||
|
||||
Set the number of rows the window contains. The derived class must provide the
|
||||
heights for all rows with indices up to the one given here in it's
|
||||
\helpref{OnGetRowHeight()}{wxvarvscrollhelperongetrowheight} implementation.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{GetRowCount()}{wxvarvscrollhelpergetrowcount}
|
||||
|
@@ -1,302 +0,0 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Name: vscroll.tex
|
||||
%% Purpose: wxVScrolledWindow documentation
|
||||
%% Author: Vadim Zeitlin
|
||||
%% Modified by:
|
||||
%% Created: 30.05.03
|
||||
%% RCS-ID: $Id$
|
||||
%% Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
%% License: wxWindows license
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\section{\class{wxVScrolledWindow}}\label{wxvscrolledwindow}
|
||||
|
||||
In the name of this class, "V" may stand for "variable" because it can be
|
||||
used for scrolling lines of variable heights; "virtual" because it is not
|
||||
necessary to know the heights of all lines in advance -- only those which
|
||||
are shown on the screen need to be measured; or, even, "vertical" because
|
||||
this class only supports scrolling in one direction currently (this could
|
||||
and probably will change in the future however).
|
||||
|
||||
In any case, this is a generalization of the
|
||||
\helpref{wxScrolledWindow}{wxscrolledwindow} class which can be only used when
|
||||
all lines have the same height. It lacks some other wxScrolledWindow features
|
||||
however, notably there is currently no support for horizontal scrolling; it
|
||||
can't scroll another window nor only a rectangle of the window and not its
|
||||
entire client area.
|
||||
|
||||
To use this class, you need to derive from it and implement
|
||||
\helpref{OnGetLineHeight()}{wxvscrolledwindowongetlineheight} pure virtual
|
||||
method. You also must call \helpref{SetLineCount}{wxvscrolledwindowsetlinecount}
|
||||
to let the base class know how many lines it should display but from that
|
||||
moment on the scrolling is handled entirely by wxVScrolledWindow, you only
|
||||
need to draw the visible part of contents in your {\tt OnPaint()} method as
|
||||
usual. You should use \helpref{GetFirstVisibleLine()}{wxvscrolledwindowgetfirstvisibleline}
|
||||
and \helpref{GetLastVisibleLine()}{wxvscrolledwindowgetlastvisibleline} to
|
||||
select the lines to display. Note that the device context origin is not shifted
|
||||
so the first visible line always appears at the point $(0, 0)$ in physical as
|
||||
well as logical coordinates.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
\helpref{wxPanel}{wxpanel}\\
|
||||
\helpref{wxWindow}{wxwindow}\\
|
||||
\helpref{wxEvtHandler}{wxevthandler}\\
|
||||
\helpref{wxObject}{wxobject}
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/vscroll.h>
|
||||
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::wxVScrolledWindow}\label{wxvscrolledwindowctor}
|
||||
|
||||
\func{}{wxVScrolledWindow}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}, \param{const wxString\& }{name = wxPanelNameStr}}
|
||||
|
||||
This is the normal constructor, no need to call Create() after using this one.
|
||||
|
||||
Note that {\tt wxVSCROLL} is always automatically added to our style, there is
|
||||
no need to specify it explicitly.
|
||||
|
||||
\func{}{wxVScrolledWindow}{\void}
|
||||
|
||||
Default constructor, you must call \helpref{Create()}{wxvscrolledwindowcreate}
|
||||
later.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{parent}{The parent window, must not be {\tt NULL}}
|
||||
|
||||
\docparam{id}{The identifier of this window, {\tt wxID\_ANY} by default}
|
||||
|
||||
\docparam{pos}{The initial window position}
|
||||
|
||||
\docparam{size}{The initial window size}
|
||||
|
||||
\docparam{style}{The window style. There are no special style bits defined for
|
||||
this class.}
|
||||
|
||||
\docparam{name}{The name for this window; usually not used}
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::Create}\label{wxvscrolledwindowcreate}
|
||||
|
||||
\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}, \param{const wxString\& }{name = wxPanelNameStr}}
|
||||
|
||||
Same as the \helpref{non default ctor}{wxvscrolledwindowctor} but returns
|
||||
status code: {\tt true} if ok, {\tt false} if the window couldn't have been created.
|
||||
|
||||
Just as with the ctor above, {\tt wxVSCROLL} style is always used, there is no
|
||||
need to specify it explicitly.
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::EstimateTotalHeight}\label{wxvscrolledwindowestimatetotalheight}
|
||||
|
||||
\constfunc{virtual wxCoord}{EstimateTotalHeight}{\void}
|
||||
|
||||
This protected function is used internally by wxVScrolledWindow to estimate the
|
||||
total height of the window when \helpref{SetLineCount}{wxvscrolledwindowsetlinecount}
|
||||
is called. The default implementation uses the brute force approach if the
|
||||
number of the items in the control is small enough. Otherwise, it tries to find
|
||||
the average line height using some lines in the beginning, middle and the end.
|
||||
|
||||
If it is undesirable to access all these lines (some of which might be never
|
||||
shown) just for the total height calculation, you may override the function and
|
||||
provide your own guess better and/or faster.
|
||||
|
||||
Note that although returning a totally wrong value would still work, it risks
|
||||
to result in very strange scrollbar behaviour so this function should really
|
||||
try to make the best guess possible.
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::GetFirstVisibleLine}\label{wxvscrolledwindowgetfirstvisibleline}
|
||||
|
||||
\constfunc{size\_t}{GetFirstVisibleLine}{\void}
|
||||
|
||||
Returns the index of the first currently visible line.
|
||||
|
||||
This is same as \helpref{GetVisibleBegin}{wxvscrolledwindowgetvisiblebegin} and
|
||||
exists only for symmetry with \helpref{GetLastVisibleLine}{wxvscrolledwindowgetlastvisibleline}.
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::GetLastVisibleLine}\label{wxvscrolledwindowgetlastvisibleline}
|
||||
|
||||
\constfunc{size\_t}{GetLastVisibleLine}{\void}
|
||||
|
||||
Returns the index of the last currently visible line. Note that this method
|
||||
returns \texttt{(size\_t)-1} (i.e. a huge positive number) if the control is
|
||||
empty so if this is possible you should use \helpref{GetVisibleEnd}{wxvscrolledwindowgetvisibleend}
|
||||
instead.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{GetFirstVisibleLine}{wxvscrolledwindowgetfirstvisibleline}
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::GetLineCount}\label{wxvscrolledwindowgetlinecount}
|
||||
|
||||
\constfunc{size\_t}{GetLineCount}{\void}
|
||||
|
||||
Get the number of lines this window contains (previously set by
|
||||
\helpref{SetLineCount()}{wxvscrolledwindowsetlinecount})
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::GetVisibleBegin}\label{wxvscrolledwindowgetvisiblebegin}
|
||||
|
||||
\constfunc{size\_t}{GetVisibleBegin}{\void}
|
||||
|
||||
Returns the index of the first currently visible line.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{GetVisibleEnd}{wxvscrolledwindowgetvisibleend}
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::GetVisibleEnd}\label{wxvscrolledwindowgetvisibleend}
|
||||
|
||||
\constfunc{size\_t}{GetVisibleEnd}{\void}
|
||||
|
||||
Returns the index of the first line after the currently visible one. If the
|
||||
return value is $0$ it means that no lines are currently shown (which only
|
||||
happens if the control is empty). Note that the index returned by this method
|
||||
is not always a valid index as it may be equal to \helpref{GetLineCount}{wxvscrolledwindowgetlinecount}.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{GetVisibleBegin}{wxvscrolledwindowgetvisiblebegin}
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::HitTest}\label{wxvscrolledwindowhittest}
|
||||
|
||||
\constfunc{int}{HitTest}{\param{wxCoord }{x}, \param{wxCoord }{y}}
|
||||
|
||||
\constfunc{int}{HitTest}{\param{const wxPoint\& }{pt}}
|
||||
|
||||
Return the item at the specified (in physical coordinates) position or
|
||||
{\tt wxNOT\_FOUND} if none, i.e. if it is below the last item.
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::IsVisible}\label{wxvscrolledwindowisvisible}
|
||||
|
||||
\constfunc{bool}{IsVisible}{\param{size\_t }{line}}
|
||||
|
||||
Returns {\tt true} if the given line is (at least partially) visible or
|
||||
{\tt false} otherwise.
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::OnGetLineHeight}\label{wxvscrolledwindowongetlineheight}
|
||||
|
||||
\constfunc{virtual wxCoord}{OnGetLineHeight}{\param{size\_t }{n}}
|
||||
|
||||
This protected virtual function must be overridden in the derived class and it
|
||||
should return the height of the given line in pixels.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{OnGetLinesHint}{wxvscrolledwindowongetlineshint}
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::OnGetLinesHint}\label{wxvscrolledwindowongetlineshint}
|
||||
|
||||
\constfunc{virtual void}{OnGetLinesHint}{\param{size\_t }{lineMin}, \param{size\_t }{lineMax}}
|
||||
|
||||
This function doesn't have to be overridden but it may be useful to do
|
||||
it if calculating the lines heights is a relatively expensive operation
|
||||
as it gives the user code a possibility to calculate several of them at
|
||||
once.
|
||||
|
||||
{\tt OnGetLinesHint()} is normally called just before
|
||||
\helpref{OnGetLineHeight()}{wxvscrolledwindowongetlineheight} but you
|
||||
shouldn't rely on the latter being called for all lines in the interval
|
||||
specified here. It is also possible that OnGetLineHeight() will be
|
||||
called for the lines outside of this interval, so this is really just a
|
||||
hint, not a promise.
|
||||
|
||||
Finally note that {\it lineMin} is inclusive, while {\it lineMax} is exclusive,
|
||||
as usual.
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::RefreshLine}\label{wxvscrolledwindowrefreshline}
|
||||
|
||||
\func{void}{RefreshLine}{\param{size\_t }{line}}
|
||||
|
||||
Refreshes the specified line -- it will be redrawn during the next main loop
|
||||
iteration.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{RefreshLines}{wxvscrolledwindowrefreshlines}
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::RefreshLines}\label{wxvscrolledwindowrefreshlines}
|
||||
|
||||
\func{void}{RefreshLines}{\param{size\_t }{from}, \param{size\_t }{to}}
|
||||
|
||||
Refreshes all lines between {\it from} and {\it to}, inclusive. {\it from}
|
||||
should be less than or equal to {\it to}.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{RefreshLine}{wxvscrolledwindowrefreshline}
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::RefreshAll}\label{wxvscrolledwindowrefreshall}
|
||||
|
||||
\func{void}{RefreshAll}{\void}
|
||||
|
||||
This function completely refreshes the control, recalculating the number of
|
||||
items shown on screen and repainting them. It should be called when the values
|
||||
returned by \helpref{OnGetLineHeight}{wxvscrolledwindowongetlineheight} change
|
||||
for some reason and the window must be updated to reflect this.
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::ScrollLines}\label{wxvscrolledwindowscrolllines}
|
||||
|
||||
\func{bool}{ScrollLines}{\param{int }{lines}}
|
||||
|
||||
Scroll by the specified number of lines which may be positive (to scroll down)
|
||||
or negative (to scroll up).
|
||||
|
||||
Returns {\tt true} if the window was scrolled, {\tt false} otherwise (for
|
||||
example if we're trying to scroll down but we are already showing the last
|
||||
line).
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{LineUp}{wxwindowlineup}, \helpref{LineDown}{wxwindowlinedown}
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::ScrollPages}\label{wxvscrolledwindowscrollpages}
|
||||
|
||||
\func{bool}{ScrollPages}{\param{int }{pages}}
|
||||
|
||||
Scroll by the specified number of pages which may be positive (to scroll down)
|
||||
or negative (to scroll up).
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{ScrollLines}{wxvscrolledwindowscrolllines},\\
|
||||
\helpref{PageUp}{wxwindowpageup}, \helpref{PageDown}{wxwindowpagedown}
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::ScrollToLine}\label{wxvscrolledwindowscrolltoline}
|
||||
|
||||
\func{bool}{ScrollToLine}{\param{size\_t }{line}}
|
||||
|
||||
Scroll to the specified line: it will become the first visible line in
|
||||
the window.
|
||||
|
||||
Return {\tt true} if we scrolled the window, {\tt false} if nothing was done.
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::SetLineCount}\label{wxvscrolledwindowsetlinecount}
|
||||
|
||||
\func{void}{SetLineCount}{\param{size\_t }{count}}
|
||||
|
||||
Set the number of lines the window contains: the derived class must
|
||||
provide the heights for all lines with indices up to the one given here
|
||||
in its \helpref{OnGetLineHeight()}{wxvscrolledwindowongetlineheight}.
|
||||
|
173
docs/latex/wx/vscrolledwindow.tex
Normal file
173
docs/latex/wx/vscrolledwindow.tex
Normal file
@@ -0,0 +1,173 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Name: vscrolledwindow.tex (moved from vscroll.tex)
|
||||
%% Purpose: wxVScrolledWindow Documentation
|
||||
%% Author: Vadim Zeitlin, Bryan Petty
|
||||
%% Modified by:
|
||||
%% Created: 2003-05-30, modified 2007-04-04
|
||||
%% RCS-ID: $Id$
|
||||
%% Copyright: (c) 2003, 2007 wxWidgets Team
|
||||
%% License: wxWindows Licence
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\section{\class{wxVScrolledWindow}}\label{wxvscrolledwindow}
|
||||
|
||||
In the name of this class, "V" may stand for "variable" because it can be
|
||||
used for scrolling rows of variable heights; "virtual", because it is not
|
||||
necessary to know the heights of all rows in advance -- only those which
|
||||
are shown on the screen need to be measured; or even "vertical", because
|
||||
this class only supports scrolling vertically.
|
||||
|
||||
In any case, this is a generalization of the
|
||||
\helpref{wxScrolledWindow}{wxscrolledwindow} class which can be only used when
|
||||
all rows have the same heights. It lacks some other wxScrolledWindow features
|
||||
however, notably it can't scroll only a rectangle of the window and not its
|
||||
entire client area.
|
||||
|
||||
To use this class, you need to derive from it and implement the
|
||||
\helpref{OnGetRowHeight()}{wxvarvscrollhelperongetrowheight} pure virtual
|
||||
method. You also must call \helpref{SetRowCount}{wxvarvscrollhelpersetrowcount}
|
||||
to let the base class know how many rows it should display, but from that
|
||||
moment on the scrolling is handled entirely by wxVScrolledWindow. You only
|
||||
need to draw the visible part of contents in your {\tt OnPaint()} method as
|
||||
usual. You should use \helpref{GetVisibleRowsBegin()}{wxvarvscrollhelpergetvisiblerowsbegin}
|
||||
and \helpref{GetVisibleRowsEnd()}{wxvarvscrollhelpergetvisiblerowsend} to
|
||||
select the lines to display. Note that the device context origin is not shifted
|
||||
so the first visible row always appears at the point $(0, 0)$ in physical as
|
||||
well as logical coordinates.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
\helpref{wxPanel}{wxpanel}\\
|
||||
\helpref{wxWindow}{wxwindow}\\
|
||||
\helpref{wxEvtHandler}{wxevthandler}\\
|
||||
\helpref{wxObject}{wxobject}
|
||||
|
||||
\helpref{wxVarVScrollHelper}{wxvarvscrollhelper}\\
|
||||
\helpref{wxVarScrollHelperBase}{wxvarscrollhelperbase}
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/vscroll.h>
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxHScrolledWindow}{wxhscrolledwindow},
|
||||
\rtfsp\helpref{wxHVScrolledWindow}{wxhvscrolledwindow}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% wxVarVScrollLegacyAdapter Compatibility Functions
|
||||
%% This section will need to be removed when 2.8 compatibility is removed.
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\membersection{wxWidgets 2.6 and 2.8 Compatibility Functions}\label{wxvscrolledwindowbackwardcompatibility}
|
||||
|
||||
The following functions provide backwards compatibility for applications
|
||||
originally built using wxVScrolledWindow in 2.6 or 2.8. Originally,
|
||||
wxVScrolledWindow referred to scrolling "lines". We now use "units" in
|
||||
wxVarScrollHelperBase to avoid implying any orientation (since the functions
|
||||
are used for both horizontal and vertical scrolling in derived classes). And
|
||||
in the new wxVScrolledWindow and wxHScrolledWindow classes, we refer to them
|
||||
as "rows" and "columns", respectively. This is to help clear some confusion
|
||||
in not only those classes, but also in wxHVScrolledWindow where functions
|
||||
are inherited from both.
|
||||
|
||||
You are encouraged to update any existing code using these function to use
|
||||
the new replacements mentioned below, and avoid using these functions for
|
||||
any new code as they are deprecated.
|
||||
|
||||
\constfunc{size\_t}{GetFirstVisibleLine}{\void}
|
||||
|
||||
Deprecated for \helpref{GetVisibleRowsBegin()}{wxvarvscrollhelpergetvisiblerowsbegin}.
|
||||
|
||||
\constfunc{size\_t}{GetLastVisibleLine}{\void}
|
||||
|
||||
Deprecated for \helpref{GetVisibleRowsEnd()}{wxvarvscrollhelpergetvisiblerowsend}.
|
||||
|
||||
This function originally had a slight design flaw in that it was possible to
|
||||
return \texttt{(size\_t)-1} (ie: a large positive number) if the scroll
|
||||
position was 0 and the first line wasn't completely visible.
|
||||
|
||||
\constfunc{size\_t}{GetLineCount}{\void}
|
||||
|
||||
Deprecated for \helpref{GetRowCount()}{wxvarvscrollhelpergetrowcount}.
|
||||
|
||||
\constfunc{virtual wxCoord}{OnGetLineHeight}{\param{size\_t }{line}}
|
||||
|
||||
Deprecated for \helpref{OnGetRowHeight()}{wxvarvscrollhelperongetrowheight}.
|
||||
|
||||
\constfunc{virtual void}{OnGetLinesHint}{\param{size\_t }{lineMin}, \param{size\_t }{lineMax}}
|
||||
|
||||
Deprecated for \helpref{OnGetRowsHeightHint()}{wxvarvscrollhelperongetrowsheighthint}.
|
||||
|
||||
\func{virtual void}{RefreshLine}{\param{size\_t }{line}}
|
||||
|
||||
Deprecated for \helpref{RefreshRow()}{wxvarvscrollhelperrefreshrow}.
|
||||
|
||||
\func{virtual void}{RefreshLines}{\param{size\_t }{from}, \param{size\_t }{to}}
|
||||
|
||||
Deprecated for \helpref{RefreshRows()}{wxvarvscrollhelperrefreshrows}.
|
||||
|
||||
\func{virtual bool}{ScrollLines}{\param{int }{lines}}
|
||||
|
||||
Deprecated for \helpref{ScrollRows()}{wxvarvscrollhelperscrollrows}.
|
||||
|
||||
\func{virtual bool}{ScrollPages}{\param{int }{pages}}
|
||||
|
||||
Deprecated for \helpref{ScrollRowPages()}{wxvarvscrollhelperscrollrowpages}.
|
||||
|
||||
\func{bool}{ScrollToLine}{\param{size\_t }{line}}
|
||||
|
||||
Deprecated for \helpref{ScrollToRow()}{wxvarvscrollhelperscrolltorow}.
|
||||
|
||||
\func{void}{SetLineCount}{\param{size\_t }{count}}
|
||||
|
||||
Deprecated for \helpref{SetRowCount()}{wxvarvscrollhelpersetrowcount}.
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%% END COMPATIBILITY FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::wxVScrolledWindow}\label{wxvscrolledwindowwxvscrolledwindow}
|
||||
|
||||
\func{}{wxVScrolledWindow}{\void}
|
||||
|
||||
Default constructor, you must call \helpref{Create()}{wxvscrolledwindowcreate}
|
||||
later.
|
||||
|
||||
\func{}{wxVScrolledWindow}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}, \param{const wxString\& }{name = wxPanelNameStr}}
|
||||
|
||||
This is the normal constructor, no need to call {\tt Create()} after using this one.
|
||||
|
||||
Note that {\tt wxVSCROLL} is always automatically added to our style, there is
|
||||
no need to specify it explicitly.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{parent}{The parent window, must not be {\tt NULL}}
|
||||
|
||||
\docparam{id}{The identifier of this window, {\tt wxID\_ANY} by default}
|
||||
|
||||
\docparam{pos}{The initial window position}
|
||||
|
||||
\docparam{size}{The initial window size}
|
||||
|
||||
\docparam{style}{The window style. There are no special style bits defined for
|
||||
this class.}
|
||||
|
||||
\docparam{name}{The name for this window; usually not used}
|
||||
|
||||
|
||||
\membersection{wxVScrolledWindow::Create}\label{wxvscrolledwindowcreate}
|
||||
|
||||
\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}, \param{const wxString\& }{name = wxPanelNameStr}}
|
||||
|
||||
Same as the \helpref{non-default constuctor}{wxvscrolledwindowwxvscrolledwindow}
|
||||
but returns status code: {\tt true} if ok, {\tt false} if the window couldn't
|
||||
be created.
|
||||
|
||||
Just as with the constructor above, the {\tt wxVSCROLL} style is always used,
|
||||
there is no need to specify it explicitly.
|
||||
|
Reference in New Issue
Block a user