wx.dataview.DataViewListModel¶
Base class with abstract API for wx.dataview.DataViewIndexListModel and wx.dataview.DataViewVirtualListModel.
Class Hierarchy¶
Known Subclasses¶
wx.dataview.DataViewIndexListModel, wx.dataview.DataViewVirtualListModel
Methods Summary¶
Compare method that sorts the items by their index. |
|
Override this to indicate that the row has special font attributes. |
|
Returns the number of items (or rows) in the list. |
|
Returns the position of given item. |
|
Override this to allow getting values from the model. |
|
Override this if you want to disable specific items. |
|
Called in order to set a value in the model. |
Properties Summary¶
See |
Class API¶
- class wx.dataview.DataViewListModel(DataViewModel)¶
Base class with abstract API for DataViewIndexListModel and DataViewVirtualListModel.
Methods¶
- Compare(self, item1, item2, column, ascending)¶
Compare method that sorts the items by their index.
- Parameters:
item1 (wx.dataview.DataViewItem)
item2 (wx.dataview.DataViewItem)
column (int)
ascending (bool)
- Return type:
int
- GetAttrByRow(self, row, col, attr)¶
Override this to indicate that the row has special font attributes.
This only affects the DataViewTextRendererText() renderer.
The base class version always simply returns
False
.- Parameters:
row (int) – The row for which the attribute is requested.
col (int) – The column for which the attribute is requested.
attr (wx.dataview.DataViewItemAttr) – The attribute to be filled in if the function returns
True
.
- Return type:
bool
- Returns:
True
if this item has an attribute orFalse
otherwise.
See also
- GetCount(self)¶
Returns the number of items (or rows) in the list.
- Return type:
int
- GetRow(self, item)¶
Returns the position of given item.
- Parameters:
item (wx.dataview.DataViewItem)
- Return type:
int
- GetValueByRow(self, row, col)¶
Override this to allow getting values from the model.
- Parameters:
row (int)
col (int)
- Return type:
DVCVariant
- IsEnabledByRow(self, row, col)¶
Override this if you want to disable specific items.
The base class version always returns
True
, thus making all items enabled by default.- Parameters:
row (int) – The row of the item whose enabled status is requested.
col (int) – The column of the item whose enabled status is requested.
- Return type:
bool
- Returns:
True
if the item at this row and column should be enabled,False
otherwise.
Added in version 2.9.2.
Note
See
wx.dataview.DataViewModel.IsEnabled
for the current status of support for disabling the items under different platforms.
- SetValueByRow(self, variant, row, col)¶
Called in order to set a value in the model.
- Parameters:
variant (DVCVariant)
row (int)
col (int)
- Return type:
bool
Properties¶