.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2017 by Total Control Software License: wxWindows License .. include:: headings.inc .. _wx.grid.GridCellAttrProvider: ========================================================================================================================================== |phoenix_title| **wx.grid.GridCellAttrProvider** ========================================================================================================================================== Class providing attributes to be used for the grid cells. This class both defines an interface which grid cell attributes providers should implement An object of this class can be associated with a :ref:`wx.grid.Grid` using :meth:`wx.grid.GridTableBase.SetAttrProvider` but it's not necessary to call it if you intend to use the default provider as it is used by :ref:`wx.grid.GridTableBase` by default anyhow. Notice that while attributes provided by this class can be set for individual cells using :meth:`~wx.grid.GridCellAttrProvider.SetAttr` or the entire rows or columns using :meth:`~wx.grid.GridCellAttrProvider.SetRowAttr` and :meth:`~wx.grid.GridCellAttrProvider.SetColAttr` they are always retrieved using :meth:`~wx.grid.GridCellAttrProvider.GetAttr` function. The default implementation of this class stores the attributes passed to its :meth:`~wx.grid.GridCellAttrProvider.SetAttr`, :meth:`~wx.grid.GridCellAttrProvider.SetRowAttr` and :meth:`~wx.grid.GridCellAttrProvider.SetColAttr` in a straightforward way. A derived class may use its knowledge about how the attributes are used in your program to implement it much more efficiently: for example, using a special background colour for all even-numbered rows can be implemented by simply returning the same attribute from :meth:`~wx.grid.GridCellAttrProvider.GetAttr` if the row number is even instead of having to store N/2 row attributes where N is the total number of rows in the grid. Notice that objects of this class can't be copied. | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class GridCellAttrProvider:

| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.grid.GridCellAttrProvider.__init__` Trivial default constructor. :meth:`~wx.grid.GridCellAttrProvider.GetAttr` Get the attribute to use for the specified cell. :meth:`~wx.grid.GridCellAttrProvider.GetColumnHeaderRenderer` Return the renderer used for drawing column headers. :meth:`~wx.grid.GridCellAttrProvider.GetCornerRenderer` Return the renderer used for drawing the corner window. :meth:`~wx.grid.GridCellAttrProvider.GetRowHeaderRenderer` Return the renderer used for drawing row headers. :meth:`~wx.grid.GridCellAttrProvider.SetAttr` Set attribute for the specified cell. :meth:`~wx.grid.GridCellAttrProvider.SetColAttr` Set attribute for the specified column. :meth:`~wx.grid.GridCellAttrProvider.SetRowAttr` Set attribute for the specified row. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.grid.GridCellAttrProvider.CornerRenderer` See :meth:`~wx.grid.GridCellAttrProvider.GetCornerRenderer` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: wx.grid.GridCellAttrProvider(ClientDataContainer) **Possible constructors**:: GridCellAttrProvider() Class providing attributes to be used for the grid cells. .. method:: __init__(self) Trivial default constructor. .. method:: GetAttr(self, row, col, kind) Get the attribute to use for the specified cell. If :meth:`wx.grid.GridCellAttr.Any` is used as `kind` value, this function combines the attributes set for this cell using :meth:`SetAttr` and those for its row or column (set with :meth:`SetRowAttr` or :meth:`SetColAttr` respectively), with the cell attribute having the highest precedence. Notice that the caller must call DecRef() on the returned pointer if it is not ``None``. :param `row`: The row of the cell. :type `row`: int :param `col`: The column of the cell. :type `col`: int :param `kind`: The kind of the attribute to return. :type `kind`: GridCellAttr.wxAttrKind :rtype: :ref:`wx.grid.GridCellAttr` :returns: The attribute to use which should be DecRef()'d by caller or ``None`` if no attributes are defined for this cell. .. method:: GetColumnHeaderRenderer(self, col) Return the renderer used for drawing column headers. By default :ref:`wx.grid.GridColumnHeaderRendererDefault` is returned. :param `col`: :type `col`: int :rtype: :ref:`wx.grid.GridColumnHeaderRenderer` .. versionadded:: 2.9.1 .. seealso:: :meth:`wx.grid.Grid.SetUseNativeColLabels` , :meth:`wx.grid.Grid.UseNativeColHeader` .. method:: GetCornerRenderer(self) Return the renderer used for drawing the corner window. By default :ref:`wx.grid.GridCornerHeaderRendererDefault` is returned. :rtype: :ref:`wx.grid.GridCornerHeaderRenderer` .. versionadded:: 2.9.1 .. method:: GetRowHeaderRenderer(self, row) Return the renderer used for drawing row headers. By default :ref:`wx.grid.GridRowHeaderRendererDefault` is returned. :param `row`: :type `row`: int :rtype: :ref:`wx.grid.GridRowHeaderRenderer` .. versionadded:: 2.9.1 .. method:: SetAttr(self, attr, row, col) Set attribute for the specified cell. :param `attr`: :type `attr`: wx.grid.GridCellAttr :param `row`: :type `row`: int :param `col`: :type `col`: int .. method:: SetColAttr(self, attr, col) Set attribute for the specified column. :param `attr`: :type `attr`: wx.grid.GridCellAttr :param `col`: :type `col`: int .. method:: SetRowAttr(self, attr, row) Set attribute for the specified row. :param `attr`: :type `attr`: wx.grid.GridCellAttr :param `row`: :type `row`: int .. attribute:: CornerRenderer See :meth:`~wx.grid.GridCellAttrProvider.GetCornerRenderer`