2 \section{\class{wxDataViewModel
}}\label{wxdataviewmodel
}
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.
14 \wxheading{Derived from
}
16 \helpref{wxObject
}{wxobject
}
18 \wxheading{Include files
}
22 \membersection{wxDataViewModel::wxDataViewModel
}\label{wxdataviewmodelwxdataviewmodel
}
24 \func{}{wxDataViewModel
}{\void}
28 \membersection{wxDataViewModel::
\destruct{wxDataViewModel
}}\label{wxdataviewmodeldtor
}
30 \func{}{\destruct{wxDataViewModel
}}{\void}
34 \section{\class{wxDataViewListModel
}}\label{wxdataviewlistmodel
}
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.
42 You need to override
\helpref{GetNumberOfRows
}{wxdataviewlistmodelgetnumberofrows
},
43 \helpref{GetNumberOfCols
}{wxdataviewlistmodelgetnumberofcols
},
44 \helpref{GetColType
}{wxdataviewlistmodelgetcoltype
} and
45 \helpref{GetValue
}{wxdataviewlistmodelgetvalue
} in order to
46 define the data model (which acts as an interface between
47 your actual data and the wxDataViewCtrl).
49 wxDataViewModel and this class (as indeed the entire wxDataViewCtrl
50 code) is using
\helpref{wxVariant
}{wxvariant
} to store data and
51 its type in a generic way. wxVariant can be extended to contain
52 almost any data without changes to the original class.
54 This class maintains a list of
55 \helpref{wxDataListViewListModelNotifier
}{wxdataviewlistmodelnotifier
}
56 which link this class to the specific implementations on the
57 supported platforms so that e.g. calling
58 \helpref{ValueChanged
}{wxdataviewlistmodelvaluechanged
}
59 on this model will just call
60 \helpref{wxDataListViewListModelNotifier::ValueChanged
}{wxdataviewlistmodelnotifiervaluechanged
}
61 for each notifier that has been added. This is used both for
62 informing the native controls to redraw themselves and for informing
63 e.g. the
\helpref{wxDataViewSortedListModel
}{wxdataviewsortedlistmodel
}
64 to resort itself. You can also add your own notifier in order
65 to get informed about any changes to the data in the list model.
67 Additionally, this class maintains a list of all
68 \helpref{wxDataViewColumns
}{wxdataviewcolumn
} which
69 display a certain column of this list model. This is
70 mostly used internally.
72 \wxheading{Derived from
}
74 \helpref{wxDataViewModel
}{wxdataviewmodel
}\\
75 \helpref{wxObject
}{wxobject
}
77 \wxheading{Include files
}
82 \membersection{wxDataViewListModel::wxDataViewListModel
}\label{wxdataviewlistmodelwxdataviewlistmodel
}
84 \func{}{wxDataViewListModel
}{\void}
88 \membersection{wxDataViewListModel::
\destruct{wxDataViewListModel
}}\label{wxdataviewlistmodeldtor
}
90 \func{}{\destruct{wxDataViewListModel
}}{\void}
94 \membersection{wxDataViewListModel::AddNotifier
}\label{wxdataviewlistmodeladdnotifier
}
96 \func{void
}{AddNotifier
}{\param{wxDataViewListModelNotifier*
}{notifier
}}
98 Adds
{\it notifier
} to the internal list of notifers.
100 See also
\helpref{RemoveNotifier
}{wxdataviewlistmodelremovenotifier
}.
102 \membersection{wxDataViewListModel::AddViewingColumn
}\label{wxdataviewlistmodeladdviewingcolumn
}
104 \func{void
}{AddViewingColumn
}{\param{wxDataViewColumn*
}{view
\_column},
\param{unsigned int
}{model
\_column}}
106 Used internally. Used for maintaining a list of
107 \helpref{wxDataViewColumn
}{wxdataviewcolumn
} that
108 display a certain column of this model.
110 \membersection{wxDataViewListModel::Cleared
}\label{wxdataviewlistmodelcleared
}
112 \func{bool
}{virtual Cleared
}{\void}
114 Call this if all data in your model has been cleared.
116 \membersection{wxDataViewListModel::GetColType
}\label{wxdataviewlistmodelgetcoltype
}
118 \func{virtual wxString
}{GetColType
}{\param{unsigned int
}{col
}}
120 Override this to indicate what type of data is stored in the
121 column specified by
{\it col
}. This should return a string
122 indicating the type of data as reported by
\helpref{wxVariant
}{wxvariant
}.
124 \membersection{wxDataViewListModel::GetNumberOfCols
}\label{wxdataviewlistmodelgetnumberofcols
}
126 \func{virtual unsigned int
}{GetNumberOfCols
}{\void}
128 Override this to indicate, how many columns the list
131 \membersection{wxDataViewListModel::GetNumberOfRows
}\label{wxdataviewlistmodelgetnumberofrows
}
133 \func{virtual unsigned int
}{GetNumberOfRows
}{\void}
135 Override this to indicate, how many rows the list
138 \membersection{wxDataViewListModel::GetValue
}\label{wxdataviewlistmodelgetvalue
}
140 \func{virtual void
}{GetValue
}{\param{wxVariant\&
}{variant
},
\param{unsigned int
}{col
},
\param{unsigned int
}{row
}}
142 Override this to indicate the value of a given value
143 in the list model. A
\helpref{wxVariant
}{wxvariant
}
144 is used to store the data.
146 \membersection{wxDataViewListModel::RemoveNotifier
}\label{wxdataviewlistmodelremovenotifier
}
148 \func{void
}{RemoveNotifier
}{\param{wxDataViewListModelNotifier*
}{notifier
}}
150 Removes the notifier from the list of notifiers.
152 See also
\helpref{AddNotifier
}{wxdataviewlistmodeladdnotifier
}.
154 \membersection{wxDataViewListModel::RemoveViewingColumn
}\label{wxdataviewlistmodelremoveviewingcolumn
}
156 \func{void
}{RemoveViewingColumn
}{\param{wxDataViewColumn*
}{column
}}
158 Used internally. Used for maintaining a list of
159 \helpref{wxDataViewColumn
}{wxdataviewcolumn
} that
160 display a certain column of this model.
162 \membersection{wxDataViewListModel::RowAppended
}\label{wxdataviewlistmodelrowappended
}
164 \func{virtual bool
}{RowAppended
}{\void}
166 Call this if a row has been appended to the list model.
168 \membersection{wxDataViewListModel::RowChanged
}\label{wxdataviewlistmodelrowchanged
}
170 \func{virtual bool
}{RowChanged
}{\param{unsigned int
}{row
}}
172 Call this if the values of this row have been changed.
174 \membersection{wxDataViewListModel::RowDeleted
}\label{wxdataviewlistmodelrowdeleted
}
176 \func{virtual bool
}{RowDeleted
}{\param{unsigned int
}{row
}}
178 Call this if this row has been deleted.
180 \membersection{wxDataViewListModel::RowInserted
}\label{wxdataviewlistmodelrowinserted
}
182 \func{virtual bool
}{RowInserted
}{\param{unsigned int
}{before
}}
184 Call this if a row has been inserted.
186 \membersection{wxDataViewListModel::RowPrepended
}\label{wxdataviewlistmodelrowprepended
}
188 \func{virtual bool
}{RowPrepended
}{\void}
190 Call this if a row has been prepended.
192 \membersection{wxDataViewListModel::RowsReordered
}\label{wxdataviewlistmodelrowsreordered
}
194 \func{virtual bool
}{RowsReordered
}{\param{unsigned int*
}{new
\_order}}
196 Call this if the rows have been reorderd.
198 \membersection{wxDataViewListModel::SetValue
}\label{wxdataviewlistmodelsetvalue
}
200 \func{virtual bool
}{SetValue
}{\param{wxVariant\&
}{variant
},
\param{unsigned int
}{col
},
\param{unsigned int
}{row
}}
202 This method gets called by e.g. the wxDataViewCtrl class if a
203 value has been changed through its graphical interface. You
204 need to override this method in order to update the data in
205 the underlying data structur. Afterwards,
206 \helpref{ValueChanged
}{wxdataviewlistmodelvaluechanged
} is called.
209 \membersection{wxDataViewListModel::ValueChanged
}\label{wxdataviewlistmodelvaluechanged
}
211 \func{virtual bool
}{ValueChanged
}{\param{unsigned int
}{col
},
\param{unsigned int
}{row
}}
213 Call this if a value in the model has been changed.
216 \section{\class{wxDataViewSortedListModel
}}\label{wxdataviewsortedlistmodel
}
218 This class is used for sorting data. It does not contain any
219 data itself. Rather, it provides a sorted interface for
222 Currently, the sorting algorithm isn't thread safe. This needs
225 \wxheading{Derived from
}
227 \helpref{wxDataViewListModel
}{wxdataviewlistmodel
}\\
228 \helpref{wxDataViewModel
}{wxdataviewmodel
}\\
229 \helpref{wxObject
}{wxobject
}
231 \wxheading{Include files
}
235 \membersection{wxDataViewSortedListModel::wxDataViewSortedListModel
}\label{wxdataviewsortedlistmodelwxdataviewsortedlistmodel
}
237 \func{}{wxDataViewSortedListModel
}{\param{wxDataViewListModel*
}{child
}}
239 Constructor.
{\it child
} is the child data model the data of
240 which this model is supposed to present in a sorted way.
242 \membersection{wxDataViewSortedListModel::
\destruct{wxDataViewSortedListModel
}}\label{wxdataviewsortedlistmodeldtor
}
244 \func{}{\destruct{wxDataViewSortedListModel
}}{\void}
248 \membersection{wxDataViewSortedListModel::GetAscending
}\label{wxdataviewsortedlistmodelgetascending
}
250 \func{bool
}{GetAscending
}{\void}
252 Returns true if the data is sorted in ascending order.
254 \membersection{wxDataViewSortedListModel::Resort
}\label{wxdataviewsortedlistmodelresort
}
256 \func{void
}{Resort
}{\void}
258 Tell the model to resort its data.
260 \membersection{wxDataViewSortedListModel::SetAscending
}\label{wxdataviewsortedlistmodelsetascending
}
262 \func{void
}{SetAscending
}{\param{bool
}{ascending
}}
264 Set the sort order of the data.