$szTitle = "wxdataviewlistmodel"; include "./_header.inc"; ?>
wxdataviewlistmodel is currently the only existing variant of a wxdataviewmodel. it allows to define a table like data model to be displayed by a wxdataviewctrl. you need to derive from this class to define your own data model.
you need to override getnumberofrows, getnumberofcols, getcoltype and getvalue 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 setvalue 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: valuechanged, rowchanged, rowappended, rowprepended, rowinserted, rowdeleted, rowsreordered or rowscleared.
wxdataviewmodel and this class (as indeed the entire wxdataviewctrl code) is using 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 wxdatalistviewlistmodelnotifier which link this class to the specific implementations on the supported platforms so that e.g. calling valuechanged on this model will just call wxdatalistviewlistmodelnotifier::valuechanged for each notifier that has been added. this is used both for informing the native controls to redraw themselves and for informing e.g. the wxdataviewsortedlistmodel to resort itself. you can also add your own notifier in order to get informed about any changes to the data in the list model.
additionally, this class maintains a list of all wxdataviewcolumns which display a certain column of this list model. this is mostly used internally.
derived from
include files
<wx/dataview.h>
wxdataviewlistmodel::wxdataviewlistmodel
wxdataviewlistmodel::~wxdataviewlistmodel
wxdataviewlistmodel::addnotifier
wxdataviewlistmodel::addviewingcolumn
wxdataviewlistmodel::cleared
wxdataviewlistmodel::getcoltype
wxdataviewlistmodel::getnumberofcols
wxdataviewlistmodel::getnumberofrows
wxdataviewlistmodel::getvalue
wxdataviewlistmodel::removenotifier
wxdataviewlistmodel::removeviewingcolumn
wxdataviewlistmodel::rowappended
wxdataviewlistmodel::rowchanged
wxdataviewlistmodel::rowdeleted
wxdataviewlistmodel::rowinserted
wxdataviewlistmodel::rowprepended
wxdataviewlistmodel::rowsreordered
wxdataviewlistmodel::setvalue
wxdataviewlistmodel::valuechanged
wxdataviewlistmodel()
constructor.
~wxdataviewlistmodel()
destructor.
void addnotifier(wxdataviewlistmodelnotifier* notifier)
adds notifier to the internal list of notifers.
see also removenotifier.
void addviewingcolumn(wxdataviewcolumn* view_column, unsigned int model_column)
used internally. used for maintaining a list of wxdataviewcolumn that display a certain column of this model.
bool virtual cleared()
call this if all data in your model has been cleared.
virtual wxstring getcoltype(unsigned int col)
override this to indicate what type of data is stored in the column specified by col. this should return a string indicating the type of data as reported by wxvariant.
virtual unsigned int getnumberofcols()
override this to indicate, how many columns the list model has.
virtual unsigned int getnumberofrows()
override this to indicate, how many rows the list model has.
virtual void getvalue(wxvariant& variant, unsigned int col, unsigned int row)
override this to indicate the value of a given value in the list model. a wxvariant is used to store the data.
void removenotifier(wxdataviewlistmodelnotifier* notifier)
removes the notifier from the list of notifiers.
see also addnotifier.
void removeviewingcolumn(wxdataviewcolumn* column)
used internally. used for maintaining a list of wxdataviewcolumn that display a certain column of this model.
virtual bool rowappended()
call this if a row has been appended to the list model.
virtual bool rowchanged(unsigned int row)
call this if the values of this row have been changed.
virtual bool rowdeleted(unsigned int row)
call this if this row has been deleted.
virtual bool rowinserted(unsigned int before)
call this if a row has been inserted.
virtual bool rowprepended()
call this if a row has been prepended.
virtual bool rowsreordered(unsigned int* new_order)
call this if the rows have been reorderd.
virtual bool setvalue(wxvariant& variant, unsigned int col, unsigned int row)
this method gets called by e.g. the wxdataviewctrl class if a value has been changed through its graphical interface. you need to override this method in order to update the data in the underlying data structur. afterwards, valuechanged is called.
virtual bool valuechanged(unsigned int col, unsigned int row)
call this if a value in the model has been changed.
include "./_footer.inc"; ?>