]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/varvscrollhelper.tex
Patches-1851591 ] dataview sample is crashing (under MSW)
[wxWidgets.git] / docs / latex / wx / varvscrollhelper.tex
CommitLineData
f18eaf26
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: varvscrollhelper.tex
3%% Purpose: wxVarVScrollHelper Documentation
4%% Author: Bryan Petty
5%% Modified by:
6%% Created: 2007-04-04
7%% RCS-ID: $Id$
8%% Copyright: (c) 2007 wxWidgets Team
9%% License: wxWindows Licence
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxVarVScrollHelper}}\label{wxvarvscrollhelper}
13
14This class provides functions wrapping the
15\helpref{wxVarScrollHelperBase}{wxvarscrollhelperbase} class, targeted for
16vertical-specific scrolling using \helpref{wxVScrolledWindow}{wxvscrolledwindow}.
17
18Like wxVarScrollHelperBase, this class is mostly only useful to those classes
19built into wxWidgets deriving from here, and this documentation is mostly
20only provided for referencing those functions provided. You will likely want
21to derive your window from wxVScrolledWindow rather than from here directly.
22
23\wxheading{Derived from}
24
25\helpref{wxVarScrollHelperBase}{wxvarscrollhelperbase}
26
27\wxheading{Include files}
28
29<wx/vscroll.h>
30
a7af285d
VZ
31\wxheading{Library}
32
33\helpref{wxCore}{librarieslist}
34
f18eaf26
VZ
35\wxheading{See also}
36
37\helpref{wxHScrolledWindow}{wxhscrolledwindow},
38\rtfsp\helpref{wxHVScrolledWindow}{wxhvscrolledwindow},
39\rtfsp\helpref{wxVScrolledWindow}{wxvscrolledwindow}
40
41\latexignore{\rtfignore{\wxheading{Members}}}
42
43
44\membersection{wxVarVScrollHelper::wxVarVScrollHelper}\label{wxvarvscrollhelperwxvarvscrollhelper}
45
46\func{}{wxVarVScrollHelper}{\param{wxWindow* }{winToScroll}}
47
48Constructor taking the target window to be scrolled by this helper class.
49This will attach scroll event handlers to the target window to catch and
50handle scroll events appropriately.
51
52
53\membersection{wxVarVScrollHelper::EstimateTotalHeight}\label{wxvarvscrollhelperestimatetotalheight}
54
55\constfunc{virtual wxCoord}{EstimateTotalHeight}{\void}
56
57This class forwards calls from
58\helpref{wxVarScrollHelperBase::EstimateTotalSize}{wxvarscrollhelperbaseestimatetotalsize}
59to this function so derived classes can override either just the height or
60the width estimation, or just estimate both differently if desired in any
61\helpref{wxHVScrolledWindow}{wxhvscrolledwindow} derived class.
62
63Please note that this function will not be called if {\tt EstimateTotalSize()}
64is overridden in your derived class.
65
66
67\membersection{wxVarVScrollHelper::GetRowCount}\label{wxvarvscrollhelpergetrowcount}
68
69\constfunc{size\_t}{GetRowCount}{\void}
70
71Returns the number of rows the target window contains.
72
73\wxheading{See also}
74
75\helpref{SetRowCount()}{wxvarvscrollhelpersetrowcount}
76
77
78\membersection{wxVarVScrollHelper::GetVisibleRowsBegin}\label{wxvarvscrollhelpergetvisiblerowsbegin}
79
80\constfunc{size\_t}{GetVisibleRowsBegin}{\void}
81
82Returns the index of the first visible row based on the scroll position.
83
84
85\membersection{wxVarVScrollHelper::GetVisibleRowsEnd}\label{wxvarvscrollhelpergetvisiblerowsend}
86
87\constfunc{size\_t}{GetVisibleRowsEnd}{\void}
88
89Returns the index of the last visible row based on the scroll position. This
90includes the last row even if it is only partially visible.
91
92
93\membersection{wxVarVScrollHelper::IsRowVisible}\label{wxvarvscrollhelperisrowvisible}
94
95\constfunc{bool}{IsRowVisible}{\param{size\_t }{row}}
96
97Returns {\tt true} if the given row is currently visible (even if only
98partially visible) or {\tt false} otherwise.
99
100
101\membersection{wxVarVScrollHelper::OnGetRowHeight}\label{wxvarvscrollhelperongetrowheight}
102
103\constfunc{virtual wxCoord}{OnGetRowHeight}{\param{size\_t }{row}}
104
105This function must be overridden in the derived class, and should return the
106height of the given row in pixels.
107
108
109\membersection{wxVarVScrollHelper::OnGetRowsHeightHint}\label{wxvarvscrollhelperongetrowsheighthint}
110
111\constfunc{virtual void}{OnGetRowsHeightHint}{\param{size\_t }{rowMin}, \param{size\_t }{rowMax}}
112
113This function doesn't have to be overridden but it may be useful to do so if
114calculating the rows' sizes is a relatively expensive operation as it gives
115your code a chance to calculate several of them at once and cache the result
116if necessary.
117
118{\tt OnGetRowsHeightHint()} is normally called just before
119\helpref{OnGetRowHeight()}{wxvarvscrollhelperongetrowheight} but you
120shouldn't rely on the latter being called for all rows in the interval
121specified here. It is also possible that OnGetRowHeight() will be called for
122units outside of this interval, so this is really just a hint, not a promise.
123
124Finally, note that rowMin is inclusive, while rowMax is exclusive.
125
126
127\membersection{wxVarVScrollHelper::RefreshRow}\label{wxvarvscrollhelperrefreshrow}
128
129\func{virtual void}{RefreshRow}{\param{size\_t }{row}}
130
131Triggers a refresh for just the given row's area of the window if it's visible.
132
133
134\membersection{wxVarVScrollHelper::RefreshRows}\label{wxvarvscrollhelperrefreshrows}
135
136\func{virtual void}{RefreshRows}{\param{size\_t }{from}, \param{size\_t }{to}}
137
138Triggers a refresh for the area between the specified range of rows given
139(inclusively).
140
141
142\membersection{wxVarVScrollHelper::ScrollRowPages}\label{wxvarvscrollhelperscrollrowpages}
143
144\func{virtual bool}{ScrollRowPages}{\param{int }{pages}}
145
146Scroll by the specified number of pages which may be positive (to scroll down)
147or negative (to scroll up).
148
149
150\membersection{wxVarVScrollHelper::ScrollRows}\label{wxvarvscrollhelperscrollrows}
151
152\func{virtual bool}{ScrollRows}{\param{int }{rows}}
153
154Scroll by the specified number of rows which may be positive (to scroll down)
155or negative (to scroll up).
156
157Returns {\tt true} if the window was scrolled, {\tt false} otherwise (for
158example, if we're trying to scroll down but we are already showing the last
159row).
160
161
162\membersection{wxVarVScrollHelper::ScrollToRow}\label{wxvarvscrollhelperscrolltorow}
163
164\func{bool}{ScrollToRow}{\param{size\_t }{row}}
165
166Scroll to the specified row. It will become the first visible row in the window.
167
168Returns {\tt true} if we scrolled the window, {\tt false} if nothing was done.
169
170
171\membersection{wxVarVScrollHelper::SetRowCount}\label{wxvarvscrollhelpersetrowcount}
172
173\func{void}{SetRowCount}{\param{size\_t }{rowCount}}
174
175Set the number of rows the window contains. The derived class must provide the
176heights for all rows with indices up to the one given here in it's
177\helpref{OnGetRowHeight()}{wxvarvscrollhelperongetrowheight} implementation.
178
179\wxheading{See also}
180
181\helpref{GetRowCount()}{wxvarvscrollhelpergetrowcount}
182