1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %% Name: varhscrollhelper.tex
3 %% Purpose: wxVarHScrollHelper Documentation
8 %% Copyright: (c) 2007 wxWidgets Team
9 %% License: wxWindows Licence
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxVarHScrollHelper
}}\label{wxvarhscrollhelper
}
14 This class provides functions wrapping the
15 \helpref{wxVarScrollHelperBase
}{wxvarscrollhelperbase
} class, targeted for
16 horizontal-specific scrolling using
\helpref{wxHScrolledWindow
}{wxhscrolledwindow
}.
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.
23 \wxheading{Derived from
}
25 \helpref{wxVarScrollHelperBase
}{wxvarscrollhelperbase
}
27 \wxheading{Include files
}
33 \helpref{wxHScrolledWindow
}{wxhscrolledwindow
},
34 \rtfsp\helpref{wxHVScrolledWindow
}{wxhvscrolledwindow
},
35 \rtfsp\helpref{wxVScrolledWindow
}{wxvscrolledwindow
}
37 \latexignore{\rtfignore{\wxheading{Members
}}}
40 \membersection{wxVarHScrollHelper::wxVarHScrollHelper
}\label{wxvarhscrollhelperwxvarhscrollhelper
}
42 \func{}{wxVarHScrollHelper
}{\param{wxWindow*
}{winToScroll
}}
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.
49 \membersection{wxVarHScrollHelper::EstimateTotalWidth
}\label{wxvarhscrollhelperestimatetotalwidth
}
51 \constfunc{virtual wxCoord
}{EstimateTotalWidth
}{\void}
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.
59 Please note that this function will not be called if
{\tt EstimateTotalSize()
}
60 is overridden in your derived class.
63 \membersection{wxVarHScrollHelper::GetColumnCount
}\label{wxvarhscrollhelpergetcolumncount
}
65 \constfunc{size
\_t}{GetColumnCount
}{\void}
67 Returns the number of columns the target window contains.
71 \helpref{SetColumnCount()
}{wxvarhscrollhelpersetcolumncount
}
74 \membersection{wxVarHScrollHelper::GetVisibleColumnsBegin
}\label{wxvarhscrollhelpergetvisiblecolumnsbegin
}
76 \constfunc{size
\_t}{GetVisibleColumnsBegin
}{\void}
78 Returns the index of the first visible column based on the scroll position.
81 \membersection{wxVarHScrollHelper::GetVisibleColumnsEnd
}\label{wxvarhscrollhelpergetvisiblecolumnsend
}
83 \constfunc{size
\_t}{GetVisibleColumnsEnd
}{\void}
85 Returns the index of the last visible column based on the scroll position. This
86 includes the last column even if it is only partially visible.
89 \membersection{wxVarHScrollHelper::IsColumnVisible
}\label{wxvarhscrollhelperiscolumnvisible
}
91 \constfunc{bool
}{IsColumnVisible
}{\param{size
\_t }{column
}}
93 Returns
{\tt true
} if the given column is currently visible (even if only
94 partially visible) or
{\tt false
} otherwise.
97 \membersection{wxVarHScrollHelper::OnGetColumnWidth
}\label{wxvarhscrollhelperongetcolumnwidth
}
99 \constfunc{virtual wxCoord
}{OnGetColumnWidth
}{\param{size
\_t }{column
}}
101 This function must be overridden in the derived class, and should return the
102 width of the given column in pixels.
105 \membersection{wxVarHScrollHelper::OnGetColumnsWidthHint
}\label{wxvarhscrollhelperongetcolumnswidthhint
}
107 \constfunc{virtual void
}{OnGetColumnsWidthHint
}{\param{size
\_t }{columnMin
},
\param{size
\_t }{columnMax
}}
109 This function doesn't have to be overridden but it may be useful to do so if
110 calculating the columns' 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
114 {\tt OnGetColumnsWidthHint()
} is normally called just before
115 \helpref{OnGetColumnWidth()
}{wxvarhscrollhelperongetcolumnwidth
} but you
116 shouldn't rely on the latter being called for all columns in the interval
117 specified here. It is also possible that OnGetColumnWidth() will be called for
118 units outside of this interval, so this is really just a hint, not a promise.
120 Finally, note that columnMin is inclusive, while columnMax is exclusive.
123 \membersection{wxVarHScrollHelper::RefreshColumn
}\label{wxvarhscrollhelperrefreshcolumn
}
125 \func{virtual void
}{RefreshColumn
}{\param{size
\_t }{column
}}
127 Triggers a refresh for just the given column's area of the window if it's visible.
130 \membersection{wxVarHScrollHelper::RefreshColumns
}\label{wxvarhscrollhelperrefreshcolumns
}
132 \func{virtual void
}{RefreshColumns
}{\param{size
\_t }{from
},
\param{size
\_t }{to
}}
134 Triggers a refresh for the area between the specified range of columns given
138 \membersection{wxVarHScrollHelper::ScrollColumnPages
}\label{wxvarhscrollhelperscrollcolumnpages
}
140 \func{virtual bool
}{ScrollColumnPages
}{\param{int
}{pages
}}
142 Scroll by the specified number of pages which may be positive (to scroll right)
143 or negative (to scroll left).
146 \membersection{wxVarHScrollHelper::ScrollColumns
}\label{wxvarhscrollhelperscrollcolumns
}
148 \func{virtual bool
}{ScrollColumns
}{\param{int
}{columns
}}
150 Scroll by the specified number of columns which may be positive (to scroll right)
151 or negative (to scroll left).
153 Returns
{\tt true
} if the window was scrolled,
{\tt false
} otherwise (for
154 example, if we're trying to scroll right but we are already showing the last
158 \membersection{wxVarHScrollHelper::ScrollToColumn
}\label{wxvarhscrollhelperscrolltocolumn
}
160 \func{bool
}{ScrollToColumn
}{\param{size
\_t }{column
}}
162 Scroll to the specified column. It will become the first visible column in the window.
164 Returns
{\tt true
} if we scrolled the window,
{\tt false
} if nothing was done.
167 \membersection{wxVarHScrollHelper::SetColumnCount
}\label{wxvarhscrollhelpersetcolumncount
}
169 \func{void
}{SetColumnCount
}{\param{size
\_t }{columnCount
}}
171 Set the number of columns the window contains. The derived class must provide
172 the widths for all columns with indices up to the one given here in it's
173 \helpref{OnGetColumnWidth()
}{wxvarhscrollhelperongetcolumnwidth
} implementation.
177 \helpref{GetColumnCount()
}{wxvarhscrollhelpergetcolumncount
}