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