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 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.
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.
59 \wxheading{Derived from
}
61 \helpref{wxDataViewModel
}{wxdataviewmodel
}
63 \wxheading{Include files
}
68 \membersection{wxDataViewListModel::wxDataViewListModel
}\label{wxdataviewlistmodelwxdataviewlistmodel
}
70 \func{}{wxDataViewListModel
}{\void}
74 \membersection{wxDataViewListModel::
\destruct{wxDataViewListModel
}}\label{wxdataviewlistmodeldtor
}
76 \func{}{\destruct{wxDataViewListModel
}}{\void}
80 \membersection{wxDataViewListModel::AddNotifier
}\label{wxdataviewlistmodeladdnotifier
}
82 \func{void
}{AddNotifier
}{\param{wxDataViewListModelNotifier*
}{notifier
}}
84 Adds
{\it notifier
} to the internal list of notifers.
86 See also
\helpref{RemoveNotifier
}{wxdataviewlistmodelremovenotifier
}.
88 \membersection{wxDataViewListModel::AddViewingColumn
}\label{wxdataviewlistmodeladdviewingcolumn
}
90 \func{void
}{AddViewingColumn
}{\param{wxDataViewColumn*
}{view
\_column},
\param{unsigned int
}{model
\_column}}
92 Used internally. Used for maintaining a list of
93 \helpref{wxDataViewColumn
}{wxdataviewcolumn
} that
94 display a certain column of this model.
96 \membersection{wxDataViewListModel::Cleared
}\label{wxdataviewlistmodelcleared
}
98 \func{bool
}{virtual Cleared
}{\void}
100 Call this if all data in your model has been cleared.
102 \membersection{wxDataViewListModel::GetColType
}\label{wxdataviewlistmodelgetcoltype
}
104 \func{virtual wxString
}{GetColType
}{\param{unsigned int
}{col
}}
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
}.
110 \membersection{wxDataViewListModel::GetNumberOfCols
}\label{wxdataviewlistmodelgetnumberofcols
}
112 \func{virtual unsigned int
}{GetNumberOfCols
}{\void}
114 Override this to indicate, how many columns the list
117 \membersection{wxDataViewListModel::GetNumberOfRows
}\label{wxdataviewlistmodelgetnumberofrows
}
119 \func{virtual unsigned int
}{GetNumberOfRows
}{\void}
121 Override this to indicate, how many rows the list
124 \membersection{wxDataViewListModel::GetValue
}\label{wxdataviewlistmodelgetvalue
}
126 \func{virtual void
}{GetValue
}{\param{wxVariant\&
}{variant
},
\param{unsigned int
}{col
},
\param{unsigned int
}{row
}}
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.
132 \membersection{wxDataViewListModel::RemoveNotifier
}\label{wxdataviewlistmodelremovenotifier
}
134 \func{void
}{RemoveNotifier
}{\param{wxDataViewListModelNotifier*
}{notifier
}}
136 Removes the notifier from the list of notifiers.
138 See also
\helpref{AddNotifier
}{wxdataviewlistmodeladdnotifier
}.
140 \membersection{wxDataViewListModel::RemoveViewingColumn
}\label{wxdataviewlistmodelremoveviewingcolumn
}
142 \func{void
}{RemoveViewingColumn
}{\param{wxDataViewColumn*
}{column
}}
144 Used internally. Used for maintaining a list of
145 \helpref{wxDataViewColumn
}{wxdataviewcolumn
} that
146 display a certain column of this model.
148 \membersection{wxDataViewListModel::RowAppended
}\label{wxdataviewlistmodelrowappended
}
150 \func{virtual bool
}{RowAppended
}{\void}
152 Call this if a row has been appended to the list model.
154 \membersection{wxDataViewListModel::RowChanged
}\label{wxdataviewlistmodelrowchanged
}
156 \func{virtual bool
}{RowChanged
}{\param{unsigned int
}{row
}}
158 Call this if the values of this row have been changed.
160 \membersection{wxDataViewListModel::RowDeleted
}\label{wxdataviewlistmodelrowdeleted
}
162 \func{virtual bool
}{RowDeleted
}{\param{unsigned int
}{row
}}
164 Call this if this row has been deleted.
166 \membersection{wxDataViewListModel::RowInserted
}\label{wxdataviewlistmodelrowinserted
}
168 \func{virtual bool
}{RowInserted
}{\param{unsigned int
}{before
}}
170 Call this if a row has been inserted.
172 \membersection{wxDataViewListModel::RowPrepended
}\label{wxdataviewlistmodelrowprepended
}
174 \func{virtual bool
}{RowPrepended
}{\void}
176 Call this if a row has been prepended.
178 \membersection{wxDataViewListModel::RowsReordered
}\label{wxdataviewlistmodelrowsreordered
}
180 \func{virtual bool
}{RowsReordered
}{\param{unsigned int*
}{new
\_order}}
182 Call this if the rows have been reorderd.
184 \membersection{wxDataViewListModel::SetValue
}\label{wxdataviewlistmodelsetvalue
}
186 \func{virtual bool
}{SetValue
}{\param{wxVariant\&
}{variant
},
\param{unsigned int
}{col
},
\param{unsigned int
}{row
}}
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.
195 \membersection{wxDataViewListModel::ValueChanged
}\label{wxdataviewlistmodelvaluechanged
}
197 \func{virtual bool
}{ValueChanged
}{\param{unsigned int
}{col
},
\param{unsigned int
}{row
}}
199 Call this if a value in the model has been changed.
202 \section{\class{wxDataViewSortedListModel
}}\label{wxdataviewsortedlistmodel
}
204 This class is used for sorting data. It does not contain any
205 data itself. Rather, it provides a sorted interface for
208 Currently, the sorting algorithm isn't thread safe. This needs
211 \wxheading{Derived from
}
213 \helpref{wxDataViewListModel
}{wxdataviewlistmodel
}
215 \wxheading{Include files
}
219 \membersection{wxDataViewSortedListModel::wxDataViewSortedListModel
}\label{wxdataviewsortedlistmodelwxdataviewsortedlistmodel
}
221 \func{}{wxDataViewSortedListModel
}{\param{wxDataViewListModel*
}{child
}}
223 Constructor.
{\it child
} is the child data model the data of
224 which this model is supposed to present in a sorted way.
226 \membersection{wxDataViewSortedListModel::
\destruct{wxDataViewSortedListModel
}}\label{wxdataviewsortedlistmodeldtor
}
228 \func{}{\destruct{wxDataViewSortedListModel
}}{\void}
232 \membersection{wxDataViewSortedListModel::GetAscending
}\label{wxdataviewsortedlistmodelgetascending
}
234 \func{bool
}{GetAscending
}{\void}
236 Returns true if the data is sorted in ascending order.
238 \membersection{wxDataViewSortedListModel::Resort
}\label{wxdataviewsortedlistmodelresort
}
240 \func{void
}{Resort
}{\void}
242 Tell the model to resort its data.
244 \membersection{wxDataViewSortedListModel::SetAscending
}\label{wxdataviewsortedlistmodelsetascending
}
246 \func{void
}{SetAscending
}{\param{bool
}{ascending
}}
248 Set the sort order of the data.