.. 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.richtext.RichTextDrawingContext:

==========================================================================================================================================
|phoenix_title|  **wx.richtext.RichTextDrawingContext**
==========================================================================================================================================

A class for passing information to drawing and measuring functions.          







         



.. seealso:: :ref:`wx.richtext.RichTextBuffer`, :ref:`wx.richtext.RichTextCtrl`    







|

|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>RichTextDrawingContext</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.richtext.RichTextDrawingContext_inheritance.png" alt="Inheritance diagram of RichTextDrawingContext" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.Object.html" title="wx.Object" alt="" coords="87,5,168,35"/> <area shape="rect" id="node2" href="wx.richtext.RichTextDrawingContext.html" title="wx.richtext.RichTextDrawingContext" alt="" coords="5,83,251,112"/> </map> 
   </p>

|


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

================================================================================ ================================================================================
:meth:`~wx.richtext.RichTextDrawingContext.__init__`                             Pass the buffer to the context so the context can retrieve information such as virtual attributes.
:meth:`~wx.richtext.RichTextDrawingContext.ApplyVirtualAttributes`               Applies any virtual attributes relevant to this object.
:meth:`~wx.richtext.RichTextDrawingContext.EnableVirtualAttributes`              Enables virtual attribute processing.
:meth:`~wx.richtext.RichTextDrawingContext.GetVirtualAttributes`                 Returns the virtual attributes for this object.
:meth:`~wx.richtext.RichTextDrawingContext.GetVirtualAttributesEnabled`          Returns ``True`` if virtual attribute processing is enabled.
:meth:`~wx.richtext.RichTextDrawingContext.GetVirtualSubobjectAttributes`        Gets the mixed virtual attributes for individual positions within the object.
:meth:`~wx.richtext.RichTextDrawingContext.GetVirtualSubobjectAttributesCount`   Gets the count for mixed virtual attributes for individual positions within the object.
:meth:`~wx.richtext.RichTextDrawingContext.GetVirtualText`                       Gets the virtual text for this object.
:meth:`~wx.richtext.RichTextDrawingContext.HasVirtualAttributes`                 Does this object have virtual attributes? Virtual attributes can be provided for visual cues without affecting the actual styling.
:meth:`~wx.richtext.RichTextDrawingContext.HasVirtualText`                       Do we have virtual text for this object? Virtual text allows an application to replace characters in an object for editing and display purposes, for example for highlighting special characters.
:meth:`~wx.richtext.RichTextDrawingContext.Init`                                 
================================================================================ ================================================================================


|


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

================================================================================ ================================================================================
:attr:`~wx.richtext.RichTextDrawingContext.VirtualAttributesEnabled`             See :meth:`~wx.richtext.RichTextDrawingContext.GetVirtualAttributesEnabled`
:attr:`~wx.richtext.RichTextDrawingContext.m_buffer`                             A public C++ attribute of type :ref:`~wx.richtext.RichTextBuffer`.
================================================================================ ================================================================================


|


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


.. class:: wx.richtext.RichTextDrawingContext(Object)

   **Possible constructors**::

       RichTextDrawingContext(buffer)
       
   
   A class for passing information to drawing and measuring functions.



   .. method:: __init__(self, buffer)

      Pass the buffer to the context so the context can retrieve information such as virtual attributes.                  


      :param `buffer`: 
      :type `buffer`: wx.richtext.RichTextBuffer







   .. method:: ApplyVirtualAttributes(self, attr, obj)

      Applies any virtual attributes relevant to this object.                  


      :param `attr`: 
      :type `attr`: wx.richtext.RichTextAttr
      :param `obj`: 
      :type `obj`: wx.richtext.RichTextObject




      :rtype: `bool`








   .. method:: EnableVirtualAttributes(self, b)

      Enables virtual attribute processing.                  


      :param `b`: 
      :type `b`: bool







   .. method:: GetVirtualAttributes(self, obj)

      Returns the virtual attributes for this object.                  

      Virtual attributes can be provided for visual cues without affecting the actual styling.                  


      :param `obj`: 
      :type `obj`: wx.richtext.RichTextObject




      :rtype: :ref:`wx.richtext.RichTextAttr`








   .. method:: GetVirtualAttributesEnabled(self)

      Returns ``True`` if virtual attribute processing is enabled.                  

      :rtype: `bool`








   .. method:: GetVirtualSubobjectAttributes(self, obj, positions, attributes)

      Gets the mixed virtual attributes for individual positions within the object.                  

      For example, individual characters within a text object may require special highlighting. The function is passed the count returned by GetVirtualSubobjectAttributesCount.                  


      :param `obj`: 
      :type `obj`: wx.richtext.RichTextObject
      :param `positions`: 
      :type `positions`: list of integers
      :param `attributes`: 
      :type `attributes`: RichTextAttrArray




      :rtype: `int`








   .. method:: GetVirtualSubobjectAttributesCount(self, obj)

      Gets the count for mixed virtual attributes for individual positions within the object.                  

      For example, individual characters within a text object may require special highlighting.                  


      :param `obj`: 
      :type `obj`: wx.richtext.RichTextObject




      :rtype: `int`








   .. method:: GetVirtualText(self, obj, text)

      Gets the virtual text for this object.                  


      :param `obj`: 
      :type `obj`: wx.richtext.RichTextPlainText
      :param `text`: 
      :type `text`: string




      :rtype: `bool`








   .. method:: HasVirtualAttributes(self, obj)

      Does this object have virtual attributes? Virtual attributes can be provided for visual cues without affecting the actual styling.                  


      :param `obj`: 
      :type `obj`: wx.richtext.RichTextObject




      :rtype: `bool`








   .. method:: HasVirtualText(self, obj)

      Do we have virtual text for this object? Virtual text allows an application to replace characters in an object for editing and display purposes, for example for highlighting special characters.                  


      :param `obj`: 
      :type `obj`: wx.richtext.RichTextPlainText




      :rtype: `bool`








   .. method:: Init(self)






   .. attribute:: VirtualAttributesEnabled

      See :meth:`~wx.richtext.RichTextDrawingContext.GetVirtualAttributesEnabled`


   .. attribute:: m_buffer

      A public C++ attribute of type :ref:`~wx.richtext.RichTextBuffer`.

