.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.richtext.RichTextObject:

==========================================================================================================================================
|phoenix_title|  **wx.richtext.RichTextObject**
==========================================================================================================================================

This is the base for drawable rich text objects.          







         



.. 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>RichTextObject</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.RichTextObject_inheritance.png" alt="Inheritance diagram of RichTextObject" 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.RichTextObject.html" title="This is the base for drawable rich text objects." alt="" coords="5,83,208,112"/> <area shape="rect" id="node2" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="63,5,151,35"/> </map> 
   </p>
   </div>

|


|sub_classes| Known Subclasses
==============================

:ref:`wx.richtext.RichTextCompositeObject`, :ref:`wx.richtext.RichTextImage`, :ref:`wx.richtext.RichTextPlainText`

|


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

================================================================================ ================================================================================
:meth:`~wx.richtext.RichTextObject.__init__`                                     Constructor, taking an optional parent pointer.
:meth:`~wx.richtext.RichTextObject.AcceptsFocus`                                 Returns ``True`` if objects of this class can accept the focus, i.e. a call to SetFocusObject is possible.
:meth:`~wx.richtext.RichTextObject.AdjustAttributes`                             Adjusts the attributes for virtual attribute provision, collapsed borders, etc.
:meth:`~wx.richtext.RichTextObject.AdjustAvailableSpace`                         Returns the rectangle which the child has available to it given restrictions specified in the child attribute, e.g.
:meth:`~wx.richtext.RichTextObject.CalculateRange`                               Calculates the range of the object.
:meth:`~wx.richtext.RichTextObject.CanEditProperties`                            Returns ``True`` if we can edit the object's properties via a GUI.
:meth:`~wx.richtext.RichTextObject.CanMerge`                                     Returns ``True`` if this object can merge itself with the given one.
:meth:`~wx.richtext.RichTextObject.CanSplit`                                     Returns ``True`` if this object can potentially be split, by virtue of having different virtual attributes for individual sub-objects.
:meth:`~wx.richtext.RichTextObject.Clone`                                        Clones the object.
:meth:`~wx.richtext.RichTextObject.ConvertPixelsToTenthsMM`                      Convert units in pixels to tenths of a millimetre.
:meth:`~wx.richtext.RichTextObject.ConvertTenthsMMToPixels`                      Converts units in tenths of a millimetre to device units.
:meth:`~wx.richtext.RichTextObject.Copy`                                         Copies the object.
:meth:`~wx.richtext.RichTextObject.DeleteRange`                                  Deletes the given range.
:meth:`~wx.richtext.RichTextObject.Dereference`                                  Reference-counting allows us to use the same object in multiple lists (not yet used).
:meth:`~wx.richtext.RichTextObject.DoSplit`                                      Do a split from `pos`, returning an object containing the second part, and setting the first part in 'this'.
:meth:`~wx.richtext.RichTextObject.Draw`                                         Draw the item, within the given range.
:meth:`~wx.richtext.RichTextObject.DrawBorder`                                   Draws a border.
:meth:`~wx.richtext.RichTextObject.DrawBoxAttributes`                            Draws the borders and background for the given rectangle and attributes.
:meth:`~wx.richtext.RichTextObject.EditProperties`                               Edits the object's properties via a GUI.
:meth:`~wx.richtext.RichTextObject.FindPosition`                                 Finds the absolute position and row height for the given character position.
:meth:`~wx.richtext.RichTextObject.GetAbsolutePosition`                          Returns the absolute object position, by traversing up the child/parent hierarchy.
:meth:`~wx.richtext.RichTextObject.GetAttributes`                                Returns the object's attributes.
:meth:`~wx.richtext.RichTextObject.GetAvailableContentArea`                      Calculates the available content space in the given rectangle, given the margins, border and padding specified in the object's attributes.
:meth:`~wx.richtext.RichTextObject.GetBestSize`                                  Returns the best size, i.e. the ideal starting size for this object irrespective of available space.
:meth:`~wx.richtext.RichTextObject.GetBottomMargin`                              Returns the bottom margin of the object, in pixels.
:meth:`~wx.richtext.RichTextObject.GetBoxRects`                                  Returns the various rectangles of the box model in pixels.
:meth:`~wx.richtext.RichTextObject.GetBuffer`                                    Returns the containing buffer.
:meth:`~wx.richtext.RichTextObject.GetCachedSize`                                Gets the cached object size as calculated by Layout.
:meth:`~wx.richtext.RichTextObject.GetContainer`                                 Returns the top-level container of this object.
:meth:`~wx.richtext.RichTextObject.GetDescent`                                   Returns the stored descent value.
:meth:`~wx.richtext.RichTextObject.GetFloatDirection`                            Returns the floating direction.
:meth:`~wx.richtext.RichTextObject.GetLeftMargin`                                Returns the left margin of the object, in pixels.
:meth:`~wx.richtext.RichTextObject.GetMaxSize`                                   Gets the maximum object size as calculated by Layout.
:meth:`~wx.richtext.RichTextObject.GetMinSize`                                   Gets the minimum object size as calculated by Layout.
:meth:`~wx.richtext.RichTextObject.GetName`                                      Returns the identifying name for this object from the properties, using the "name" key.
:meth:`~wx.richtext.RichTextObject.GetNaturalSize`                               Gets the 'natural' size for an object.
:meth:`~wx.richtext.RichTextObject.GetOwnRange`                                  Returns the object's own range (valid if top-level).
:meth:`~wx.richtext.RichTextObject.GetOwnRangeIfTopLevel`                        Returns the object's own range only if a top-level object.
:meth:`~wx.richtext.RichTextObject.GetParent`                                    Returns a pointer to the parent object.
:meth:`~wx.richtext.RichTextObject.GetParentContainer`                           Returns the top-level container of this object.
:meth:`~wx.richtext.RichTextObject.GetPosition`                                  Returns the object position in pixels.
:meth:`~wx.richtext.RichTextObject.GetProperties`                                Returns the object's properties.
:meth:`~wx.richtext.RichTextObject.GetPropertiesMenuLabel`                       Returns the label to be used for the properties context menu item.
:meth:`~wx.richtext.RichTextObject.GetRange`                                     Returns the object's range.
:meth:`~wx.richtext.RichTextObject.GetRangeSize`                                 Returns the object size for the given range.
:meth:`~wx.richtext.RichTextObject.GetRect`                                      Returns the rectangle enclosing the object.
:meth:`~wx.richtext.RichTextObject.GetRightMargin`                               Returns the right margin of the object, in pixels.
:meth:`~wx.richtext.RichTextObject.GetSelection`                                 Returns a selection object specifying the selections between start and end character positions.
:meth:`~wx.richtext.RichTextObject.GetTextForRange`                              Returns any text in this object for the given range.
:meth:`~wx.richtext.RichTextObject.GetTopMargin`                                 Returns the top margin of the object, in pixels.
:meth:`~wx.richtext.RichTextObject.GetTotalMargin`                               Returns the total margin for the object in pixels, taking into account margin, padding and border size.
:meth:`~wx.richtext.RichTextObject.GetXMLNodeName`                               Returns the ``XML`` node name of this object.
:meth:`~wx.richtext.RichTextObject.HandlesChildSelections`                       Returns ``True`` if this object can handle the selections of its children, fOr example a table.
:meth:`~wx.richtext.RichTextObject.HitTest`                                      Hit-testing: returns a flag indicating hit test details, plus information about position.
:meth:`~wx.richtext.RichTextObject.ImportFromXML`                                Imports this object from ``XML``.
:meth:`~wx.richtext.RichTextObject.Invalidate`                                   Invalidates the object at the given range.
:meth:`~wx.richtext.RichTextObject.IsAtomic`                                     Returns ``True`` if no user editing can be done inside the object.
:meth:`~wx.richtext.RichTextObject.IsComposite`                                  Returns ``True`` if this object is composite.
:meth:`~wx.richtext.RichTextObject.IsEmpty`                                      Returns ``True`` if the object is empty.
:meth:`~wx.richtext.RichTextObject.IsFloatable`                                  Returns ``True`` if this class of object is floatable.
:meth:`~wx.richtext.RichTextObject.IsFloating`                                   Returns ``True`` if this object is currently floating.
:meth:`~wx.richtext.RichTextObject.IsShown`                                      Returns ``True`` if the object will be shown, ``False`` otherwise.
:meth:`~wx.richtext.RichTextObject.IsTopLevel`                                   Returns ``True`` if this object is top-level, i.e. contains its own paragraphs, such as a text box.
:meth:`~wx.richtext.RichTextObject.Layout`                                       Lay the item out at the specified position with the given size constraint.
:meth:`~wx.richtext.RichTextObject.LayoutToBestSize`                             Lays out the object first with a given amount of space, and then if no width was specified in attr, lays out the object again using the minimum size.
:meth:`~wx.richtext.RichTextObject.Merge`                                        Returns ``True`` if this object merged itself with the given one.
:meth:`~wx.richtext.RichTextObject.Move`                                         Moves the object recursively, by adding the offset from old to new.
:meth:`~wx.richtext.RichTextObject.Reference`                                    Reference-counting allows us to use the same object in multiple lists (not yet used).
:meth:`~wx.richtext.RichTextObject.SetAttributes`                                Sets the object's attributes.
:meth:`~wx.richtext.RichTextObject.SetCachedSize`                                Sets the cached object size as calculated by Layout.
:meth:`~wx.richtext.RichTextObject.SetDescent`                                   Sets the stored descent value.
:meth:`~wx.richtext.RichTextObject.SetMargins`                                   Set the margin around the object, in pixels.
:meth:`~wx.richtext.RichTextObject.SetMaxSize`                                   Sets the maximum object size as calculated by Layout.
:meth:`~wx.richtext.RichTextObject.SetMinSize`                                   Sets the minimum object size as calculated by Layout.
:meth:`~wx.richtext.RichTextObject.SetName`                                      Sets the identifying name for this object as a property using the "name" key.
:meth:`~wx.richtext.RichTextObject.SetOwnRange`                                  Set the object's own range, for a top-level object with its own position space.
:meth:`~wx.richtext.RichTextObject.SetParent`                                    Sets the pointer to the parent object.
:meth:`~wx.richtext.RichTextObject.SetPosition`                                  Sets the object position in pixels.
:meth:`~wx.richtext.RichTextObject.SetProperties`                                Sets the object's properties.
:meth:`~wx.richtext.RichTextObject.SetRange`                                     Sets the object's range within its container.
:meth:`~wx.richtext.RichTextObject.Show`                                         Call to show or hide this object.
:meth:`~wx.richtext.RichTextObject.Split`                                        Returns the final object in the split objects if this object was split due to differences between sub-object virtual attributes.
:meth:`~wx.richtext.RichTextObject.UsesParagraphAttributes`                      Returns ``True`` if this object takes note of paragraph attributes (text and image objects don't).
================================================================================ ================================================================================


|


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

================================================================================ ================================================================================
:attr:`~wx.richtext.RichTextObject.AbsolutePosition`                             See :meth:`~wx.richtext.RichTextObject.GetAbsolutePosition`
:attr:`~wx.richtext.RichTextObject.Attributes`                                   See :meth:`~wx.richtext.RichTextObject.GetAttributes` and :meth:`~wx.richtext.RichTextObject.SetAttributes`
:attr:`~wx.richtext.RichTextObject.BestSize`                                     See :meth:`~wx.richtext.RichTextObject.GetBestSize`
:attr:`~wx.richtext.RichTextObject.BottomMargin`                                 See :meth:`~wx.richtext.RichTextObject.GetBottomMargin`
:attr:`~wx.richtext.RichTextObject.Buffer`                                       See :meth:`~wx.richtext.RichTextObject.GetBuffer`
:attr:`~wx.richtext.RichTextObject.CachedSize`                                   See :meth:`~wx.richtext.RichTextObject.GetCachedSize` and :meth:`~wx.richtext.RichTextObject.SetCachedSize`
:attr:`~wx.richtext.RichTextObject.Container`                                    See :meth:`~wx.richtext.RichTextObject.GetContainer`
:attr:`~wx.richtext.RichTextObject.Descent`                                      See :meth:`~wx.richtext.RichTextObject.GetDescent` and :meth:`~wx.richtext.RichTextObject.SetDescent`
:attr:`~wx.richtext.RichTextObject.FloatDirection`                               See :meth:`~wx.richtext.RichTextObject.GetFloatDirection`
:attr:`~wx.richtext.RichTextObject.LeftMargin`                                   See :meth:`~wx.richtext.RichTextObject.GetLeftMargin`
:attr:`~wx.richtext.RichTextObject.MaxSize`                                      See :meth:`~wx.richtext.RichTextObject.GetMaxSize` and :meth:`~wx.richtext.RichTextObject.SetMaxSize`
:attr:`~wx.richtext.RichTextObject.MinSize`                                      See :meth:`~wx.richtext.RichTextObject.GetMinSize` and :meth:`~wx.richtext.RichTextObject.SetMinSize`
:attr:`~wx.richtext.RichTextObject.Name`                                         See :meth:`~wx.richtext.RichTextObject.GetName` and :meth:`~wx.richtext.RichTextObject.SetName`
:attr:`~wx.richtext.RichTextObject.NaturalSize`                                  See :meth:`~wx.richtext.RichTextObject.GetNaturalSize`
:attr:`~wx.richtext.RichTextObject.OwnRange`                                     See :meth:`~wx.richtext.RichTextObject.GetOwnRange` and :meth:`~wx.richtext.RichTextObject.SetOwnRange`
:attr:`~wx.richtext.RichTextObject.OwnRangeIfTopLevel`                           See :meth:`~wx.richtext.RichTextObject.GetOwnRangeIfTopLevel`
:attr:`~wx.richtext.RichTextObject.Parent`                                       See :meth:`~wx.richtext.RichTextObject.GetParent` and :meth:`~wx.richtext.RichTextObject.SetParent`
:attr:`~wx.richtext.RichTextObject.ParentContainer`                              See :meth:`~wx.richtext.RichTextObject.GetParentContainer`
:attr:`~wx.richtext.RichTextObject.Position`                                     See :meth:`~wx.richtext.RichTextObject.GetPosition` and :meth:`~wx.richtext.RichTextObject.SetPosition`
:attr:`~wx.richtext.RichTextObject.Properties`                                   See :meth:`~wx.richtext.RichTextObject.GetProperties` and :meth:`~wx.richtext.RichTextObject.SetProperties`
:attr:`~wx.richtext.RichTextObject.PropertiesMenuLabel`                          See :meth:`~wx.richtext.RichTextObject.GetPropertiesMenuLabel`
:attr:`~wx.richtext.RichTextObject.Range`                                        See :meth:`~wx.richtext.RichTextObject.GetRange` and :meth:`~wx.richtext.RichTextObject.SetRange`
:attr:`~wx.richtext.RichTextObject.Rect`                                         See :meth:`~wx.richtext.RichTextObject.GetRect`
:attr:`~wx.richtext.RichTextObject.RightMargin`                                  See :meth:`~wx.richtext.RichTextObject.GetRightMargin`
:attr:`~wx.richtext.RichTextObject.TopMargin`                                    See :meth:`~wx.richtext.RichTextObject.GetTopMargin`
:attr:`~wx.richtext.RichTextObject.XMLNodeName`                                  See :meth:`~wx.richtext.RichTextObject.GetXMLNodeName`
================================================================================ ================================================================================


|


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


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

   **Possible constructors**::

       RichTextObject(parent=None)
       
   
   This is the base for drawable rich text objects.



   .. method:: __init__(self, parent=None)

      Constructor, taking an optional parent pointer.                  


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







   .. method:: AcceptsFocus(self)

      Returns ``True`` if objects of this class can accept the focus, i.e. a call to SetFocusObject is possible.                  

      For example, containers supporting text, such as a text box object, can accept the focus, but a table can't (set the focus to individual cells instead).                  

      :rtype: `bool`








   .. method:: AdjustAttributes(self, attr, context)

      Adjusts the attributes for virtual attribute provision, collapsed borders, etc.                  


      :param `attr`: 
      :type `attr`: wx.richtext.RichTextAttr
      :param `context`: 
      :type `context`: wx.richtext.RichTextDrawingContext




      :rtype: `bool`








   .. staticmethod:: AdjustAvailableSpace(dc, buffer, parentAttr, childAttr, availableParentSpace, availableContainerSpace)

      Returns the rectangle which the child has available to it given restrictions specified in the child attribute, e.g.                  

      50% width of the parent, 400 pixels, x position 20% of the parent, etc. availableContainerSpace might be a parent that the cell has to compute its width relative to. E.g. a cell that's 50% of its parent.                  


      :param `dc`: 
      :type `dc`: wx.DC
      :param `buffer`: 
      :type `buffer`: wx.richtext.RichTextBuffer
      :param `parentAttr`: 
      :type `parentAttr`: wx.richtext.RichTextAttr
      :param `childAttr`: 
      :type `childAttr`: wx.richtext.RichTextAttr
      :param `availableParentSpace`: 
      :type `availableParentSpace`: wx.Rect
      :param `availableContainerSpace`: 
      :type `availableContainerSpace`: wx.Rect




      :rtype: `Rect`     








   .. method:: CalculateRange(self, start)

      Calculates the range of the object.                  

      By default, guess that the object is 1 unit long.                  


      :param `start`: 
      :type `start`: long




      :rtype: `end`








   .. method:: CanEditProperties(self)

      Returns ``True`` if we can edit the object's properties via a GUI.                  

      :rtype: `bool`








   .. method:: CanMerge(self, object, context)

      Returns ``True`` if this object can merge itself with the given one.                  


      :param `object`: 
      :type `object`: wx.richtext.RichTextObject
      :param `context`: 
      :type `context`: wx.richtext.RichTextDrawingContext




      :rtype: `bool`








   .. method:: CanSplit(self, context)

      Returns ``True`` if this object can potentially be split, by virtue of having different virtual attributes for individual sub-objects.                  


      :param `context`: 
      :type `context`: wx.richtext.RichTextDrawingContext




      :rtype: `bool`








   .. method:: Clone(self)

      Clones the object.                  

      :rtype: :ref:`wx.richtext.RichTextObject`








   .. method:: ConvertPixelsToTenthsMM(self, *args, **kw)

      Convert units in pixels to tenths of a millimetre.                   


      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **ConvertPixelsToTenthsMM** `(self, dc, pixels)`
      
      
      
      
      :param `dc`: 
      :type `dc`: wx.DC
      :param `pixels`: 
      :type `pixels`: int
      
      
      
      
      :rtype: `int`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **ConvertPixelsToTenthsMM** `(ppi, pixels, scale=1.0)`
      
      
      
      
      :param `ppi`: 
      :type `ppi`: int
      :param `pixels`: 
      :type `pixels`: int
      :param `scale`: 
      :type `scale`: float
      
      
      
      
      :rtype: `int`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: ConvertTenthsMMToPixels(self, *args, **kw)

      Converts units in tenths of a millimetre to device units.                   


      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **ConvertTenthsMMToPixels** `(self, dc, units)`
      
      
      
      
      :param `dc`: 
      :type `dc`: wx.DC
      :param `units`: 
      :type `units`: int
      
      
      
      
      :rtype: `int`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **ConvertTenthsMMToPixels** `(ppi, units, scale=1.0)`
      
      
      
      
      :param `ppi`: 
      :type `ppi`: int
      :param `units`: 
      :type `units`: int
      :param `scale`: 
      :type `scale`: float
      
      
      
      
      :rtype: `int`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: Copy(self, obj)

      Copies the object.                  


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







   .. method:: DeleteRange(self, range)

      Deletes the given range.                  


      :param `range`: 
      :type `range`: wx.richtext.RichTextRange




      :rtype: `bool`








   .. method:: Dereference(self)

      Reference-counting allows us to use the same object in multiple lists (not yet used).                   





   .. method:: DoSplit(self, pos)

      Do a split from `pos`, returning an object containing the second part, and setting the first part in 'this'.                  


      :param `pos`: 
      :type `pos`: long




      :rtype: :ref:`wx.richtext.RichTextObject`








   .. method:: Draw(self, dc, context, range, selection, rect, descent, style)

      Draw the item, within the given range.                  

      Some objects may ignore the range (for example paragraphs) while others must obey it (lines, to implement wrapping)                  


      :param `dc`: 
      :type `dc`: wx.DC
      :param `context`: 
      :type `context`: wx.richtext.RichTextDrawingContext
      :param `range`: 
      :type `range`: wx.richtext.RichTextRange
      :param `selection`: 
      :type `selection`: wx.richtext.RichTextSelection
      :param `rect`: 
      :type `rect`: wx.Rect
      :param `descent`: 
      :type `descent`: int
      :param `style`: 
      :type `style`: int




      :rtype: `bool`








   .. staticmethod:: DrawBorder(dc, buffer, attr, rect, flags=0)

      Draws a border.                  


      :param `dc`: 
      :type `dc`: wx.DC
      :param `buffer`: 
      :type `buffer`: wx.richtext.RichTextBuffer
      :param `attr`: 
      :type `attr`: wx.richtext.TextAttrBorders
      :param `rect`: 
      :type `rect`: wx.Rect
      :param `flags`: 
      :type `flags`: int




      :rtype: `bool`








   .. staticmethod:: DrawBoxAttributes(dc, buffer, attr, boxRect, flags=0, obj=None)

      Draws the borders and background for the given rectangle and attributes.                  

      `boxRect`  is taken to be the outer margin box, not the box around the content.                  


      :param `dc`: 
      :type `dc`: wx.DC
      :param `buffer`: 
      :type `buffer`: wx.richtext.RichTextBuffer
      :param `attr`: 
      :type `attr`: wx.richtext.RichTextAttr
      :param `boxRect`: 
      :type `boxRect`: wx.Rect
      :param `flags`: 
      :type `flags`: int
      :param `obj`: 
      :type `obj`: wx.richtext.RichTextObject




      :rtype: `bool`








   .. method:: EditProperties(self, parent, buffer)

      Edits the object's properties via a GUI.                  


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




      :rtype: `bool`








   .. method:: FindPosition(self, dc, context, index, forceLineStart)

      Finds the absolute position and row height for the given character position.                  


      :param `dc`: 
      :type `dc`: wx.DC
      :param `context`: 
      :type `context`: wx.richtext.RichTextDrawingContext
      :param `index`: 
      :type `index`: long
      :param `forceLineStart`: 
      :type `forceLineStart`: bool




      :rtype: `tuple`







      :returns: 

         ( `bool`, `pt`, `height` ) 








   .. method:: GetAbsolutePosition(self)

      Returns the absolute object position, by traversing up the child/parent hierarchy.                  

      ``TODO``: may not be needed, if all object positions are in fact relative to the top of the coordinate space.                  

      :rtype: `Point`     








   .. method:: GetAttributes(self)

      Returns the object's attributes.                  

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








   .. method:: GetAvailableContentArea(self, dc, context, outerRect)

      Calculates the available content space in the given rectangle, given the margins, border and padding specified in the object's attributes.                  


      :param `dc`: 
      :type `dc`: wx.DC
      :param `context`: 
      :type `context`: wx.richtext.RichTextDrawingContext
      :param `outerRect`: 
      :type `outerRect`: wx.Rect




      :rtype: `Rect`     








   .. method:: GetBestSize(self)

      Returns the best size, i.e. the ideal starting size for this object irrespective of available space.                  

      For a short text string, it will be the size that exactly encloses the text. For a longer string, it might use the parent width for example.                  

      :rtype: `Size`     








   .. method:: GetBottomMargin(self)

      Returns the bottom margin of the object, in pixels.                  

      :rtype: `int`








   .. staticmethod:: GetBoxRects(dc, buffer, attr)

      Returns the various rectangles of the box model in pixels.                  

      You can either specify `contentRect`  (inner) or `marginRect`  (outer), and the other must be the default rectangle (no width or height). Note that the outline doesn't affect the position of the rectangle, it's drawn in whatever space is available.                  


      :param `dc`: 
      :type `dc`: wx.DC
      :param `buffer`: 
      :type `buffer`: wx.richtext.RichTextBuffer
      :param `attr`: 
      :type `attr`: wx.richtext.RichTextAttr




      :rtype: `tuple`







      :returns: 

         ( `bool`, `marginRect`, `borderRect`, `contentRect`, `paddingRect`, `outlineRect` ) 








   .. method:: GetBuffer(self)

      Returns the containing buffer.                  

      :rtype: :ref:`wx.richtext.RichTextBuffer`








   .. method:: GetCachedSize(self)

      Gets the cached object size as calculated by Layout.                  

      :rtype: `Size`     








   .. method:: GetContainer(self)

      Returns the top-level container of this object.                  

      May return itself if it's a container; use GetParentContainer to return a different container.                  

      :rtype: :ref:`wx.richtext.RichTextParagraphLayoutBox`








   .. method:: GetDescent(self)

      Returns the stored descent value.                  

      :rtype: `int`








   .. method:: GetFloatDirection(self)

      Returns the floating direction.                  

      :rtype: `int`








   .. method:: GetLeftMargin(self)

      Returns the left margin of the object, in pixels.                  

      :rtype: `int`








   .. method:: GetMaxSize(self)

      Gets the maximum object size as calculated by Layout.                  

      This allows us to fit an object to its contents or allocate extra space if required.                  

      :rtype: `Size`     








   .. method:: GetMinSize(self)

      Gets the minimum object size as calculated by Layout.                  

      This allows us to constrain an object to its absolute minimum size if necessary.                  

      :rtype: `Size`     








   .. method:: GetName(self)

      Returns the identifying name for this object from the properties, using the "name" key.                  

      :rtype: `string`








   .. method:: GetNaturalSize(self)

      Gets the 'natural' size for an object.                  

      For an image, it would be the image size.                  

      :rtype: :ref:`wx.richtext.TextAttrSize`








   .. method:: GetOwnRange(self)

      Returns the object's own range (valid if top-level).                  

      :rtype: :ref:`wx.richtext.RichTextRange`








   .. method:: GetOwnRangeIfTopLevel(self)

      Returns the object's own range only if a top-level object.                  

      :rtype: :ref:`wx.richtext.RichTextRange`








   .. method:: GetParent(self)

      Returns a pointer to the parent object.                  

      :rtype: :ref:`wx.richtext.RichTextObject`








   .. method:: GetParentContainer(self)

      Returns the top-level container of this object.                  

      Returns a different container than itself, unless there's no parent, in which case it will return ``None``.                  

      :rtype: :ref:`wx.richtext.RichTextParagraphLayoutBox`








   .. method:: GetPosition(self)

      Returns the object position in pixels.                  

      :rtype: `Point`     








   .. method:: GetProperties(self)

      Returns the object's properties.                  

      :rtype: :ref:`wx.richtext.RichTextProperties`








   .. method:: GetPropertiesMenuLabel(self)

      Returns the label to be used for the properties context menu item.                  

      :rtype: `string`








   .. method:: GetRange(self)

      Returns the object's range.                  

      :rtype: :ref:`wx.richtext.RichTextRange`








   .. method:: GetRangeSize(self, range, size, descent, dc, context, flags, position=Point(0,0), parentSize=DefaultSize, partialExtents=None)

      Returns the object size for the given range.                  

      Returns ``False`` if the range is invalid for this object.                  


      :param `range`: 
      :type `range`: wx.richtext.RichTextRange
      :param `size`: 
      :type `size`: wx.Size
      :param `descent`: 
      :type `descent`: int
      :param `dc`: 
      :type `dc`: wx.DC
      :param `context`: 
      :type `context`: wx.richtext.RichTextDrawingContext
      :param `flags`: 
      :type `flags`: int
      :param `position`: 
      :type `position`: wx.Point
      :param `parentSize`: 
      :type `parentSize`: wx.Size
      :param `partialExtents`: 
      :type `partialExtents`: list of integers




      :rtype: `bool`








   .. method:: GetRect(self)

      Returns the rectangle enclosing the object.                  

      :rtype: `Rect`     








   .. method:: GetRightMargin(self)

      Returns the right margin of the object, in pixels.                  

      :rtype: `int`








   .. method:: GetSelection(self, start, end)

      Returns a selection object specifying the selections between start and end character positions.                  

      For example, a table would deduce what cells (of range length 1) are selected when dragging across the table.                  


      :param `start`: 
      :type `start`: long
      :param `end`: 
      :type `end`: long




      :rtype: :ref:`wx.richtext.RichTextSelection`








   .. method:: GetTextForRange(self, range)

      Returns any text in this object for the given range.                  


      :param `range`: 
      :type `range`: wx.richtext.RichTextRange




      :rtype: `string`








   .. method:: GetTopMargin(self)

      Returns the top margin of the object, in pixels.                  

      :rtype: `int`








   .. staticmethod:: GetTotalMargin(dc, buffer, attr)

      Returns the total margin for the object in pixels, taking into account margin, padding and border size.                  


      :param `dc`: 
      :type `dc`: wx.DC
      :param `buffer`: 
      :type `buffer`: wx.richtext.RichTextBuffer
      :param `attr`: 
      :type `attr`: wx.richtext.RichTextAttr




      :rtype: `tuple`







      :returns: 

         ( `bool`, `leftMargin`, `rightMargin`, `topMargin`, `bottomMargin` ) 








   .. method:: GetXMLNodeName(self)

      Returns the ``XML`` node name of this object.                  

      This must be overridden for XmlNode-base ``XML`` export to work.                  

      :rtype: `string`








   .. method:: HandlesChildSelections(self)

      Returns ``True`` if this object can handle the selections of its children, fOr example a table.                  

      Required for composite selection handling to work.                  

      :rtype: `bool`








   .. method:: HitTest(self, dc, context, pt, flags=0)

      Hit-testing: returns a flag indicating hit test details, plus information about position.                  

      `contextObj`  is returned to specify what object position is relevant to, since otherwise there's an ambiguity. @ obj might not be a child of `contextObj`, since we may be referring to the container itself if we have no hit on a child - for example if we click outside an object. 

      The function puts the position in `textPosition`  if one is found. `pt`  is in logical units (a zero y position is at the beginning of the buffer). 

                


      :param `dc`: 
      :type `dc`: wx.DC
      :param `context`: 
      :type `context`: wx.richtext.RichTextDrawingContext
      :param `pt`: 
      :type `pt`: wx.Point
      :param `flags`: 
      :type `flags`: int




      :rtype: `tuple`







      :returns: 

         ( `int`, `textPosition`, `obj`, `contextObj` ) 








   .. method:: ImportFromXML(self, buffer, node, handler, recurse)

      Imports this object from ``XML``.                  


      :param `buffer`: 
      :type `buffer`: wx.richtext.RichTextBuffer
      :param `node`: 
      :type `node`: wx.xml.XmlNode
      :param `handler`: 
      :type `handler`: wx.richtext.RichTextXMLHandler
      :param `recurse`: 
      :type `recurse`: bool




      :rtype: `bool`








   .. method:: Invalidate(self, invalidRange=RICHTEXT_ALL)

      Invalidates the object at the given range.                  

      With no argument, invalidates the whole object.                  


      :param `invalidRange`: 
      :type `invalidRange`: wx.richtext.RichTextRange







   .. method:: IsAtomic(self)

      Returns ``True`` if no user editing can be done inside the object.                  

      This returns ``True`` for simple objects, ``False`` for most composite objects, but ``True`` for fields, which if composite, should not be user-edited.                  

      :rtype: `bool`








   .. method:: IsComposite(self)

      Returns ``True`` if this object is composite.                  

      :rtype: `bool`








   .. method:: IsEmpty(self)

      Returns ``True`` if the object is empty.                  

      :rtype: `bool`








   .. method:: IsFloatable(self)

      Returns ``True`` if this class of object is floatable.                  

      :rtype: `bool`








   .. method:: IsFloating(self)

      Returns ``True`` if this object is currently floating.                  

      :rtype: `bool`








   .. method:: IsShown(self)

      Returns ``True`` if the object will be shown, ``False`` otherwise.                  

      :rtype: `bool`








   .. method:: IsTopLevel(self)

      Returns ``True`` if this object is top-level, i.e. contains its own paragraphs, such as a text box.                  

      :rtype: `bool`








   .. method:: Layout(self, dc, context, rect, parentRect, style)

      Lay the item out at the specified position with the given size constraint.                  

      Layout must set the cached size. `rect`  is the available space for the object, and `parentRect`  is the container that is used to determine a relative size or position (for example if a text box must be 50% of the parent text box).                  


      :param `dc`: 
      :type `dc`: wx.DC
      :param `context`: 
      :type `context`: wx.richtext.RichTextDrawingContext
      :param `rect`: 
      :type `rect`: wx.Rect
      :param `parentRect`: 
      :type `parentRect`: wx.Rect
      :param `style`: 
      :type `style`: int




      :rtype: `bool`








   .. method:: LayoutToBestSize(self, dc, context, buffer, parentAttr, attr, availableParentSpace, availableContainerSpace, style)

      Lays out the object first with a given amount of space, and then if no width was specified in attr, lays out the object again using the minimum size.                  

      `availableParentSpace`  is the maximum space for the object, whereas `availableContainerSpace`  is the container with which relative positions and sizes should be computed. For example, a text box whose space has already been constrained in a previous layout pass to `availableParentSpace`, but should have a width of 50% of `availableContainerSpace`. (If these two rects were the same, a 2nd pass could see the object getting too small.)                  


      :param `dc`: 
      :type `dc`: wx.DC
      :param `context`: 
      :type `context`: wx.richtext.RichTextDrawingContext
      :param `buffer`: 
      :type `buffer`: wx.richtext.RichTextBuffer
      :param `parentAttr`: 
      :type `parentAttr`: wx.richtext.RichTextAttr
      :param `attr`: 
      :type `attr`: wx.richtext.RichTextAttr
      :param `availableParentSpace`: 
      :type `availableParentSpace`: wx.Rect
      :param `availableContainerSpace`: 
      :type `availableContainerSpace`: wx.Rect
      :param `style`: 
      :type `style`: int




      :rtype: `bool`








   .. method:: Merge(self, object, context)

      Returns ``True`` if this object merged itself with the given one.                  

      The calling code will then delete the given object.                  


      :param `object`: 
      :type `object`: wx.richtext.RichTextObject
      :param `context`: 
      :type `context`: wx.richtext.RichTextDrawingContext




      :rtype: `bool`








   .. method:: Move(self, pt)

      Moves the object recursively, by adding the offset from old to new.                  


      :param `pt`: 
      :type `pt`: wx.Point







   .. method:: Reference(self)

      Reference-counting allows us to use the same object in multiple lists (not yet used).                   





   .. method:: SetAttributes(self, attr)

      Sets the object's attributes.                  


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







   .. method:: SetCachedSize(self, sz)

      Sets the cached object size as calculated by Layout.                  


      :param `sz`: 
      :type `sz`: wx.Size







   .. method:: SetDescent(self, descent)

      Sets the stored descent value.                  


      :param `descent`: 
      :type `descent`: int







   .. method:: SetMargins(self, *args, **kw)

      Set the margin around the object, in pixels.                   


      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **SetMargins** `(self, margin)`
      
      
      
      
      :param `margin`: 
      :type `margin`: int
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **SetMargins** `(self, leftMargin, rightMargin, topMargin, bottomMargin)`
      
      
      
      
      :param `leftMargin`: 
      :type `leftMargin`: int
      :param `rightMargin`: 
      :type `rightMargin`: int
      :param `topMargin`: 
      :type `topMargin`: int
      :param `bottomMargin`: 
      :type `bottomMargin`: int
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: SetMaxSize(self, sz)

      Sets the maximum object size as calculated by Layout.                  

      This allows us to fit an object to its contents or allocate extra space if required.                  


      :param `sz`: 
      :type `sz`: wx.Size







   .. method:: SetMinSize(self, sz)

      Sets the minimum object size as calculated by Layout.                  

      This allows us to constrain an object to its absolute minimum size if necessary.                  


      :param `sz`: 
      :type `sz`: wx.Size







   .. method:: SetName(self, name)

      Sets the identifying name for this object as a property using the "name" key.                  


      :param `name`: 
      :type `name`: string







   .. method:: SetOwnRange(self, range)

      Set the object's own range, for a top-level object with its own position space.                  


      :param `range`: 
      :type `range`: wx.richtext.RichTextRange







   .. method:: SetParent(self, parent)

      Sets the pointer to the parent object.                  


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







   .. method:: SetPosition(self, pos)

      Sets the object position in pixels.                  


      :param `pos`: 
      :type `pos`: wx.Point







   .. method:: SetProperties(self, props)

      Sets the object's properties.                  


      :param `props`: 
      :type `props`: wx.richtext.RichTextProperties







   .. method:: SetRange(self, range)

      Sets the object's range within its container.                  


      :param `range`: 
      :type `range`: wx.richtext.RichTextRange







   .. method:: Show(self, show)

      Call to show or hide this object.                  

      This function does not cause the content to be laid out or redrawn.                  


      :param `show`: 
      :type `show`: bool







   .. method:: Split(self, context)

      Returns the final object in the split objects if this object was split due to differences between sub-object virtual attributes.                  

      Returns itself if it was not split.                  


      :param `context`: 
      :type `context`: wx.richtext.RichTextDrawingContext




      :rtype: :ref:`wx.richtext.RichTextObject`








   .. method:: UsesParagraphAttributes(self)

      Returns ``True`` if this object takes note of paragraph attributes (text and image objects don't).                  

      :rtype: `bool`








   .. attribute:: AbsolutePosition

      See :meth:`~wx.richtext.RichTextObject.GetAbsolutePosition`


   .. attribute:: Attributes

      See :meth:`~wx.richtext.RichTextObject.GetAttributes` and :meth:`~wx.richtext.RichTextObject.SetAttributes`


   .. attribute:: BestSize

      See :meth:`~wx.richtext.RichTextObject.GetBestSize`


   .. attribute:: BottomMargin

      See :meth:`~wx.richtext.RichTextObject.GetBottomMargin`


   .. attribute:: Buffer

      See :meth:`~wx.richtext.RichTextObject.GetBuffer`


   .. attribute:: CachedSize

      See :meth:`~wx.richtext.RichTextObject.GetCachedSize` and :meth:`~wx.richtext.RichTextObject.SetCachedSize`


   .. attribute:: Container

      See :meth:`~wx.richtext.RichTextObject.GetContainer`


   .. attribute:: Descent

      See :meth:`~wx.richtext.RichTextObject.GetDescent` and :meth:`~wx.richtext.RichTextObject.SetDescent`


   .. attribute:: FloatDirection

      See :meth:`~wx.richtext.RichTextObject.GetFloatDirection`


   .. attribute:: LeftMargin

      See :meth:`~wx.richtext.RichTextObject.GetLeftMargin`


   .. attribute:: MaxSize

      See :meth:`~wx.richtext.RichTextObject.GetMaxSize` and :meth:`~wx.richtext.RichTextObject.SetMaxSize`


   .. attribute:: MinSize

      See :meth:`~wx.richtext.RichTextObject.GetMinSize` and :meth:`~wx.richtext.RichTextObject.SetMinSize`


   .. attribute:: Name

      See :meth:`~wx.richtext.RichTextObject.GetName` and :meth:`~wx.richtext.RichTextObject.SetName`


   .. attribute:: NaturalSize

      See :meth:`~wx.richtext.RichTextObject.GetNaturalSize`


   .. attribute:: OwnRange

      See :meth:`~wx.richtext.RichTextObject.GetOwnRange` and :meth:`~wx.richtext.RichTextObject.SetOwnRange`


   .. attribute:: OwnRangeIfTopLevel

      See :meth:`~wx.richtext.RichTextObject.GetOwnRangeIfTopLevel`


   .. attribute:: Parent

      See :meth:`~wx.richtext.RichTextObject.GetParent` and :meth:`~wx.richtext.RichTextObject.SetParent`


   .. attribute:: ParentContainer

      See :meth:`~wx.richtext.RichTextObject.GetParentContainer`


   .. attribute:: Position

      See :meth:`~wx.richtext.RichTextObject.GetPosition` and :meth:`~wx.richtext.RichTextObject.SetPosition`


   .. attribute:: Properties

      See :meth:`~wx.richtext.RichTextObject.GetProperties` and :meth:`~wx.richtext.RichTextObject.SetProperties`


   .. attribute:: PropertiesMenuLabel

      See :meth:`~wx.richtext.RichTextObject.GetPropertiesMenuLabel`


   .. attribute:: Range

      See :meth:`~wx.richtext.RichTextObject.GetRange` and :meth:`~wx.richtext.RichTextObject.SetRange`


   .. attribute:: Rect

      See :meth:`~wx.richtext.RichTextObject.GetRect`


   .. attribute:: RightMargin

      See :meth:`~wx.richtext.RichTextObject.GetRightMargin`


   .. attribute:: TopMargin

      See :meth:`~wx.richtext.RichTextObject.GetTopMargin`


   .. attribute:: XMLNodeName

      See :meth:`~wx.richtext.RichTextObject.GetXMLNodeName`