]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/varhscrollhelper.tex
Patches-1851591 ] dataview sample is crashing (under MSW)
[wxWidgets.git] / docs / latex / wx / varhscrollhelper.tex
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %% Name: varhscrollhelper.tex
3 %% Purpose: wxVarHScrollHelper 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{wxVarHScrollHelper}}\label{wxvarhscrollhelper}
13
14 This class provides functions wrapping the
15 \helpref{wxVarScrollHelperBase}{wxvarscrollhelperbase} class, targeted for
16 horizontal-specific scrolling using \helpref{wxHScrolledWindow}{wxhscrolledwindow}.
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 wxHScrolledWindow 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{Library}
32
33 \helpref{wxCore}{librarieslist}
34
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{wxVarHScrollHelper::wxVarHScrollHelper}\label{wxvarhscrollhelperwxvarhscrollhelper}
45
46 \func{}{wxVarHScrollHelper}{\param{wxWindow* }{winToScroll}}
47
48 Constructor taking the target window to be scrolled by this helper class.
49 This will attach scroll event handlers to the target window to catch and
50 handle scroll events appropriately.
51
52
53 \membersection{wxVarHScrollHelper::EstimateTotalWidth}\label{wxvarhscrollhelperestimatetotalwidth}
54
55 \constfunc{virtual wxCoord}{EstimateTotalWidth}{\void}
56
57 This class forwards calls from
58 \helpref{wxVarScrollHelperBase::EstimateTotalSize}{wxvarscrollhelperbaseestimatetotalsize}
59 to this function so derived classes can override either just the height or
60 the width estimation, or just estimate both differently if desired in any
61 \helpref{wxHVScrolledWindow}{wxhvscrolledwindow} derived class.
62
63 Please note that this function will not be called if {\tt EstimateTotalSize()}
64 is overridden in your derived class.
65
66
67 \membersection{wxVarHScrollHelper::GetColumnCount}\label{wxvarhscrollhelpergetcolumncount}
68
69 \constfunc{size\_t}{GetColumnCount}{\void}
70
71 Returns the number of columns the target window contains.
72
73 \wxheading{See also}
74
75 \helpref{SetColumnCount()}{wxvarhscrollhelpersetcolumncount}
76
77
78 \membersection{wxVarHScrollHelper::GetVisibleColumnsBegin}\label{wxvarhscrollhelpergetvisiblecolumnsbegin}
79
80 \constfunc{size\_t}{GetVisibleColumnsBegin}{\void}
81
82 Returns the index of the first visible column based on the scroll position.
83
84
85 \membersection{wxVarHScrollHelper::GetVisibleColumnsEnd}\label{wxvarhscrollhelpergetvisiblecolumnsend}
86
87 \constfunc{size\_t}{GetVisibleColumnsEnd}{\void}
88
89 Returns the index of the last visible column based on the scroll position. This
90 includes the last column even if it is only partially visible.
91
92
93 \membersection{wxVarHScrollHelper::IsColumnVisible}\label{wxvarhscrollhelperiscolumnvisible}
94
95 \constfunc{bool}{IsColumnVisible}{\param{size\_t }{column}}
96
97 Returns {\tt true} if the given column is currently visible (even if only
98 partially visible) or {\tt false} otherwise.
99
100
101 \membersection{wxVarHScrollHelper::OnGetColumnWidth}\label{wxvarhscrollhelperongetcolumnwidth}
102
103 \constfunc{virtual wxCoord}{OnGetColumnWidth}{\param{size\_t }{column}}
104
105 This function must be overridden in the derived class, and should return the
106 width of the given column in pixels.
107
108
109 \membersection{wxVarHScrollHelper::OnGetColumnsWidthHint}\label{wxvarhscrollhelperongetcolumnswidthhint}
110
111 \constfunc{virtual void}{OnGetColumnsWidthHint}{\param{size\_t }{columnMin}, \param{size\_t }{columnMax}}
112
113 This function doesn't have to be overridden but it may be useful to do so if
114 calculating the columns' sizes is a relatively expensive operation as it gives
115 your code a chance to calculate several of them at once and cache the result
116 if necessary.
117
118 {\tt OnGetColumnsWidthHint()} is normally called just before
119 \helpref{OnGetColumnWidth()}{wxvarhscrollhelperongetcolumnwidth} but you
120 shouldn't rely on the latter being called for all columns in the interval
121 specified here. It is also possible that OnGetColumnWidth() will be called for
122 units outside of this interval, so this is really just a hint, not a promise.
123
124 Finally, note that columnMin is inclusive, while columnMax is exclusive.
125
126
127 \membersection{wxVarHScrollHelper::RefreshColumn}\label{wxvarhscrollhelperrefreshcolumn}
128
129 \func{virtual void}{RefreshColumn}{\param{size\_t }{column}}
130
131 Triggers a refresh for just the given column's area of the window if it's visible.
132
133
134 \membersection{wxVarHScrollHelper::RefreshColumns}\label{wxvarhscrollhelperrefreshcolumns}
135
136 \func{virtual void}{RefreshColumns}{\param{size\_t }{from}, \param{size\_t }{to}}
137
138 Triggers a refresh for the area between the specified range of columns given
139 (inclusively).
140
141
142 \membersection{wxVarHScrollHelper::ScrollColumnPages}\label{wxvarhscrollhelperscrollcolumnpages}
143
144 \func{virtual bool}{ScrollColumnPages}{\param{int }{pages}}
145
146 Scroll by the specified number of pages which may be positive (to scroll right)
147 or negative (to scroll left).
148
149
150 \membersection{wxVarHScrollHelper::ScrollColumns}\label{wxvarhscrollhelperscrollcolumns}
151
152 \func{virtual bool}{ScrollColumns}{\param{int }{columns}}
153
154 Scroll by the specified number of columns which may be positive (to scroll right)
155 or negative (to scroll left).
156
157 Returns {\tt true} if the window was scrolled, {\tt false} otherwise (for
158 example, if we're trying to scroll right but we are already showing the last
159 column).
160
161
162 \membersection{wxVarHScrollHelper::ScrollToColumn}\label{wxvarhscrollhelperscrolltocolumn}
163
164 \func{bool}{ScrollToColumn}{\param{size\_t }{column}}
165
166 Scroll to the specified column. It will become the first visible column in the window.
167
168 Returns {\tt true} if we scrolled the window, {\tt false} if nothing was done.
169
170
171 \membersection{wxVarHScrollHelper::SetColumnCount}\label{wxvarhscrollhelpersetcolumncount}
172
173 \func{void}{SetColumnCount}{\param{size\_t }{columnCount}}
174
175 Set the number of columns the window contains. The derived class must provide
176 the widths for all columns with indices up to the one given here in it's
177 \helpref{OnGetColumnWidth()}{wxvarhscrollhelperongetcolumnwidth} implementation.
178
179 \wxheading{See also}
180
181 \helpref{GetColumnCount()}{wxvarhscrollhelpergetcolumncount}
182