.. 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.DataViewItemAttr:

==========================================================================================================================================
|phoenix_title|  **wx.dataview.DataViewItemAttr**
==========================================================================================================================================

This class is used to indicate to a :ref:`wx.dataview.DataViewCtrl`  that a certain item (see :ref:`wx.dataview.DataViewItem`) has extra font attributes for its renderer.          

For this, it is required to override :meth:`wx.dataview.DataViewModel.GetAttr` . 

Attributes are currently only supported by DataViewTextRendererText. 









|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>DataViewItemAttr</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.dataview.DataViewItemAttr_inheritance.png" alt="Inheritance diagram of DataViewItemAttr" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.dataview.DataViewItemAttr.html" title="wx.dataview.DataViewItemAttr" alt="" coords="5,5,231,35"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.dataview.DataViewItemAttr.__init__`                                   Constructor.
:meth:`~wx.dataview.DataViewItemAttr.GetBackgroundColour`                        Returns the colour to be used for the background.
:meth:`~wx.dataview.DataViewItemAttr.GetBold`                                    Returns value of the bold property.
:meth:`~wx.dataview.DataViewItemAttr.GetColour`                                  Returns this attribute's colour.
:meth:`~wx.dataview.DataViewItemAttr.GetEffectiveFont`                           Return the font based on the given one with this attribute applied to it.
:meth:`~wx.dataview.DataViewItemAttr.GetItalic`                                  Returns value of the italics property.
:meth:`~wx.dataview.DataViewItemAttr.HasBackgroundColour`                        Returns ``True`` if the background colour property has been set.
:meth:`~wx.dataview.DataViewItemAttr.HasColour`                                  Returns ``True`` if the colour property has been set.
:meth:`~wx.dataview.DataViewItemAttr.HasFont`                                    Returns ``True`` if any property affecting the font has been set.
:meth:`~wx.dataview.DataViewItemAttr.IsDefault`                                  Returns ``True`` if none of the properties have been set.
:meth:`~wx.dataview.DataViewItemAttr.SetBackgroundColour`                        Call this to set the background colour to use.
:meth:`~wx.dataview.DataViewItemAttr.SetBold`                                    Call this to indicate that the item shall be displayed in bold text.
:meth:`~wx.dataview.DataViewItemAttr.SetColour`                                  Call this to indicate that the item shall be displayed with that colour.
:meth:`~wx.dataview.DataViewItemAttr.SetItalic`                                  Call this to indicate that the item shall be displayed in italic text.
:meth:`~wx.dataview.DataViewItemAttr.SetStrikethrough`                           Call this to indicate that the item shall be displayed in strikethrough text.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.dataview.DataViewItemAttr.BackgroundColour`                           See :meth:`~wx.dataview.DataViewItemAttr.GetBackgroundColour` and :meth:`~wx.dataview.DataViewItemAttr.SetBackgroundColour`
:attr:`~wx.dataview.DataViewItemAttr.Bold`                                       See :meth:`~wx.dataview.DataViewItemAttr.GetBold` and :meth:`~wx.dataview.DataViewItemAttr.SetBold`
:attr:`~wx.dataview.DataViewItemAttr.Colour`                                     See :meth:`~wx.dataview.DataViewItemAttr.GetColour` and :meth:`~wx.dataview.DataViewItemAttr.SetColour`
:attr:`~wx.dataview.DataViewItemAttr.Italic`                                     See :meth:`~wx.dataview.DataViewItemAttr.GetItalic` and :meth:`~wx.dataview.DataViewItemAttr.SetItalic`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.dataview.DataViewItemAttr(object)

   **Possible constructors**::

       DataViewItemAttr()
       
   
   This class is used to indicate to a DataViewCtrl that a certain item
   (see DataViewItem) has extra font attributes for its renderer.



   .. method:: __init__(self)

      Constructor.                   





   .. method:: GetBackgroundColour(self)

      Returns the colour to be used for the background.                  

      :rtype: :ref:`Colour`








   .. method:: GetBold(self)

      Returns value of the bold property.                  

      :rtype: `bool`








   .. method:: GetColour(self)

      Returns this attribute's colour.                  

      :rtype: :ref:`Colour`








   .. method:: GetEffectiveFont(self, font)

      Return the font based on the given one with this attribute applied to it.                  


      :param `font`: 
      :type `font`: wx.Font




      :rtype: :ref:`Font`








   .. method:: GetItalic(self)

      Returns value of the italics property.                  

      :rtype: `bool`








   .. method:: HasBackgroundColour(self)

      Returns ``True`` if the background colour property has been set.                  

      :rtype: `bool`








   .. method:: HasColour(self)

      Returns ``True`` if the colour property has been set.                  

      :rtype: `bool`








   .. method:: HasFont(self)

      Returns ``True`` if any property affecting the font has been set.                  

      :rtype: `bool`








   .. method:: IsDefault(self)

      Returns ``True`` if none of the properties have been set.                  

      :rtype: `bool`








   .. method:: SetBackgroundColour(self, colour)

      Call this to set the background colour to use.                  

                


      :param `colour`: 
      :type `colour`: wx.Colour






      .. versionadded:: 2.9.4 
         - Generic   







      .. versionadded:: 4.1/wxWidgets-3.1.1  
         - wxGTK   







      .. versionadded:: 4.1/wxWidgets-3.1.4  
         - wxOSX   








   .. method:: SetBold(self, set)

      Call this to indicate that the item shall be displayed in bold text.                  


      :param `set`: 
      :type `set`: bool







   .. method:: SetColour(self, colour)

      Call this to indicate that the item shall be displayed with that colour.                  


      :param `colour`: 
      :type `colour`: wx.Colour







   .. method:: SetItalic(self, set)

      Call this to indicate that the item shall be displayed in italic text.                  


      :param `set`: 
      :type `set`: bool







   .. method:: SetStrikethrough(self, set)

      Call this to indicate that the item shall be displayed in strikethrough text.                  

      Currently this attribute is only supported in the generic version of :ref:`wx.dataview.DataViewCtrl`  and GTK and ignored by the native macOS implementations. 

                


      :param `set`: 
      :type `set`: bool






      .. versionadded:: 4.1/wxWidgets-3.1.2  
     








   .. attribute:: BackgroundColour

      See :meth:`~wx.dataview.DataViewItemAttr.GetBackgroundColour` and :meth:`~wx.dataview.DataViewItemAttr.SetBackgroundColour`


   .. attribute:: Bold

      See :meth:`~wx.dataview.DataViewItemAttr.GetBold` and :meth:`~wx.dataview.DataViewItemAttr.SetBold`


   .. attribute:: Colour

      See :meth:`~wx.dataview.DataViewItemAttr.GetColour` and :meth:`~wx.dataview.DataViewItemAttr.SetColour`


   .. attribute:: Italic

      See :meth:`~wx.dataview.DataViewItemAttr.GetItalic` and :meth:`~wx.dataview.DataViewItemAttr.SetItalic`

