1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %% Name: varvscrollhelper.tex
3 %% Purpose: wxVarVScrollHelper Documentation
8 %% Copyright: (c) 2007 wxWidgets Team
9 %% License: wxWindows Licence
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxVarVScrollHelper
}}\label{wxvarvscrollhelper
}
14 This class provides functions wrapping the
15 \helpref{wxVarScrollHelperBase
}{wxvarscrollhelperbase
} class, targeted for
16 vertical-specific scrolling using
\helpref{wxVScrolledWindow
}{wxvscrolledwindow
}.
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.
23 \wxheading{Derived from
}
25 \helpref{wxVarScrollHelperBase
}{wxvarscrollhelperbase
}
27 \wxheading{Include files
}
33 \helpref{wxCore
}{librarieslist
}
37 \helpref{wxHScrolledWindow
}{wxhscrolledwindow
},
38 \rtfsp\helpref{wxHVScrolledWindow
}{wxhvscrolledwindow
},
39 \rtfsp\helpref{wxVScrolledWindow
}{wxvscrolledwindow
}
41 \latexignore{\rtfignore{\wxheading{Members
}}}
44 \membersection{wxVarVScrollHelper::wxVarVScrollHelper
}\label{wxvarvscrollhelperwxvarvscrollhelper
}
46 \func{}{wxVarVScrollHelper
}{\param{wxWindow*
}{winToScroll
}}
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.
53 \membersection{wxVarVScrollHelper::EstimateTotalHeight
}\label{wxvarvscrollhelperestimatetotalheight
}
55 \constfunc{virtual wxCoord
}{EstimateTotalHeight
}{\void}
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.
63 Please note that this function will not be called if
{\tt EstimateTotalSize()
}
64 is overridden in your derived class.
67 \membersection{wxVarVScrollHelper::GetRowCount
}\label{wxvarvscrollhelpergetrowcount
}
69 \constfunc{size
\_t}{GetRowCount
}{\void}
71 Returns the number of rows the target window contains.
75 \helpref{SetRowCount()
}{wxvarvscrollhelpersetrowcount
}
78 \membersection{wxVarVScrollHelper::GetVisibleRowsBegin
}\label{wxvarvscrollhelpergetvisiblerowsbegin
}
80 \constfunc{size
\_t}{GetVisibleRowsBegin
}{\void}
82 Returns the index of the first visible row based on the scroll position.
85 \membersection{wxVarVScrollHelper::GetVisibleRowsEnd
}\label{wxvarvscrollhelpergetvisiblerowsend
}
87 \constfunc{size
\_t}{GetVisibleRowsEnd
}{\void}
89 Returns the index of the last visible row based on the scroll position. This
90 includes the last row even if it is only partially visible.
93 \membersection{wxVarVScrollHelper::IsRowVisible
}\label{wxvarvscrollhelperisrowvisible
}
95 \constfunc{bool
}{IsRowVisible
}{\param{size
\_t }{row
}}
97 Returns
{\tt true
} if the given row is currently visible (even if only
98 partially visible) or
{\tt false
} otherwise.
101 \membersection{wxVarVScrollHelper::OnGetRowHeight
}\label{wxvarvscrollhelperongetrowheight
}
103 \constfunc{virtual wxCoord
}{OnGetRowHeight
}{\param{size
\_t }{row
}}
105 This function must be overridden in the derived class, and should return the
106 height of the given row in pixels.
109 \membersection{wxVarVScrollHelper::OnGetRowsHeightHint
}\label{wxvarvscrollhelperongetrowsheighthint
}
111 \constfunc{virtual void
}{OnGetRowsHeightHint
}{\param{size
\_t }{rowMin
},
\param{size
\_t }{rowMax
}}
113 This function doesn't have to be overridden but it may be useful to do so if
114 calculating the rows' 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
118 {\tt OnGetRowsHeightHint()
} is normally called just before
119 \helpref{OnGetRowHeight()
}{wxvarvscrollhelperongetrowheight
} but you
120 shouldn't rely on the latter being called for all rows in the interval
121 specified here. It is also possible that OnGetRowHeight() will be called for
122 units outside of this interval, so this is really just a hint, not a promise.
124 Finally, note that rowMin is inclusive, while rowMax is exclusive.
127 \membersection{wxVarVScrollHelper::RefreshRow
}\label{wxvarvscrollhelperrefreshrow
}
129 \func{virtual void
}{RefreshRow
}{\param{size
\_t }{row
}}
131 Triggers a refresh for just the given row's area of the window if it's visible.
134 \membersection{wxVarVScrollHelper::RefreshRows
}\label{wxvarvscrollhelperrefreshrows
}
136 \func{virtual void
}{RefreshRows
}{\param{size
\_t }{from
},
\param{size
\_t }{to
}}
138 Triggers a refresh for the area between the specified range of rows given
142 \membersection{wxVarVScrollHelper::ScrollRowPages
}\label{wxvarvscrollhelperscrollrowpages
}
144 \func{virtual bool
}{ScrollRowPages
}{\param{int
}{pages
}}
146 Scroll by the specified number of pages which may be positive (to scroll down)
147 or negative (to scroll up).
150 \membersection{wxVarVScrollHelper::ScrollRows
}\label{wxvarvscrollhelperscrollrows
}
152 \func{virtual bool
}{ScrollRows
}{\param{int
}{rows
}}
154 Scroll by the specified number of rows which may be positive (to scroll down)
155 or negative (to scroll up).
157 Returns
{\tt true
} if the window was scrolled,
{\tt false
} otherwise (for
158 example, if we're trying to scroll down but we are already showing the last
162 \membersection{wxVarVScrollHelper::ScrollToRow
}\label{wxvarvscrollhelperscrolltorow
}
164 \func{bool
}{ScrollToRow
}{\param{size
\_t }{row
}}
166 Scroll to the specified row. It will become the first visible row in the window.
168 Returns
{\tt true
} if we scrolled the window,
{\tt false
} if nothing was done.
171 \membersection{wxVarVScrollHelper::SetRowCount
}\label{wxvarvscrollhelpersetrowcount
}
173 \func{void
}{SetRowCount
}{\param{size
\_t }{rowCount
}}
175 Set the number of rows the window contains. The derived class must provide the
176 heights for all rows with indices up to the one given here in it's
177 \helpref{OnGetRowHeight()
}{wxvarvscrollhelperongetrowheight
} implementation.
181 \helpref{GetRowCount()
}{wxvarvscrollhelpergetrowcount
}