]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/vscrolledwindow.tex
fixed anchor link naming, indentation in some places, added the <hr> divisor, fixed...
[wxWidgets.git] / docs / latex / wx / vscrolledwindow.tex
CommitLineData
f18eaf26
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: vscrolledwindow.tex (moved from vscroll.tex)
3%% Purpose: wxVScrolledWindow Documentation
4%% Author: Vadim Zeitlin, Bryan Petty
5%% Modified by:
6%% Created: 2003-05-30, modified 2007-04-04
7%% RCS-ID: $Id$
8%% Copyright: (c) 2003, 2007 wxWidgets Team
9%% License: wxWindows Licence
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxVScrolledWindow}}\label{wxvscrolledwindow}
13
14In the name of this class, "V" may stand for "variable" because it can be
15used for scrolling rows of variable heights; "virtual", because it is not
16necessary to know the heights of all rows in advance -- only those which
17are shown on the screen need to be measured; or even "vertical", because
18this class only supports scrolling vertically.
19
20In any case, this is a generalization of the
21\helpref{wxScrolledWindow}{wxscrolledwindow} class which can be only used when
22all rows have the same heights. It lacks some other wxScrolledWindow features
23however, notably it can't scroll only a rectangle of the window and not its
24entire client area.
25
26To use this class, you need to derive from it and implement the
27\helpref{OnGetRowHeight()}{wxvarvscrollhelperongetrowheight} pure virtual
28method. You also must call \helpref{SetRowCount}{wxvarvscrollhelpersetrowcount}
29to let the base class know how many rows it should display, but from that
30moment on the scrolling is handled entirely by wxVScrolledWindow. You only
31need to draw the visible part of contents in your {\tt OnPaint()} method as
32usual. You should use \helpref{GetVisibleRowsBegin()}{wxvarvscrollhelpergetvisiblerowsbegin}
33and \helpref{GetVisibleRowsEnd()}{wxvarvscrollhelpergetvisiblerowsend} to
34select the lines to display. Note that the device context origin is not shifted
35so the first visible row always appears at the point $(0, 0)$ in physical as
36well as logical coordinates.
37
38\wxheading{Derived from}
39
40\helpref{wxPanel}{wxpanel}\\
41\helpref{wxWindow}{wxwindow}\\
42\helpref{wxEvtHandler}{wxevthandler}\\
43\helpref{wxObject}{wxobject}
44
45\helpref{wxVarVScrollHelper}{wxvarvscrollhelper}\\
46\helpref{wxVarScrollHelperBase}{wxvarscrollhelperbase}
47
48\wxheading{Include files}
49
50<wx/vscroll.h>
51
a7af285d
VZ
52\wxheading{Library}
53
54\helpref{wxCore}{librarieslist}
55
f18eaf26
VZ
56\wxheading{See also}
57
58\helpref{wxHScrolledWindow}{wxhscrolledwindow},
59\rtfsp\helpref{wxHVScrolledWindow}{wxhvscrolledwindow}
60
61\latexignore{\rtfignore{\wxheading{Members}}}
62
63
64%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65%% wxVarVScrollLegacyAdapter Compatibility Functions
66%% This section will need to be removed when 2.8 compatibility is removed.
67%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
68
69\membersection{wxWidgets 2.6 and 2.8 Compatibility Functions}\label{wxvscrolledwindowbackwardcompatibility}
70
71The following functions provide backwards compatibility for applications
72originally built using wxVScrolledWindow in 2.6 or 2.8. Originally,
73wxVScrolledWindow referred to scrolling "lines". We now use "units" in
74wxVarScrollHelperBase to avoid implying any orientation (since the functions
75are used for both horizontal and vertical scrolling in derived classes). And
76in the new wxVScrolledWindow and wxHScrolledWindow classes, we refer to them
77as "rows" and "columns", respectively. This is to help clear some confusion
78in not only those classes, but also in wxHVScrolledWindow where functions
79are inherited from both.
80
81You are encouraged to update any existing code using these function to use
82the new replacements mentioned below, and avoid using these functions for
83any new code as they are deprecated.
84
85\constfunc{size\_t}{GetFirstVisibleLine}{\void}
86
87Deprecated for \helpref{GetVisibleRowsBegin()}{wxvarvscrollhelpergetvisiblerowsbegin}.
88
89\constfunc{size\_t}{GetLastVisibleLine}{\void}
90
91Deprecated for \helpref{GetVisibleRowsEnd()}{wxvarvscrollhelpergetvisiblerowsend}.
92
93This function originally had a slight design flaw in that it was possible to
94return \texttt{(size\_t)-1} (ie: a large positive number) if the scroll
95position was 0 and the first line wasn't completely visible.
96
97\constfunc{size\_t}{GetLineCount}{\void}
98
99Deprecated for \helpref{GetRowCount()}{wxvarvscrollhelpergetrowcount}.
100
1c6c52fd
CE
101\constfunc{int}{HitTest}{\param{wxCoord }{x}, \param{wxCoord }{y}}
102\constfunc{int}{HitTest}{\param{const wxPoint\& }{pt}}
103
104Deprecated for \helpref{VirtualHitTest()}{wxvarscrollhelperbasevirtualhittest}.
105
f18eaf26
VZ
106\constfunc{virtual wxCoord}{OnGetLineHeight}{\param{size\_t }{line}}
107
108Deprecated for \helpref{OnGetRowHeight()}{wxvarvscrollhelperongetrowheight}.
109
110\constfunc{virtual void}{OnGetLinesHint}{\param{size\_t }{lineMin}, \param{size\_t }{lineMax}}
111
112Deprecated for \helpref{OnGetRowsHeightHint()}{wxvarvscrollhelperongetrowsheighthint}.
113
114\func{virtual void}{RefreshLine}{\param{size\_t }{line}}
115
116Deprecated for \helpref{RefreshRow()}{wxvarvscrollhelperrefreshrow}.
117
118\func{virtual void}{RefreshLines}{\param{size\_t }{from}, \param{size\_t }{to}}
119
120Deprecated for \helpref{RefreshRows()}{wxvarvscrollhelperrefreshrows}.
121
122\func{virtual bool}{ScrollLines}{\param{int }{lines}}
123
124Deprecated for \helpref{ScrollRows()}{wxvarvscrollhelperscrollrows}.
125
126\func{virtual bool}{ScrollPages}{\param{int }{pages}}
127
128Deprecated for \helpref{ScrollRowPages()}{wxvarvscrollhelperscrollrowpages}.
129
130\func{bool}{ScrollToLine}{\param{size\_t }{line}}
131
132Deprecated for \helpref{ScrollToRow()}{wxvarvscrollhelperscrolltorow}.
133
134\func{void}{SetLineCount}{\param{size\_t }{count}}
135
136Deprecated for \helpref{SetRowCount()}{wxvarvscrollhelpersetrowcount}.
137
138%%%%%%%%%%%%%%%%%%%%%%% END COMPATIBILITY FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%
139%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140
141
142\membersection{wxVScrolledWindow::wxVScrolledWindow}\label{wxvscrolledwindowwxvscrolledwindow}
143
144\func{}{wxVScrolledWindow}{\void}
145
146Default constructor, you must call \helpref{Create()}{wxvscrolledwindowcreate}
147later.
148
149\func{}{wxVScrolledWindow}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}, \param{const wxString\& }{name = wxPanelNameStr}}
150
151This is the normal constructor, no need to call {\tt Create()} after using this one.
152
153Note that {\tt wxVSCROLL} is always automatically added to our style, there is
154no need to specify it explicitly.
155
156\wxheading{Parameters}
157
158\docparam{parent}{The parent window, must not be {\tt NULL}}
159
160\docparam{id}{The identifier of this window, {\tt wxID\_ANY} by default}
161
162\docparam{pos}{The initial window position}
163
164\docparam{size}{The initial window size}
165
166\docparam{style}{The window style. There are no special style bits defined for
167this class.}
168
169\docparam{name}{The name for this window; usually not used}
170
171
172\membersection{wxVScrolledWindow::Create}\label{wxvscrolledwindowcreate}
173
174\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}, \param{const wxString\& }{name = wxPanelNameStr}}
175
176Same as the \helpref{non-default constuctor}{wxvscrolledwindowwxvscrolledwindow}
177but returns status code: {\tt true} if ok, {\tt false} if the window couldn't
178be created.
179
180Just as with the constructor above, the {\tt wxVSCROLL} style is always used,
181there is no need to specify it explicitly.
182