Phoenix Logo

phoenix_title wx.dataview.DataViewListModel

Base class with abstract API for wx.dataview.DataViewIndexListModel and wx.dataview.DataViewVirtualListModel.


class_hierarchy Class Hierarchy

Inheritance diagram for class DataViewListModel:


method_summary Methods Summary

Compare Compare method that sorts the items by their index.
GetAttrByRow Override this to indicate that the row has special font attributes.
GetCount Returns the number of items (or rows) in the list.
GetRow Returns the position of given item.
GetValueByRow Override this to allow getting values from the model.
IsEnabledByRow Override this if you want to disable specific items.
SetValueByRow Called in order to set a value in the model.

property_summary Properties Summary

Count See GetCount

api 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:
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 or False otherwise.



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:

variant



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.

New 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



Count

See GetCount