.. 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.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>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.richtext.RichTextDrawingContext.html" title="wx.richtext.RichTextDrawingContext" alt="" coords="5,83,264,112"/> <area shape="rect" id="node2" href="wx.Object.html" title="wx.Object" alt="" coords="91,5,178,35"/> </map> 
   </p>
   </div>

|


|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.EnableDelayedImageLoading`            Enable or disable delayed image loading.
:meth:`~wx.richtext.RichTextDrawingContext.EnableImages`                         Enable or disable images.
:meth:`~wx.richtext.RichTextDrawingContext.EnableVirtualAttributes`              Enables virtual attribute processing.
:meth:`~wx.richtext.RichTextDrawingContext.GetDelayedImageLoading`               Returns ``True`` if delayed image loading is enabled.
:meth:`~wx.richtext.RichTextDrawingContext.GetImagesEnabled`                     Returns ``True`` if images are enabled.
:meth:`~wx.richtext.RichTextDrawingContext.GetLayingOut`                         Returns ``True`` if laying out.
: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`                                 
:meth:`~wx.richtext.RichTextDrawingContext.SetLayingOut`                         Set laying out flag.
================================================================================ ================================================================================


|


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

================================================================================ ================================================================================
:attr:`~wx.richtext.RichTextDrawingContext.DelayedImageLoading`                  See :meth:`~wx.richtext.RichTextDrawingContext.GetDelayedImageLoading`
:attr:`~wx.richtext.RichTextDrawingContext.ImagesEnabled`                        See :meth:`~wx.richtext.RichTextDrawingContext.GetImagesEnabled`
:attr:`~wx.richtext.RichTextDrawingContext.LayingOut`                            See :meth:`~wx.richtext.RichTextDrawingContext.GetLayingOut` and :meth:`~wx.richtext.RichTextDrawingContext.SetLayingOut`
: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`.
:attr:`~wx.richtext.RichTextDrawingContext.m_enableDelayedImageLoading`          A public C++ attribute of type ``bool``.
:attr:`~wx.richtext.RichTextDrawingContext.m_enableImages`                       A public C++ attribute of type ``bool``.
:attr:`~wx.richtext.RichTextDrawingContext.m_enableVirtualAttributes`            A public C++ attribute of type ``bool``.
:attr:`~wx.richtext.RichTextDrawingContext.m_layingOut`                          A public C++ attribute of type ``bool``.
================================================================================ ================================================================================


|


|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:: EnableDelayedImageLoading(self, b)

      Enable or disable delayed image loading.                  


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







   .. method:: EnableImages(self, b)

      Enable or disable images.                  


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







   .. method:: EnableVirtualAttributes(self, b)

      Enables virtual attribute processing.                  


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







   .. method:: GetDelayedImageLoading(self)

      Returns ``True`` if delayed image loading is enabled.                  

      :rtype: `bool`








   .. method:: GetImagesEnabled(self)

      Returns ``True`` if images are enabled.                  

      :rtype: `bool`








   .. method:: GetLayingOut(self)

      Returns ``True`` if laying out.                  

      :rtype: `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)






   .. method:: SetLayingOut(self, b)

      Set laying out flag.                  


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







   .. attribute:: DelayedImageLoading

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


   .. attribute:: ImagesEnabled

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


   .. attribute:: LayingOut

      See :meth:`~wx.richtext.RichTextDrawingContext.GetLayingOut` and :meth:`~wx.richtext.RichTextDrawingContext.SetLayingOut`


   .. attribute:: VirtualAttributesEnabled

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


   .. attribute:: m_buffer

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


   .. attribute:: m_enableDelayedImageLoading

      A public C++ attribute of type ``bool``.


   .. attribute:: m_enableImages

      A public C++ attribute of type ``bool``.


   .. attribute:: m_enableVirtualAttributes

      A public C++ attribute of type ``bool``.


   .. attribute:: m_layingOut

      A public C++ attribute of type ``bool``.

