X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b6b9d5562cd4aaa36211831c1875366a4dface18..a236aa2058ccf3d36e9cafc20fa7375080c4be50:/docs/latex/wx/dataviewmodel.tex diff --git a/docs/latex/wx/dataviewmodel.tex b/docs/latex/wx/dataviewmodel.tex index fb8a80c79f..4a00cfce13 100644 --- a/docs/latex/wx/dataviewmodel.tex +++ b/docs/latex/wx/dataviewmodel.tex @@ -13,7 +13,7 @@ of the abstract wxDataViewModel. \wxheading{Derived from} -\helpref{wxObject}{wxobject} +\helpref{wxObjectRefData}{wxobjectrefdata} \wxheading{Include files} @@ -23,11 +23,13 @@ of the abstract wxDataViewModel. \func{}{wxDataViewModel}{\void} +Constructor. \membersection{wxDataViewModel::\destruct{wxDataViewModel}}\label{wxdataviewmodeldtor} \func{}{\destruct{wxDataViewModel}}{\void} +Destructor. \section{\class{wxDataViewListModel}}\label{wxdataviewlistmodel} @@ -37,10 +39,43 @@ to define a table like data model to be displayed by a \helpref{wxDataViewCtrl}{wxdataviewctrl}. You need to derive from this class to define your own data model. +You need to override \helpref{GetRowCount}{wxdataviewlistmodelgetrowcount}, +\helpref{GetColumnCount}{wxdataviewlistmodelgetcolumncount}, +\helpref{GetColumnType}{wxdataviewlistmodelgetcolumntype} and +\helpref{GetValue}{wxdataviewlistmodelgetvalue} in order to +define the data model (which acts as an interface between +your actual data and the wxDataViewCtrl). Since you will +usually also allow the wxDataViewCtrl to change your data +through its graphical interface, you will also have to override +\helpref{SetValue}{wxdataviewlistmodelsetvalue} which the +wxDataViewCtrl will call when a change to some data has been +commited. + +The data that is presented through this data model is expected +to change at run-time. You need to inform the data model that +a change happens. Depending on what happened you need to call +one of the following methods: +\helpref{ValueChanged}{wxdataviewlistmodelvaluechanged}, +\helpref{RowChanged}{wxdataviewlistmodelrowchanged}, +\helpref{RowAppended}{wxdataviewlistmodelrowappended}, +\helpref{RowPrepended}{wxdataviewlistmodelrowprepended}, +\helpref{RowInserted}{wxdataviewlistmodelrowinserted}, +\helpref{RowDeleted}{wxdataviewlistmodelrowdeleted}, +\helpref{RowsReordered}{wxdataviewlistmodelrowsreordered} or +\helpref{RowsCleared}{wxdataviewlistmodelcleared}. + + + +wxDataViewModel and this class (as indeed the entire wxDataViewCtrl +code) is using \helpref{wxVariant}{wxvariant} to store data and +its type in a generic way. wxVariant can be extended to contain +almost any data without changes to the original class. + This class maintains a list of \helpref{wxDataListViewListModelNotifier}{wxdataviewlistmodelnotifier} which link this class to the specific implementations on the -supported platforms so that e.g. calling {\it ValueChanged()} +supported platforms so that e.g. calling +\helpref{ValueChanged}{wxdataviewlistmodelvaluechanged} on this model will just call \helpref{wxDataListViewListModelNotifier::ValueChanged}{wxdataviewlistmodelnotifiervaluechanged} for each notifier that has been added. This is used both for @@ -56,7 +91,8 @@ mostly used internally. \wxheading{Derived from} -\helpref{wxDataViewModel}{wxdataviewmodel} +\helpref{wxDataViewModel}{wxdataviewmodel}\\ +\helpref{wxObject}{wxobject} \wxheading{Include files} @@ -67,11 +103,13 @@ mostly used internally. \func{}{wxDataViewListModel}{\void} +Constructor. \membersection{wxDataViewListModel::\destruct{wxDataViewListModel}}\label{wxdataviewlistmodeldtor} \func{}{\destruct{wxDataViewListModel}}{\void} +Destructor. \membersection{wxDataViewListModel::AddNotifier}\label{wxdataviewlistmodeladdnotifier} @@ -79,23 +117,22 @@ mostly used internally. Adds {\it notifier} to the internal list of notifers. -See also \helpref{RemoveNotifier}{{wxdataviewlistmodelremovenotifier}. +See also \helpref{RemoveNotifier}{wxdataviewlistmodelremovenotifier}. -\membersection{wxDataViewListModel::AddViewingColumn}\label{wxdataviewlistmodeladdviewingcolumn} +\membersection{wxDataViewListModel::Cleared}\label{wxdataviewlistmodelcleared} -\func{void}{AddViewingColumn}{\param{wxDataViewColumn* }{view\_column}, \param{unsigned int }{model\_column}} +\func{bool}{virtual Cleared}{\void} -Used internally. Used for maintaining a list of -\helpref{wxDataViewColumn}{wxdataviewcolumn} that -display a certain column of this model. +Call this if all data in your model has been cleared. -\membersection{wxDataViewListModel::Cleared}\label{wxdataviewlistmodelcleared} +\membersection{wxDataViewListModel::GetColumnCount}\label{wxdataviewlistmodelgetcolumncount} -\func{bool}{Cleared}{\void} +\func{virtual unsigned int}{GetColumnCount}{\void} -Call this if all data in your model has been cleared. +Override this to indicate, how many columns the list +model has. -\membersection{wxDataViewListModel::GetColType}\label{wxdataviewlistmodelgetcoltype} +\membersection{wxDataViewListModel::GetColumnType}\label{wxdataviewlistmodelgetcolumntype} \func{virtual wxString}{GetColType}{\param{unsigned int }{col}} @@ -103,16 +140,9 @@ Override this to indicate what type of data is stored in the column specified by {\it col}. This should return a string indicating the type of data as reported by \helpref{wxVariant}{wxvariant}. -\membersection{wxDataViewListModel::GetNumberOfCols}\label{wxdataviewlistmodelgetnumberofcols} - -\func{virtual unsigned int}{GetNumberOfCols}{\void} - -Override this to indicate, how many columns the list -model has. - -\membersection{wxDataViewListModel::GetNumberOfRows}\label{wxdataviewlistmodelgetnumberofrows} +\membersection{wxDataViewListModel::GetRowCount}\label{wxdataviewlistmodelgetrowcount} -\func{virtual unsigned int}{GetNumberOfRows}{\void} +\func{virtual unsigned int}{GetRowCount}{\void} Override this to indicate, how many rows the list model has. @@ -131,15 +161,7 @@ is used to store the data. Removes the notifier from the list of notifiers. -See also \helpref{AddNotifier}{{wxdataviewlistmodeladdnotifier}. - -\membersection{wxDataViewListModel::RemoveViewingColumn}\label{wxdataviewlistmodelremoveviewingcolumn} - -\func{void}{RemoveViewingColumn}{\param{wxDataViewColumn* }{column}} - -Used internally. Used for maintaining a list of -\helpref{wxDataViewColumn}{wxdataviewcolumn} that -display a certain column of this model. +See also \helpref{AddNotifier}{wxdataviewlistmodeladdnotifier}. \membersection{wxDataViewListModel::RowAppended}\label{wxdataviewlistmodelrowappended} @@ -179,7 +201,7 @@ Call this if the rows have been reorderd. \membersection{wxDataViewListModel::SetValue}\label{wxdataviewlistmodelsetvalue} -\func{virtual bool}{SetValue}{\param{wxVariant\& }{variant}, \param{unsigned int }{col}, \param{unsigned int }{row}} +\func{virtual bool}{SetValue}{\param{const wxVariant\& }{variant}, \param{unsigned int }{col}, \param{unsigned int }{row}} This method gets called by e.g. the wxDataViewCtrl class if a value has been changed through its graphical interface. You @@ -206,7 +228,9 @@ to be fixed. \wxheading{Derived from} -\helpref{wxDataViewListModel}{wxdataviewlistmodel} +\helpref{wxDataViewListModel}{wxdataviewlistmodel}\\ +\helpref{wxDataViewModel}{wxdataviewmodel}\\ +\helpref{wxObject}{wxobject} \wxheading{Include files}