1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %% Name: varhvscrollhelper.tex
3 %% Purpose: wxVarHVScrollHelper Documentation
8 %% Copyright: (c) 2007 wxWidgets Team
9 %% License: wxWindows Licence
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxVarHVScrollHelper
}}\label{wxvarhvscrollhelper
}
14 This class provides functions wrapping the
15 \helpref{wxVarHScrollHelper
}{wxvarhscrollhelper
} and
16 \helpref{wxVarVScrollHelper
}{wxvarvscrollhelper
} classes, targeted for
17 scrolling a window in both axis using
18 \helpref{wxHVScrolledWindow
}{wxhvscrolledwindow
}. Since this class is also
19 the join class of the horizontal and vertical scrolling functionality, it
20 also addresses some wrappers that help avoid the need to specify class scope
21 in your wxHVScrolledWindow-derived class when using wxVarScrollHelperBase
24 Like all three of it's scroll helper base classes, this class is mostly only
25 useful to those classes built into wxWidgets deriving from here, and this
26 documentation is mostly only provided for referencing those functions
27 provided. You will likely want to derive your window from wxHVScrolledWindow
28 rather than from here directly.
30 \wxheading{Derived from
}
32 \helpref{wxVarVScrollHelper
}{wxvarvscrollhelper
}\\
33 \helpref{wxVarScrollHelperBase
}{wxvarscrollhelperbase
}
35 \helpref{wxVarHScrollHelper
}{wxvarhscrollhelper
}\\
36 \helpref{wxVarScrollHelperBase
}{wxvarscrollhelperbase
}
38 \wxheading{Include files
}
44 \helpref{wxHScrolledWindow
}{wxhscrolledwindow
},
45 \rtfsp\helpref{wxHVScrolledWindow
}{wxhvscrolledwindow
},
46 \rtfsp\helpref{wxVScrolledWindow
}{wxvscrolledwindow
}
48 \latexignore{\rtfignore{\wxheading{Members
}}}
51 \membersection{wxVarHVScrollHelper::wxVarHVScrollHelper
}\label{wxvarhvscrollhelperwxvarhvscrollhelper
}
53 \func{}{wxVarHVScrollHelper
}{\param{wxWindow*
}{winToScroll
}}
55 Constructor taking the target window to be scrolled by this helper class.
56 This will attach scroll event handlers to the target window to catch and
57 handle scroll events appropriately.
60 \membersection{wxVarHVScrollHelper::EnablePhysicalScrolling
}\label{wxvarhvscrollhelperenablephysicalscrolling
}
62 \func{void
}{EnablePhysicalScrolling
}{\param{bool
}{vscrolling = true
},
\param{bool
}{hscrolling = true
}}
64 With physical scrolling on (when this is
{\tt true
}), the device origin is
65 changed properly when a
\rtfsp\helpref{wxPaintDC
}{wxpaintdc
} is prepared,
66 children are actually moved and laid out properly, and the contents of the
67 window (pixels) are actually moved. When this is
{\tt false
}, you are
68 responsible for repainting any invalidated areas of the window yourself to
69 account for the new scroll position.
71 \wxheading{Parameters
}
73 \docparam{vscrolling
}{Specifies if physical scrolling should be turned on when scrolling vertically.
}
75 \docparam{hscrolling
}{Specifies if physical scrolling should be turned on when scrolling horizontally.
}
78 \membersection{wxVarHVScrollHelper::GetRowColumnCount
}\label{wxvarhvscrollhelpergetrowcolumncount
}
80 \constfunc{wxSize
}{GetRowColumnCount
}{\void}
82 Returns the number of columns and rows the target window contains.
86 \helpref{SetRowColumnCount()
}{wxvarhvscrollhelpersetrowcolumncount
}
89 \membersection{wxVarHVScrollHelper::GetVisibleBegin
}\label{wxvarhvscrollhelpergetvisiblebegin
}
91 \constfunc{wxPosition
}{GetVisibleBegin
}{\void}
93 Returns the index of the first visible column and row based on the current
97 \membersection{wxVarHVScrollHelper::GetVisibleEnd
}\label{wxvarhvscrollhelpergetvisibleend
}
99 \constfunc{wxPosition
}{GetVisibleEnd
}{\void}
101 Returns the index of the last visible column and row based on the scroll
102 position. This includes any partially visible columns or rows.
105 \membersection{wxVarHVScrollHelper::VirtualHitTest
}\label{wxvarhvscrollhelpervirtualhittest
}
107 \constfunc{wxPosition
}{VirtualHitTest
}{\param{wxCoord
}{x
},
\param{wxCoord
}{y
}}
109 \constfunc{wxPosition
}{VirtualHitTest
}{\param{const wxPoint\&
}{pos
}}
111 Returns the virtual scroll unit under the device unit given accounting for
112 scroll position or
{\tt wxNOT
\_FOUND} (for the row, column, or possibly both
116 \membersection{wxVarHVScrollHelper::IsVisible
}\label{wxvarhvscrollhelperisvisible
}
118 \constfunc{bool
}{IsVisible
}{\param{size
\_t }{row
},
\param{size
\_t }{column
}}
120 \constfunc{bool
}{IsVisible
}{\param{const wxPosition\&
}{pos
}}
122 Returns
{\tt true
} if both the given row and column are currently visible
123 (even if only partially visible) or
{\tt false
} otherwise.
126 \membersection{wxVarHVScrollHelper::RefreshRowColumn
}\label{wxvarhvscrollhelperrefreshrowcolumn
}
128 \func{virtual void
}{RefreshRowColumn
}{\param{size
\_t }{row
},
\param{size
\_t }{column
}}
130 \func{virtual void
}{RefreshRowColumn
}{\param{const wxPosition\&
}{pos
}}
132 Triggers a refresh for just the area shared between the given row and column
133 of the window if it is visible.
136 \membersection{wxVarHVScrollHelper::RefreshRowsColumns
}\label{wxvarhvscrollhelperrefreshrowscolumns
}
138 \func{virtual void
}{RefreshRowsColumns
}{\param{size
\_t }{fromRow
},
\param{size
\_t }{toRow
},
\param{size
\_t }{fromColumn
},
\param{size
\_t }{toColumn
}}
140 \func{virtual void
}{RefreshRowsColumns
}{\param{const wxPosition\&
}{from
},
\param{const wxPosition\&
}{to
}}
142 Triggers a refresh for the visible area shared between all given rows and
143 columns (inclusive) of the window. If the target window for both orientations
144 is the same, the rectangle of cells is refreshed; if the target windows
145 differ, the entire client size opposite the orientation direction is
146 refreshed between the specified limits.
149 \membersection{wxVarHVScrollHelper::ScrollToRowColumn
}\label{wxvarhvscrollhelperscrolltorowcolumn
}
151 \func{bool
}{ScrollToRowColumn
}{\param{size
\_t }{row
},
\param{size
\_t }{column
}}
153 \func{bool
}{ScrollToRowColumn
}{\param{const wxPosition\&
}{pos
}}
155 Scroll to the specified row and column. It will become the first visible row
156 and column in the window. Returns
{\tt true
} if we scrolled the window,
157 {\tt false
} if nothing was done.
160 \membersection{wxVarHVScrollHelper::SetRowColumnCount
}\label{wxvarhvscrollhelpersetrowcolumncount
}
162 \func{void
}{SetRowColumnCount
}{\param{size
\_t }{rowCount
},
\param{size
\_t }{columnCount
}}
164 Set the number of rows and columns the target window will contain. The
165 derived class must provide the sizes for all rows and columns with indices up
166 to the ones given here in it's
\helpref{OnGetRowHeight()
}{wxvarvscrollhelperongetrowheight
}
167 and
\helpref{OnGetColumnWidth()
}{wxvarhscrollhelperongetcolumnwidth
} implementations,
172 \helpref{GetRowColumnCount()
}{wxvarhvscrollhelpergetrowcolumncount
}