test indeterminate wxGauge mode (part of patch 1551409)
[wxWidgets.git] / docs / latex / wx / dataviewrenderer.tex
1
2 \section{\class{wxDataViewRenderer}}\label{wxdataviewrenderer}
3
4
5 This class is used by \helpref{wxDataViewCtrl}{wxdataviewctrl} to
6 render the individual cells. One instance of a renderer class is
7 owned by \helpref{wxDataViewColumn}{wxdataviewcolumn}. There is
8 a number of ready-to-use renderers provided:
9 \helpref{wxDataViewTextRenderer}{wxdataviewtextrenderer},
10 \helpref{wxDataViewToggleRenderer}{wxdataviewtogglerenderer},
11 \helpref{wxDataViewProgressRenderer}{wxdataviewprogressrenderer},
12 \helpref{wxDataViewBitmapRenderer}{wxdataviewbitmaprenderer},
13 \helpref{wxDataViewDateRenderer}{wxdataviewdaterenderer}.
14
15
16 Additionally, the user can write own renderers by deriving from
17 \helpref{wxDataViewCustomRenderer}{wxdataviewcustomrenderer}.
18
19 These flags control the behaviour of the renderer and they
20 are used for controlling in what mode the renderer shall
21 render its contents:
22
23 {\small
24 \begin{verbatim}
25 enum wxDataViewCellMode
26 {
27 wxDATAVIEW_CELL_INERT,
28 wxDATAVIEW_CELL_ACTIVATABLE,
29 wxDATAVIEW_CELL_EDITABLE
30 };
31
32 enum wxDataViewCellRenderState
33 {
34 wxDATAVIEW_CELL_SELECTED = 1,
35 wxDATAVIEW_CELL_PRELIT = 2,
36 wxDATAVIEW_CELL_INSENSITIVE = 4,
37 wxDATAVIEW_CELL_FOCUSED = 8
38 };
39 \end{verbatim}
40 }
41
42
43 \wxheading{Derived from}
44
45 \helpref{wxObject}{wxobject}
46
47 \wxheading{Include files}
48
49 <wx/dataview.h>
50
51
52 \membersection{wxDataViewRenderer::wxDataViewRenderer}\label{wxdataviewrendererwxdataviewrenderer}
53
54 \func{}{wxDataViewRenderer}{\param{const wxString\& }{varianttype}, \param{wxDataViewCellMode }{mode = wxDATAVIEW\_CELL\_INERT}}
55
56 Constructor.
57
58 \membersection{wxDataViewRenderer::GetMode}\label{wxdataviewrenderergetmode}
59
60 \func{virtual wxDataViewCellMode}{GetMode}{\void}
61
62 Returns the cell mode.
63
64 \membersection{wxDataViewRenderer::GetOwner}\label{wxdataviewrenderergetowner}
65
66 \func{virtual wxDataViewColumn*}{GetOwner}{\void}
67
68 Returns pointer to the owning \helpref{wxDataViewColumn}{wxdataviewcolumn}.
69
70 \membersection{wxDataViewRenderer::GetValue}\label{wxdataviewrenderergetvalue}
71
72 \func{virtual bool}{GetValue}{\param{wxVariant\& }{value}}
73
74 This methods retrieves the value from the renderer in order to
75 transfer the value back to the data model. Returns {\it false}
76 on failure.
77
78 \membersection{wxDataViewRenderer::GetVariantType}\label{wxdataviewrenderergetvarianttype}
79
80 \func{virtual wxString}{GetVariantType}{\void}
81
82 Returns a string with the type of the \helpref{wxVariant}{wxvariant}
83 supported by this renderer.
84
85 \membersection{wxDataViewRenderer::SetOwner}\label{wxdataviewrenderersetowner}
86
87 \func{virtual void}{SetOwner}{\param{wxDataViewColumn* }{owner}}
88
89 Sets the owning \helpref{wxDataViewColumn}{wxdataviewcolumn}. This
90 is usually called from within wxDataViewColumn.
91
92 \membersection{wxDataViewRenderer::SetValue}\label{wxdataviewrenderersetvalue}
93
94 \func{virtual bool}{SetValue}{\param{const wxVariant\& }{value}}
95
96 Set the value of the renderer (and thus its cell) to {\it value}.
97 The internal code will then render this cell with this data.
98
99
100 \membersection{wxDataViewRenderer::Validate}\label{wxdataviewrenderervalidate}
101
102 \func{virtual bool}{Validate}{\param{wxVariant\& }{value}}
103
104 To be implemented.
105
106
107 \section{\class{wxDataViewTextRenderer}}\label{wxdataviewtextrenderer}
108
109 wxDataViewTextRenderer
110
111
112 \wxheading{Derived from}
113
114 \helpref{wxDataViewRenderer}{wxdataviewrenderer}
115
116 \wxheading{Include files}
117
118 <wx/dataview.h>
119
120
121 \membersection{wxDataViewTextRenderer::wxDataViewTextRenderer}\label{wxdataviewtextrendererwxdataviewtextrenderer}
122
123 \func{}{wxDataViewTextRenderer}{\param{const wxString\& }{varianttype = wxT("string")}, \param{wxDataViewCellMode }{mode = wxDATAVIEW\_CELL\_INERT}}
124
125
126
127 \section{\class{wxDataViewProgressRenderer}}\label{wxdataviewprogressrenderer}
128
129 wxDataViewProgressRenderer
130
131
132 \wxheading{Derived from}
133
134 \helpref{wxDataViewRenderer}{wxdataviewrenderer}
135
136 \wxheading{Include files}
137
138 <wx/dataview.h>
139
140
141 \membersection{wxDataViewProgressRenderer::wxDataViewProgressRenderer}\label{wxdataviewprogressrendererwxdataviewprogressrenderer}
142
143 \func{}{wxDataViewProgressRenderer}{\param{const wxString\& }{label = wxEmptyString}, \param{const wxString\& }{varianttype = wxT("long")}, \param{wxDataViewCellMode }{mode = wxDATAVIEW\_CELL\_INERT}}
144
145
146
147 \section{\class{wxDataViewToggleRenderer}}\label{wxdataviewtogglerenderer}
148
149 wxDataViewToggleRenderer
150
151 \wxheading{Derived from}
152
153 \helpref{wxDataViewRenderer}{wxdataviewrenderer}
154
155 \wxheading{Include files}
156
157 <wx/dataview.h>
158
159
160 \membersection{wxDataViewToggleRenderer::wxDataViewToggleRenderer}\label{wxdataviewtogglerendererwxdataviewtogglerenderer}
161
162 \func{}{wxDataViewToggleRenderer}{\param{const wxString\& }{varianttype = wxT("bool")}, \param{wxDataViewCellMode }{mode = wxDATAVIEW\_CELL\_INERT}}
163
164
165 \section{\class{wxDataViewBitmapRenderer}}\label{wxdataviewbitmaprenderer}
166
167 wxDataViewBitmapRenderer
168
169 \wxheading{Derived from}
170
171 \helpref{wxDataViewRenderer}{wxdataviewrenderer}
172
173 \wxheading{Include files}
174
175 <wx/dataview.h>
176
177
178 \membersection{wxDataViewBitmapRenderer::wxDataViewBitmapRenderer}\label{wxdataviewbitmaprendererwxdataviewbitmaprenderer}
179
180 \func{}{wxDataViewBitmapRenderer}{\param{const wxString\& }{varianttype = wxT("wxBitmap")}, \param{wxDataViewCellMode }{mode = wxDATAVIEW\_CELL\_INERT}}
181
182
183 \section{\class{wxDataViewDateRenderer}}\label{wxdataviewdaterenderer}
184
185 wxDataViewDateRenderer
186
187
188 \wxheading{Derived from}
189
190 \helpref{wxDataViewRenderer}{wxdataviewrenderer}
191
192 \wxheading{Include files}
193
194 <wx/dataview.h>
195
196 \membersection{wxDataViewDateRenderer::wxDataViewDateRenderer}\label{wxdataviewdaterendererwxdataviewdaterenderer}
197
198 \func{}{wxDataViewDateRenderer}{\param{const wxString\& }{varianttype = wxT("datetime")}, \param{wxDataViewCellMode }{mode = wxDATAVIEW\_CELL\_ACTIVATABLE}}
199
200
201 \section{\class{wxDataViewCustomRenderer}}\label{wxdataviewcustomrenderer}
202
203 wxDataViewCustomRenderer
204
205 \wxheading{Derived from}
206
207 \helpref{wxDataViewRenderer}{wxdataviewrenderer}
208
209 \wxheading{Include files}
210
211 <wx/dataview.h>
212
213 \membersection{wxDataViewCustomRenderer::wxDataViewCustomRenderer}\label{wxdataviewcustomrendererwxdataviewcustomrenderer}
214
215 \func{}{wxDataViewCustomRenderer}{\param{const wxString\& }{varianttype = wxT("string")}, \param{wxDataViewCellMode }{mode = wxDATAVIEW\_CELL\_INERT}, \param{bool }{no\_init = false}}
216
217 Constructor.
218
219 \membersection{wxDataViewCustomRenderer::\destruct{wxDataViewCustomRenderer}}\label{wxdataviewcustomrendererdtor}
220
221 \func{}{\destruct{wxDataViewCustomRenderer}}{\void}
222
223 Destructor.
224
225 \membersection{wxDataViewCustomRenderer::Activate}\label{wxdataviewcustomrendereractivate}
226
227 \func{virtual bool}{Activate}{\param{wxRect }{cell}, \param{wxDataViewListModel* }{model}, \param{unsigned int }{col}, \param{unsigned int }{row}}
228
229 Override this to react to double clicks or <ENTER>.
230
231 \membersection{wxDataViewCustomRenderer::GetDC}\label{wxdataviewcustomrenderergetdc}
232
233 \func{virtual wxDC*}{GetDC}{\void}
234
235 Create DC on request. Internal.
236
237
238 \membersection{wxDataViewCustomRenderer::GetSize}\label{wxdataviewcustomrenderergetsize}
239
240 \func{virtual wxSize}{GetSize}{\void}
241
242 Return size required to show content.
243
244
245 \membersection{wxDataViewCustomRenderer::LeftClick}\label{wxdataviewcustomrendererleftclick}
246
247 \func{virtual bool}{LeftClick}{\param{wxPoint }{cursor}, \param{wxRect }{cell}, \param{wxDataViewListModel* }{model}, \param{unsigned int }{col}, \param{unsigned int }{row}}
248
249 Overrride this to react to a left click.
250
251 \membersection{wxDataViewCustomRenderer::Render}\label{wxdataviewcustomrendererrender}
252
253 \func{virtual bool}{Render}{\param{wxRect }{cell}, \param{wxDC* }{dc}, \param{int }{state}}
254
255 Override this to render the cell. Before this is called,
256 \helpref{SetValue}{wxdataviewrenderersetvalue} was called
257 so that this instance knows what to render.
258
259 \membersection{wxDataViewCustomRenderer::RightClick}\label{wxdataviewcustomrendererrightclick}
260
261 \func{virtual bool}{RightClick}{\param{wxPoint }{cursor}, \param{wxRect }{cell}, \param{wxDataViewListModel* }{model}, \param{unsigned int }{col}, \param{unsigned int }{row}}
262
263 Overrride this to react to a right click.
264
265 \membersection{wxDataViewCustomRenderer::StartDrag}\label{wxdataviewcustomrendererstartdrag}
266
267 \func{virtual bool}{StartDrag}{\param{wxPoint }{cursor}, \param{wxRect }{cell}, \param{wxDataViewListModel* }{model}, \param{unsigned int }{col}, \param{unsigned int }{row}}
268
269 Overrride this to start a drag operation.
270
271
272