.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. _wx.dataview.DataViewListModel:
==========================================================================================================================================
|phoenix_title| **wx.dataview.DataViewListModel**
==========================================================================================================================================
Base class with abstract API for :ref:`wx.dataview.DataViewIndexListModel` and :ref:`wx.dataview.DataViewVirtualListModel`.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
DataViewListModel:
|
|sub_classes| Known Subclasses
==============================
:ref:`wx.dataview.DataViewIndexListModel`, :ref:`wx.dataview.DataViewVirtualListModel`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.dataview.DataViewListModel.Compare` Compare method that sorts the items by their index.
:meth:`~wx.dataview.DataViewListModel.GetAttrByRow` Override this to indicate that the row has special font attributes.
:meth:`~wx.dataview.DataViewListModel.GetCount` Returns the number of items (or rows) in the list.
:meth:`~wx.dataview.DataViewListModel.GetRow` Returns the position of given `item`.
:meth:`~wx.dataview.DataViewListModel.GetValueByRow` Override this to allow getting values from the model.
:meth:`~wx.dataview.DataViewListModel.IsEnabledByRow` Override this if you want to disable specific items.
:meth:`~wx.dataview.DataViewListModel.SetValueByRow` Called in order to set a value in the model.
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.dataview.DataViewListModel.Count` See :meth:`~wx.dataview.DataViewListModel.GetCount`
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.dataview.DataViewListModel(DataViewModel)
Base class with abstract API for DataViewIndexListModel and
DataViewVirtualListModel.
.. method:: Compare(self, item1 : DataViewItem, item2 : DataViewItem, column : int, ascending : bool)
Compare method that sorts the items by their index.
:param `item1`:
:type `item1`: wx.dataview.DataViewItem
:param `item2`:
:type `item2`: wx.dataview.DataViewItem
:param `column`:
:type `column`: int
:param `ascending`:
:type `ascending`: bool
:rtype: `int`
.. method:: GetAttrByRow(self, row : int, col : int, attr : DataViewItemAttr)
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``.
:param `row`: The row for which the attribute is requested.
:type `row`: int
:param `col`: The column for which the attribute is requested.
:type `col`: int
:param `attr`: The attribute to be filled in if the function returns ``True``.
:type `attr`: wx.dataview.DataViewItemAttr
:rtype: `bool`
:returns:
``True`` if this item has an attribute or ``False`` otherwise.
.. seealso:: :ref:`wx.dataview.DataViewItemAttr`.
.. method:: GetCount(self)
Returns the number of items (or rows) in the list.
:rtype: `int`
.. method:: GetRow(self, item : DataViewItem)
Returns the position of given `item`.
:param `item`:
:type `item`: wx.dataview.DataViewItem
:rtype: `int`
.. method:: GetValueByRow(self, row : int, col : int)
Override this to allow getting values from the model.
:param `row`:
:type `row`: int
:param `col`:
:type `col`: int
:rtype: `DVCVariant`
.. method:: IsEnabledByRow(self, row : int, col : int)
Override this if you want to disable specific items.
The base class version always returns ``True``, thus making all items enabled by default.
:param `row`: The row of the item whose enabled status is requested.
:type `row`: int
:param `col`: The column of the item whose enabled status is requested.
:type `col`: int
:rtype: `bool`
:returns:
``True`` if the item at this row and column should be enabled, ``False`` otherwise.
.. versionadded:: 2.9.2
.. note::
See :meth:`wx.dataview.DataViewModel.IsEnabled` for the current status of support for disabling the items under different platforms.
.. method:: SetValueByRow(self, variant : DVCVariant, row : int, col : int)
Called in order to set a value in the model.
:param `variant`:
:type `variant`: DVCVariant
:param `row`:
:type `row`: int
:param `col`:
:type `col`: int
:rtype: `bool`
.. attribute:: Count
See :meth:`~wx.dataview.DataViewListModel.GetCount`