2 \section{\class{wxDataViewRenderer
}}\label{wxdataviewrenderer
}
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
}.
16 Additionally, the user can write own renderers by deriving from
17 \helpref{wxDataViewCustomRenderer
}{wxdataviewcustomrenderer
}.
19 These flags control the behaviour of the renderer and they
20 are used for controlling in what mode the renderer shall
25 enum wxDataViewCellMode
27 wxDATAVIEW_CELL_INERT,
28 wxDATAVIEW_CELL_ACTIVATABLE,
29 wxDATAVIEW_CELL_EDITABLE
32 enum wxDataViewCellRenderState
34 wxDATAVIEW_CELL_SELECTED =
1,
35 wxDATAVIEW_CELL_PRELIT =
2,
36 wxDATAVIEW_CELL_INSENSITIVE =
4,
37 wxDATAVIEW_CELL_FOCUSED =
8
43 \wxheading{Derived from
}
45 \helpref{wxObject
}{wxobject
}
47 \wxheading{Include files
}
52 \membersection{wxDataViewRenderer::wxDataViewRenderer
}\label{wxdataviewrendererwxdataviewrenderer
}
54 \func{}{wxDataViewRenderer
}{\param{const wxString\&
}{varianttype
},
\param{wxDataViewCellMode
}{mode = wxDATAVIEW
\_CELL\_INERT}}
58 \membersection{wxDataViewRenderer::GetMode
}\label{wxdataviewrenderergetmode
}
60 \func{virtual wxDataViewCellMode
}{GetMode
}{\void}
62 Returns the cell mode.
64 \membersection{wxDataViewRenderer::GetOwner
}\label{wxdataviewrenderergetowner
}
66 \func{virtual wxDataViewColumn*
}{GetOwner
}{\void}
68 Returns pointer to the owning
\helpref{wxDataViewColumn
}{wxdataviewcolumn
}.
70 \membersection{wxDataViewRenderer::GetValue
}\label{wxdataviewrenderergetvalue
}
72 \func{virtual bool
}{GetValue
}{\param{wxVariant\&
}{value
}}
74 This methods retrieves the value from the renderer in order to
75 transfer the value back to the data model. Returns
{\it false
}
78 \membersection{wxDataViewRenderer::GetVariantType
}\label{wxdataviewrenderergetvarianttype
}
80 \func{virtual wxString
}{GetVariantType
}{\void}
82 Returns a string with the type of the
\helpref{wxVariant
}{wxvariant
}
83 supported by this renderer.
85 \membersection{wxDataViewRenderer::SetOwner
}\label{wxdataviewrenderersetowner
}
87 \func{virtual void
}{SetOwner
}{\param{wxDataViewColumn*
}{owner
}}
89 Sets the owning
\helpref{wxDataViewColumn
}{wxdataviewcolumn
}. This
90 is usually called from within wxDataViewColumn.
92 \membersection{wxDataViewRenderer::SetValue
}\label{wxdataviewrenderersetvalue
}
94 \func{virtual bool
}{SetValue
}{\param{const wxVariant\&
}{value
}}
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.
100 \membersection{wxDataViewRenderer::Validate
}\label{wxdataviewrenderervalidate
}
102 \func{virtual bool
}{Validate
}{\param{wxVariant\&
}{value
}}
107 \section{\class{wxDataViewTextRenderer
}}\label{wxdataviewtextrenderer
}
109 wxDataViewTextRenderer
112 \wxheading{Derived from
}
114 \helpref{wxDataViewRenderer
}{wxdataviewrenderer
}
116 \wxheading{Include files
}
121 \membersection{wxDataViewTextRenderer::wxDataViewTextRenderer
}\label{wxdataviewtextrendererwxdataviewtextrenderer
}
123 \func{}{wxDataViewTextRenderer
}{\param{const wxString\&
}{varianttype = wxT("string")
},
\param{wxDataViewCellMode
}{mode = wxDATAVIEW
\_CELL\_INERT}}
127 \section{\class{wxDataViewProgressRenderer
}}\label{wxdataviewprogressrenderer
}
129 wxDataViewProgressRenderer
132 \wxheading{Derived from
}
134 \helpref{wxDataViewRenderer
}{wxdataviewrenderer
}
136 \wxheading{Include files
}
141 \membersection{wxDataViewProgressRenderer::wxDataViewProgressRenderer
}\label{wxdataviewprogressrendererwxdataviewprogressrenderer
}
143 \func{}{wxDataViewProgressRenderer
}{\param{const wxString\&
}{label = wxEmptyString
},
\param{const wxString\&
}{varianttype = wxT("long")
},
\param{wxDataViewCellMode
}{mode = wxDATAVIEW
\_CELL\_INERT}}
147 \section{\class{wxDataViewToggleRenderer
}}\label{wxdataviewtogglerenderer
}
149 wxDataViewToggleRenderer
151 \wxheading{Derived from
}
153 \helpref{wxDataViewRenderer
}{wxdataviewrenderer
}
155 \wxheading{Include files
}
160 \membersection{wxDataViewToggleRenderer::wxDataViewToggleRenderer
}\label{wxdataviewtogglerendererwxdataviewtogglerenderer
}
162 \func{}{wxDataViewToggleRenderer
}{\param{const wxString\&
}{varianttype = wxT("bool")
},
\param{wxDataViewCellMode
}{mode = wxDATAVIEW
\_CELL\_INERT}}
165 \section{\class{wxDataViewBitmapRenderer
}}\label{wxdataviewbitmaprenderer
}
167 wxDataViewBitmapRenderer
169 \wxheading{Derived from
}
171 \helpref{wxDataViewRenderer
}{wxdataviewrenderer
}
173 \wxheading{Include files
}
178 \membersection{wxDataViewBitmapRenderer::wxDataViewBitmapRenderer
}\label{wxdataviewbitmaprendererwxdataviewbitmaprenderer
}
180 \func{}{wxDataViewBitmapRenderer
}{\param{const wxString\&
}{varianttype = wxT("wxBitmap")
},
\param{wxDataViewCellMode
}{mode = wxDATAVIEW
\_CELL\_INERT}}
183 \section{\class{wxDataViewDateRenderer
}}\label{wxdataviewdaterenderer
}
185 wxDataViewDateRenderer
188 \wxheading{Derived from
}
190 \helpref{wxDataViewRenderer
}{wxdataviewrenderer
}
192 \wxheading{Include files
}
196 \membersection{wxDataViewDateRenderer::wxDataViewDateRenderer
}\label{wxdataviewdaterendererwxdataviewdaterenderer
}
198 \func{}{wxDataViewDateRenderer
}{\param{const wxString\&
}{varianttype = wxT("datetime")
},
\param{wxDataViewCellMode
}{mode = wxDATAVIEW
\_CELL\_ACTIVATABLE}}
201 \section{\class{wxDataViewCustomRenderer
}}\label{wxdataviewcustomrenderer
}
203 wxDataViewCustomRenderer
205 \wxheading{Derived from
}
207 \helpref{wxDataViewRenderer
}{wxdataviewrenderer
}
209 \wxheading{Include files
}
213 \membersection{wxDataViewCustomRenderer::wxDataViewCustomRenderer
}\label{wxdataviewcustomrendererwxdataviewcustomrenderer
}
215 \func{}{wxDataViewCustomRenderer
}{\param{const wxString\&
}{varianttype = wxT("string")
},
\param{wxDataViewCellMode
}{mode = wxDATAVIEW
\_CELL\_INERT},
\param{bool
}{no
\_init = false
}}
219 \membersection{wxDataViewCustomRenderer::
\destruct{wxDataViewCustomRenderer
}}\label{wxdataviewcustomrendererdtor
}
221 \func{}{\destruct{wxDataViewCustomRenderer
}}{\void}
225 \membersection{wxDataViewCustomRenderer::Activate
}\label{wxdataviewcustomrendereractivate
}
227 \func{virtual bool
}{Activate
}{\param{wxRect
}{cell
},
\param{wxDataViewListModel*
}{model
},
\param{unsigned int
}{col
},
\param{unsigned int
}{row
}}
229 Override this to react to double clicks or <ENTER>.
231 \membersection{wxDataViewCustomRenderer::GetDC
}\label{wxdataviewcustomrenderergetdc
}
233 \func{virtual wxDC*
}{GetDC
}{\void}
235 Create DC on request. Internal.
238 \membersection{wxDataViewCustomRenderer::GetSize
}\label{wxdataviewcustomrenderergetsize
}
240 \func{virtual wxSize
}{GetSize
}{\void}
242 Return size required to show content.
245 \membersection{wxDataViewCustomRenderer::LeftClick
}\label{wxdataviewcustomrendererleftclick
}
247 \func{virtual bool
}{LeftClick
}{\param{wxPoint
}{cursor
},
\param{wxRect
}{cell
},
\param{wxDataViewListModel*
}{model
},
\param{unsigned int
}{col
},
\param{unsigned int
}{row
}}
249 Overrride this to react to a left click.
251 \membersection{wxDataViewCustomRenderer::Render
}\label{wxdataviewcustomrendererrender
}
253 \func{virtual bool
}{Render
}{\param{wxRect
}{cell
},
\param{wxDC*
}{dc
},
\param{int
}{state
}}
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.
259 \membersection{wxDataViewCustomRenderer::RightClick
}\label{wxdataviewcustomrendererrightclick
}
261 \func{virtual bool
}{RightClick
}{\param{wxPoint
}{cursor
},
\param{wxRect
}{cell
},
\param{wxDataViewListModel*
}{model
},
\param{unsigned int
}{col
},
\param{unsigned int
}{row
}}
263 Overrride this to react to a right click.
265 \membersection{wxDataViewCustomRenderer::StartDrag
}\label{wxdataviewcustomrendererstartdrag
}
267 \func{virtual bool
}{StartDrag
}{\param{wxPoint
}{cursor
},
\param{wxRect
}{cell
},
\param{wxDataViewListModel*
}{model
},
\param{unsigned int
}{col
},
\param{unsigned int
}{row
}}
269 Overrride this to start a drag operation.