]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/dataviewmodel.tex
Two more typos.
[wxWidgets.git] / docs / latex / wx / dataviewmodel.tex
1
2 \section{\class{wxDataViewModel}}\label{wxdataviewmodel}
3
4 wxDataViewModel is the base class for all data model to be
5 displayed by a \helpref{wxDataViewCtrl}{wxdataviewctrl}.
6 Currently, this class has no functionality at all and the
7 only existing implementation of it is the
8 \helpref{wxDataViewListModel}{wxdataviewlistmodel}. The
9 plan is to move all functionality of wxDataViewListModel
10 and a to-be-written wxDataViewTreeModel into wxDataViewModel
11 and make wxDataViewListModel and wxDataViewTreeModel subsets
12 of the abstract wxDataViewModel.
13
14 \wxheading{Derived from}
15
16 \helpref{wxObject}{wxobject}
17
18 \wxheading{Include files}
19
20 <wx/dataview.h>
21
22 \membersection{wxDataViewModel::wxDataViewModel}\label{wxdataviewmodelwxdataviewmodel}
23
24 \func{}{wxDataViewModel}{\void}
25
26 Constructor.
27
28 \membersection{wxDataViewModel::\destruct{wxDataViewModel}}\label{wxdataviewmodeldtor}
29
30 \func{}{\destruct{wxDataViewModel}}{\void}
31
32 Destructor.
33
34 \section{\class{wxDataViewListModel}}\label{wxdataviewlistmodel}
35
36 wxDataViewListModel is currently the only existing variant
37 of a \helpref{wxDataViewModel}{wxdataviewmodel}. It allows
38 to define a table like data model to be displayed by a
39 \helpref{wxDataViewCtrl}{wxdataviewctrl}. You need to derive
40 from this class to define your own data model.
41
42 This class maintains a list of
43 \helpref{wxDataListViewListModelNotifier}{wxdataviewlistmodelnotifier}
44 which link this class to the specific implementations on the
45 supported platforms so that e.g. calling {\it ValueChanged()}
46 on this model will just call
47 \helpref{wxDataListViewListModelNotifier::ValueChanged}{wxdataviewlistmodelnotifiervaluechanged}
48 for each notifier that has been added. This is used both for
49 informing the native controls to redraw themselves and for informing
50 e.g. the \helpref{wxDataViewSortedListModel}{wxdataviewsortedlistmodel}
51 to resort itself. You can also add your own notifier in order
52 to get informed about any changes to the data in the list model.
53
54 Additionally, this class maintains a list of all
55 \helpref{wxDataViewColumns}{wxdataviewcolumn} which
56 display a certain column of this list model. This is
57 mostly used internally.
58
59 \wxheading{Derived from}
60
61 \helpref{wxDataViewModel}{wxdataviewmodel}
62
63 \wxheading{Include files}
64
65 <wx/dataview.h>
66
67
68 \membersection{wxDataViewListModel::wxDataViewListModel}\label{wxdataviewlistmodelwxdataviewlistmodel}
69
70 \func{}{wxDataViewListModel}{\void}
71
72 Constructor.
73
74 \membersection{wxDataViewListModel::\destruct{wxDataViewListModel}}\label{wxdataviewlistmodeldtor}
75
76 \func{}{\destruct{wxDataViewListModel}}{\void}
77
78 Destructor.
79
80 \membersection{wxDataViewListModel::AddNotifier}\label{wxdataviewlistmodeladdnotifier}
81
82 \func{void}{AddNotifier}{\param{wxDataViewListModelNotifier* }{notifier}}
83
84 Adds {\it notifier} to the internal list of notifers.
85
86 See also \helpref{RemoveNotifier}{wxdataviewlistmodelremovenotifier}.
87
88 \membersection{wxDataViewListModel::AddViewingColumn}\label{wxdataviewlistmodeladdviewingcolumn}
89
90 \func{void}{AddViewingColumn}{\param{wxDataViewColumn* }{view\_column}, \param{unsigned int }{model\_column}}
91
92 Used internally. Used for maintaining a list of
93 \helpref{wxDataViewColumn}{wxdataviewcolumn} that
94 display a certain column of this model.
95
96 \membersection{wxDataViewListModel::Cleared}\label{wxdataviewlistmodelcleared}
97
98 \func{bool}{virtual Cleared}{\void}
99
100 Call this if all data in your model has been cleared.
101
102 \membersection{wxDataViewListModel::GetColType}\label{wxdataviewlistmodelgetcoltype}
103
104 \func{virtual wxString}{GetColType}{\param{unsigned int }{col}}
105
106 Override this to indicate what type of data is stored in the
107 column specified by {\it col}. This should return a string
108 indicating the type of data as reported by \helpref{wxVariant}{wxvariant}.
109
110 \membersection{wxDataViewListModel::GetNumberOfCols}\label{wxdataviewlistmodelgetnumberofcols}
111
112 \func{virtual unsigned int}{GetNumberOfCols}{\void}
113
114 Override this to indicate, how many columns the list
115 model has.
116
117 \membersection{wxDataViewListModel::GetNumberOfRows}\label{wxdataviewlistmodelgetnumberofrows}
118
119 \func{virtual unsigned int}{GetNumberOfRows}{\void}
120
121 Override this to indicate, how many rows the list
122 model has.
123
124 \membersection{wxDataViewListModel::GetValue}\label{wxdataviewlistmodelgetvalue}
125
126 \func{virtual void}{GetValue}{\param{wxVariant\& }{variant}, \param{unsigned int }{col}, \param{unsigned int }{row}}
127
128 Override this to indicate the value of a given value
129 in the list model. A \helpref{wxVariant}{wxvariant}
130 is used to store the data.
131
132 \membersection{wxDataViewListModel::RemoveNotifier}\label{wxdataviewlistmodelremovenotifier}
133
134 \func{void}{RemoveNotifier}{\param{wxDataViewListModelNotifier* }{notifier}}
135
136 Removes the notifier from the list of notifiers.
137
138 See also \helpref{AddNotifier}{wxdataviewlistmodeladdnotifier}.
139
140 \membersection{wxDataViewListModel::RemoveViewingColumn}\label{wxdataviewlistmodelremoveviewingcolumn}
141
142 \func{void}{RemoveViewingColumn}{\param{wxDataViewColumn* }{column}}
143
144 Used internally. Used for maintaining a list of
145 \helpref{wxDataViewColumn}{wxdataviewcolumn} that
146 display a certain column of this model.
147
148 \membersection{wxDataViewListModel::RowAppended}\label{wxdataviewlistmodelrowappended}
149
150 \func{virtual bool}{RowAppended}{\void}
151
152 Call this if a row has been appended to the list model.
153
154 \membersection{wxDataViewListModel::RowChanged}\label{wxdataviewlistmodelrowchanged}
155
156 \func{virtual bool}{RowChanged}{\param{unsigned int }{row}}
157
158 Call this if the values of this row have been changed.
159
160 \membersection{wxDataViewListModel::RowDeleted}\label{wxdataviewlistmodelrowdeleted}
161
162 \func{virtual bool}{RowDeleted}{\param{unsigned int }{row}}
163
164 Call this if this row has been deleted.
165
166 \membersection{wxDataViewListModel::RowInserted}\label{wxdataviewlistmodelrowinserted}
167
168 \func{virtual bool}{RowInserted}{\param{unsigned int }{before}}
169
170 Call this if a row has been inserted.
171
172 \membersection{wxDataViewListModel::RowPrepended}\label{wxdataviewlistmodelrowprepended}
173
174 \func{virtual bool}{RowPrepended}{\void}
175
176 Call this if a row has been prepended.
177
178 \membersection{wxDataViewListModel::RowsReordered}\label{wxdataviewlistmodelrowsreordered}
179
180 \func{virtual bool}{RowsReordered}{\param{unsigned int* }{new\_order}}
181
182 Call this if the rows have been reorderd.
183
184 \membersection{wxDataViewListModel::SetValue}\label{wxdataviewlistmodelsetvalue}
185
186 \func{virtual bool}{SetValue}{\param{wxVariant\& }{variant}, \param{unsigned int }{col}, \param{unsigned int }{row}}
187
188 This method gets called by e.g. the wxDataViewCtrl class if a
189 value has been changed through its graphical interface. You
190 need to override this method in order to update the data in
191 the underlying data structur. Afterwards,
192 \helpref{ValueChanged}{wxdataviewlistmodelvaluechanged} is called.
193
194
195 \membersection{wxDataViewListModel::ValueChanged}\label{wxdataviewlistmodelvaluechanged}
196
197 \func{virtual bool}{ValueChanged}{\param{unsigned int }{col}, \param{unsigned int }{row}}
198
199 Call this if a value in the model has been changed.
200
201
202 \section{\class{wxDataViewSortedListModel}}\label{wxdataviewsortedlistmodel}
203
204 This class is used for sorting data. It does not contain any
205 data itself. Rather, it provides a sorted interface for
206 another list model.
207
208 Currently, the sorting algorithm isn't thread safe. This needs
209 to be fixed.
210
211 \wxheading{Derived from}
212
213 \helpref{wxDataViewListModel}{wxdataviewlistmodel}
214
215 \wxheading{Include files}
216
217 <wx/dataview.h>
218
219 \membersection{wxDataViewSortedListModel::wxDataViewSortedListModel}\label{wxdataviewsortedlistmodelwxdataviewsortedlistmodel}
220
221 \func{}{wxDataViewSortedListModel}{\param{wxDataViewListModel* }{child}}
222
223 Constructor. {\it child} is the child data model the data of
224 which this model is supposed to present in a sorted way.
225
226 \membersection{wxDataViewSortedListModel::\destruct{wxDataViewSortedListModel}}\label{wxdataviewsortedlistmodeldtor}
227
228 \func{}{\destruct{wxDataViewSortedListModel}}{\void}
229
230 Destructor.
231
232 \membersection{wxDataViewSortedListModel::GetAscending}\label{wxdataviewsortedlistmodelgetascending}
233
234 \func{bool}{GetAscending}{\void}
235
236 Returns true if the data is sorted in ascending order.
237
238 \membersection{wxDataViewSortedListModel::Resort}\label{wxdataviewsortedlistmodelresort}
239
240 \func{void}{Resort}{\void}
241
242 Tell the model to resort its data.
243
244 \membersection{wxDataViewSortedListModel::SetAscending}\label{wxdataviewsortedlistmodelsetascending}
245
246 \func{void}{SetAscending}{\param{bool }{ascending}}
247
248 Set the sort order of the data.
249