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

==========================================================================================================================================
|phoenix_title|  **wx.richtext.RichTextBuffer**
==========================================================================================================================================

This is a kind of paragraph layout box, used to represent the whole buffer.          





         



.. seealso:: :ref:`wx.richtext.RichTextParagraphLayoutBox`, :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>RichTextBuffer</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.RichTextBuffer_inheritance.png" alt="Inheritance diagram of RichTextBuffer" 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.RichTextBuffer.html" title="wx.richtext.RichTextBuffer" alt="" coords="53,315,246,344"/> <area shape="rect" id="node2" href="wx.richtext.RichTextParagraphLayoutBox.html" title="wx.richtext.RichTextParagraphLayoutBox" alt="" coords="5,237,293,267"/> <area shape="rect" id="node3" href="wx.richtext.RichTextCompositeObject.html" title="wx.richtext.RichTextCompositeObject" alt="" coords="16,160,283,189"/> <area shape="rect" id="node4" href="wx.richtext.RichTextObject.html" title="wx.richtext.RichTextObject" alt="" coords="51,83,247,112"/> <area shape="rect" id="node5" href="wx.Object.html" title="wx.Object" alt="" coords="106,5,193,35"/> </map> 
   </p>
   </div>

|


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

================================================================================ ================================================================================
:meth:`~wx.richtext.RichTextBuffer.__init__`                                     Default constructor.
:meth:`~wx.richtext.RichTextBuffer.AddDrawingHandler`                            Adds a drawing handler to the end.
:meth:`~wx.richtext.RichTextBuffer.AddEventHandler`                              Adds an event handler.
:meth:`~wx.richtext.RichTextBuffer.AddFieldType`                                 Adds a field type.
:meth:`~wx.richtext.RichTextBuffer.AddHandler`                                   Adds a file handler to the end.
:meth:`~wx.richtext.RichTextBuffer.AddParagraph`                                 Convenience function to add a paragraph of text.
:meth:`~wx.richtext.RichTextBuffer.BatchingUndo`                                 Returns ``True`` if we are collapsing commands.
:meth:`~wx.richtext.RichTextBuffer.BeginAlignment`                               Begins using alignment.
:meth:`~wx.richtext.RichTextBuffer.BeginBatchUndo`                               Begin collapsing undo/redo commands.
:meth:`~wx.richtext.RichTextBuffer.BeginBold`                                    Begins using bold.
:meth:`~wx.richtext.RichTextBuffer.BeginCharacterStyle`                          Begins named character style.
:meth:`~wx.richtext.RichTextBuffer.BeginFont`                                    Begins using this font.
:meth:`~wx.richtext.RichTextBuffer.BeginFontSize`                                Begins using point size.
:meth:`~wx.richtext.RichTextBuffer.BeginItalic`                                  Begins using italic.
:meth:`~wx.richtext.RichTextBuffer.BeginLeftIndent`                              Begins using `leftIndent`  for the left indent, and optionally `leftSubIndent`  for the sub-indent.
:meth:`~wx.richtext.RichTextBuffer.BeginLineSpacing`                             Begins line spacing using the specified value.
:meth:`~wx.richtext.RichTextBuffer.BeginListStyle`                               Begins named list style.
:meth:`~wx.richtext.RichTextBuffer.BeginNumberedBullet`                          Begins numbered bullet.
:meth:`~wx.richtext.RichTextBuffer.BeginParagraphSpacing`                        Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of a millimetre.
:meth:`~wx.richtext.RichTextBuffer.BeginParagraphStyle`                          Begins named paragraph style.
:meth:`~wx.richtext.RichTextBuffer.BeginRightIndent`                             Begins a right indent, specified in tenths of a millimetre.
:meth:`~wx.richtext.RichTextBuffer.BeginStandardBullet`                          Begins applying a standard bullet, using one of the standard bullet names (currently  ``standard/circle``   or   ``standard/square`` .
:meth:`~wx.richtext.RichTextBuffer.BeginStyle`                                   Begin using a style.
:meth:`~wx.richtext.RichTextBuffer.BeginSuppressUndo`                            Begin suppressing undo/redo commands.
:meth:`~wx.richtext.RichTextBuffer.BeginSymbolBullet`                            Begins applying a symbol bullet, using a character from the current font.
:meth:`~wx.richtext.RichTextBuffer.BeginTextColour`                              Begins using this colour.
:meth:`~wx.richtext.RichTextBuffer.BeginURL`                                     Begins applying ``wx.TEXT_ATTR_URL`` to the content.
:meth:`~wx.richtext.RichTextBuffer.BeginUnderline`                               Begins using underline.
:meth:`~wx.richtext.RichTextBuffer.CanPasteFromClipboard`                        Returns ``True`` if we can paste from the clipboard.
:meth:`~wx.richtext.RichTextBuffer.CleanUpDrawingHandlers`                       Clean up drawing handlers.
:meth:`~wx.richtext.RichTextBuffer.CleanUpFieldTypes`                            Cleans up field types.
:meth:`~wx.richtext.RichTextBuffer.CleanUpHandlers`                              Clean up file handlers.
:meth:`~wx.richtext.RichTextBuffer.ClearEventHandlers`                           Clear event handlers.
:meth:`~wx.richtext.RichTextBuffer.ClearStyleStack`                              Clears the style stack.
:meth:`~wx.richtext.RichTextBuffer.Clone`                                        Clones the buffer.
:meth:`~wx.richtext.RichTextBuffer.Copy`                                         Copies the buffer.
:meth:`~wx.richtext.RichTextBuffer.CopyToClipboard`                              Copy the range to the clipboard.
:meth:`~wx.richtext.RichTextBuffer.DeleteRangeWithUndo`                          Submits a command to delete this range.
:meth:`~wx.richtext.RichTextBuffer.EndAlignment`                                 Ends alignment.
:meth:`~wx.richtext.RichTextBuffer.EndAllStyles`                                 End all styles.
:meth:`~wx.richtext.RichTextBuffer.EndBatchUndo`                                 End collapsing undo/redo commands.
:meth:`~wx.richtext.RichTextBuffer.EndBold`                                      Ends using bold.
:meth:`~wx.richtext.RichTextBuffer.EndCharacterStyle`                            Ends named character style.
:meth:`~wx.richtext.RichTextBuffer.EndFont`                                      Ends using a font.
:meth:`~wx.richtext.RichTextBuffer.EndFontSize`                                  Ends using point size.
:meth:`~wx.richtext.RichTextBuffer.EndItalic`                                    Ends using italic.
:meth:`~wx.richtext.RichTextBuffer.EndLeftIndent`                                Ends left indent.
:meth:`~wx.richtext.RichTextBuffer.EndLineSpacing`                               Ends line spacing.
:meth:`~wx.richtext.RichTextBuffer.EndListStyle`                                 Ends named character style.
:meth:`~wx.richtext.RichTextBuffer.EndNumberedBullet`                            Ends numbered bullet.
:meth:`~wx.richtext.RichTextBuffer.EndParagraphSpacing`                          Ends paragraph spacing.
:meth:`~wx.richtext.RichTextBuffer.EndParagraphStyle`                            Ends named character style.
:meth:`~wx.richtext.RichTextBuffer.EndRightIndent`                               Ends right indent.
:meth:`~wx.richtext.RichTextBuffer.EndStandardBullet`                            Ends standard bullet.
:meth:`~wx.richtext.RichTextBuffer.EndStyle`                                     End the style.
:meth:`~wx.richtext.RichTextBuffer.EndSuppressUndo`                              End suppressing undo/redo commands.
:meth:`~wx.richtext.RichTextBuffer.EndSymbolBullet`                              Ends symbol bullet.
:meth:`~wx.richtext.RichTextBuffer.EndTextColour`                                Ends using a colour.
:meth:`~wx.richtext.RichTextBuffer.EndURL`                                       Ends URL.
:meth:`~wx.richtext.RichTextBuffer.EndUnderline`                                 Ends using underline.
:meth:`~wx.richtext.RichTextBuffer.FindDrawingHandler`                           Finds a drawing handler by name.
:meth:`~wx.richtext.RichTextBuffer.FindFieldType`                                Finds a field type by name.
:meth:`~wx.richtext.RichTextBuffer.FindHandlerByType`                            Finds a handler by type.
:meth:`~wx.richtext.RichTextBuffer.FindHandlerByExtension`                       Finds a file handler by extension and type.
:meth:`~wx.richtext.RichTextBuffer.FindHandlerByName`                            Finds a file handler by name.
:meth:`~wx.richtext.RichTextBuffer.FindHandlerByFilename`                        Finds a handler by filename or, if supplied, type.
:meth:`~wx.richtext.RichTextBuffer.GetBatchedCommand`                            Returns the collapsed command.
:meth:`~wx.richtext.RichTextBuffer.GetBulletProportion`                          Returns the factor to multiply by character height to get a reasonable bullet size.
:meth:`~wx.richtext.RichTextBuffer.GetBulletRightMargin`                         Returns the minimum margin between bullet and paragraph in 10ths of a mm.
:meth:`~wx.richtext.RichTextBuffer.GetCommandProcessor`                          Returns the command processor.
:meth:`~wx.richtext.RichTextBuffer.GetDimensionScale`                            Returns the scale factor for displaying certain dimensions such as indentation and inter-paragraph spacing.
:meth:`~wx.richtext.RichTextBuffer.GetDrawingHandlers`                           Returns the drawing handlers.
:meth:`~wx.richtext.RichTextBuffer.GetExtWildcard`                               Gets a wildcard string for the file dialog based on all the currently
:meth:`~wx.richtext.RichTextBuffer.GetFloatingLayoutMode`                        Returns the floating layout mode.
:meth:`~wx.richtext.RichTextBuffer.GetFontScale`                                 Returns the scale factor for displaying fonts, for example for more comfortable editing.
:meth:`~wx.richtext.RichTextBuffer.GetFontTable`                                 Returns the table storing fonts, for quick access and font reuse.
:meth:`~wx.richtext.RichTextBuffer.GetHandlerFlags`                              Gets the handler flags, controlling loading and saving.
:meth:`~wx.richtext.RichTextBuffer.GetHandlers`                                  Returns the file handlers.
:meth:`~wx.richtext.RichTextBuffer.GetRenderer`                                  Returns the renderer object.
:meth:`~wx.richtext.RichTextBuffer.GetScale`                                     Returns the scale factor for calculating dimensions.
:meth:`~wx.richtext.RichTextBuffer.GetStyleSheet`                                Returns the style sheet.
:meth:`~wx.richtext.RichTextBuffer.GetStyleStackSize`                            Returns the size of the style stack, for example to check correct nesting.
:meth:`~wx.richtext.RichTextBuffer.HitTest`                                      Hit-testing: returns a flag indicating hit test details, plus information about position.
:meth:`~wx.richtext.RichTextBuffer.Init`                                         Initialisation.
:meth:`~wx.richtext.RichTextBuffer.InitStandardHandlers`                         Initialise the standard file handlers.
:meth:`~wx.richtext.RichTextBuffer.InsertDrawingHandler`                         Inserts a drawing handler at the front.
:meth:`~wx.richtext.RichTextBuffer.InsertHandler`                                Inserts a file handler at the front.
:meth:`~wx.richtext.RichTextBuffer.InsertImageWithUndo`                          Submits a command to insert the given image.
:meth:`~wx.richtext.RichTextBuffer.InsertNewlineWithUndo`                        Submits a command to insert a newline.
:meth:`~wx.richtext.RichTextBuffer.InsertObjectWithUndo`                         Submits a command to insert an object.
:meth:`~wx.richtext.RichTextBuffer.InsertParagraphsWithUndo`                     Submits a command to insert paragraphs.
:meth:`~wx.richtext.RichTextBuffer.InsertTextWithUndo`                           Submits a command to insert the given text.
:meth:`~wx.richtext.RichTextBuffer.IsModified`                                   Returns ``True`` if the buffer was modified.
:meth:`~wx.richtext.RichTextBuffer.LoadFile`                                     Loads content from a stream or file.
:meth:`~wx.richtext.RichTextBuffer.Modify`                                       Mark modified.
:meth:`~wx.richtext.RichTextBuffer.PasteFromClipboard`                           Paste the clipboard content to the buffer.
:meth:`~wx.richtext.RichTextBuffer.PopStyleSheet`                                Pops the style sheet from the top of the style sheet stack.
:meth:`~wx.richtext.RichTextBuffer.PushStyleSheet`                               Pushes the style sheet to the top of the style sheet stack.
:meth:`~wx.richtext.RichTextBuffer.RemoveDrawingHandler`                         Removes a drawing handler.
:meth:`~wx.richtext.RichTextBuffer.RemoveEventHandler`                           Removes an event handler from the buffer's list of handlers, deleting the object if `deleteHandler`  is ``True``.
:meth:`~wx.richtext.RichTextBuffer.RemoveFieldType`                              Removes a field type by name.
:meth:`~wx.richtext.RichTextBuffer.RemoveHandler`                                Removes a file handler.
:meth:`~wx.richtext.RichTextBuffer.ResetAndClearCommands`                        Clears the buffer, adds an empty paragraph, and clears the command processor.
:meth:`~wx.richtext.RichTextBuffer.SaveFile`                                     Saves content to a stream or file.
:meth:`~wx.richtext.RichTextBuffer.SendEvent`                                    Send event to event handlers.
:meth:`~wx.richtext.RichTextBuffer.SetBulletProportion`                          Sets the factor to multiply by character height to get a reasonable bullet size.
:meth:`~wx.richtext.RichTextBuffer.SetBulletRightMargin`                         Sets the minimum margin between bullet and paragraph in 10ths of a mm.
:meth:`~wx.richtext.RichTextBuffer.SetDimensionScale`                            Sets the scale factor for displaying certain dimensions such as indentation and inter-paragraph spacing.
:meth:`~wx.richtext.RichTextBuffer.SetFloatingLayoutMode`                        Sets the floating layout mode.
:meth:`~wx.richtext.RichTextBuffer.SetFontScale`                                 Sets the scale factor for displaying fonts, for example for more comfortable editing.
:meth:`~wx.richtext.RichTextBuffer.SetFontTable`                                 Sets table storing fonts, for quick access and font reuse.
:meth:`~wx.richtext.RichTextBuffer.SetHandlerFlags`                              Sets the handler flags, controlling loading and saving.
:meth:`~wx.richtext.RichTextBuffer.SetRenderer`                                  Sets `renderer`  as the object to be used to render certain aspects of the content, such as bullets.
:meth:`~wx.richtext.RichTextBuffer.SetScale`                                     Sets the scale factor for calculating dimensions.
:meth:`~wx.richtext.RichTextBuffer.SetStyleSheet`                                Sets style sheet, if any.
:meth:`~wx.richtext.RichTextBuffer.SetStyleSheetAndNotify`                       Sets the style sheet and sends a notification of the change.
:meth:`~wx.richtext.RichTextBuffer.SubmitAction`                                 Submit the action immediately, or delay according to whether collapsing is on.
:meth:`~wx.richtext.RichTextBuffer.SuppressingUndo`                              Are we suppressing undo??
================================================================================ ================================================================================


|


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

================================================================================ ================================================================================
:attr:`~wx.richtext.RichTextBuffer.BatchedCommand`                               See :meth:`~wx.richtext.RichTextBuffer.GetBatchedCommand`
:attr:`~wx.richtext.RichTextBuffer.CommandProcessor`                             See :meth:`~wx.richtext.RichTextBuffer.GetCommandProcessor`
:attr:`~wx.richtext.RichTextBuffer.DimensionScale`                               See :meth:`~wx.richtext.RichTextBuffer.GetDimensionScale` and :meth:`~wx.richtext.RichTextBuffer.SetDimensionScale`
:attr:`~wx.richtext.RichTextBuffer.FontScale`                                    See :meth:`~wx.richtext.RichTextBuffer.GetFontScale` and :meth:`~wx.richtext.RichTextBuffer.SetFontScale`
:attr:`~wx.richtext.RichTextBuffer.FontTable`                                    See :meth:`~wx.richtext.RichTextBuffer.GetFontTable` and :meth:`~wx.richtext.RichTextBuffer.SetFontTable`
:attr:`~wx.richtext.RichTextBuffer.HandlerFlags`                                 See :meth:`~wx.richtext.RichTextBuffer.GetHandlerFlags` and :meth:`~wx.richtext.RichTextBuffer.SetHandlerFlags`
:attr:`~wx.richtext.RichTextBuffer.Scale`                                        See :meth:`~wx.richtext.RichTextBuffer.GetScale` and :meth:`~wx.richtext.RichTextBuffer.SetScale`
:attr:`~wx.richtext.RichTextBuffer.StyleSheet`                                   See :meth:`~wx.richtext.RichTextBuffer.GetStyleSheet` and :meth:`~wx.richtext.RichTextBuffer.SetStyleSheet`
:attr:`~wx.richtext.RichTextBuffer.StyleStackSize`                               See :meth:`~wx.richtext.RichTextBuffer.GetStyleStackSize`
================================================================================ ================================================================================


|


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


.. class:: wx.richtext.RichTextBuffer(RichTextParagraphLayoutBox)

   **Possible constructors**::

       RichTextBuffer()
       
       RichTextBuffer(obj)
       
   
   This is a kind of paragraph layout box, used to represent the whole
   buffer.



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



      |overload| Overloaded Implementations:

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

      
      **__init__** `(self)`
      
      Default constructor.                   
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, obj)`
      
      Copy constructor.                  
      
      
      :param `obj`: 
      :type `obj`: wx.richtext.RichTextBuffer
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. staticmethod:: AddDrawingHandler(handler)

      Adds a drawing handler to the end.                  


      :param `handler`: 
      :type `handler`: wx.richtext.RichTextDrawingHandler







   .. method:: AddEventHandler(self, handler)

      Adds an event handler.                  

      A buffer associated with a control has the control as the only event handler, but the application is free to add more if further notification is required. All handlers are notified of an event originating from the buffer, such as the replacement of a style sheet during loading. 

      The buffer never deletes any of the event handlers, unless :meth:`RemoveEventHandler`   is called with ``True`` as the second argument.                  


      :param `handler`: 
      :type `handler`: wx.EvtHandler




      :rtype: `bool`








   .. staticmethod:: AddFieldType(fieldType)

      Adds a field type.                  

                


      :param `fieldType`: 
      :type `fieldType`: wx.richtext.RichTextFieldType






      .. seealso:: :meth:`RemoveFieldType` , :meth:`FindFieldType` , :ref:`wx.richtext.RichTextField`, :ref:`wx.richtext.RichTextFieldType`, :ref:`wx.richtext.RichTextFieldTypeStandard`    








   .. staticmethod:: AddHandler(handler)

      Adds a file handler to the end.                  


      :param `handler`: 
      :type `handler`: wx.richtext.RichTextFileHandler







   .. method:: AddParagraph(self, text, paraStyle=None)

      Convenience function to add a paragraph of text.                  


      :param `text`: 
      :type `text`: string
      :param `paraStyle`: 
      :type `paraStyle`: wx.richtext.RichTextAttr




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








   .. method:: BatchingUndo(self)

      Returns ``True`` if we are collapsing commands.                  

      :rtype: `bool`








   .. method:: BeginAlignment(self, alignment)

      Begins using alignment.                  


      :param `alignment`: 
      :type `alignment`: wx.TextAttrAlignment




      :rtype: `bool`








   .. method:: BeginBatchUndo(self, cmdName)

      Begin collapsing undo/redo commands.                  

      Note that this may not work properly if combining commands that delete or insert content, changing ranges for subsequent actions. 

      `cmdName`  should be the name of the combined command that will appear next to Undo and Redo in the edit menu.                  


      :param `cmdName`: 
      :type `cmdName`: string




      :rtype: `bool`








   .. method:: BeginBold(self)

      Begins using bold.                  

      :rtype: `bool`








   .. method:: BeginCharacterStyle(self, characterStyle)

      Begins named character style.                  


      :param `characterStyle`: 
      :type `characterStyle`: string




      :rtype: `bool`








   .. method:: BeginFont(self, font)

      Begins using this font.                  


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




      :rtype: `bool`








   .. method:: BeginFontSize(self, pointSize)

      Begins using point size.                  


      :param `pointSize`: 
      :type `pointSize`: int




      :rtype: `bool`








   .. method:: BeginItalic(self)

      Begins using italic.                  

      :rtype: `bool`








   .. method:: BeginLeftIndent(self, leftIndent, leftSubIndent=0)

      Begins using `leftIndent`  for the left indent, and optionally `leftSubIndent`  for the sub-indent.                  

      Both are expressed in tenths of a millimetre. 

      The sub-indent is an offset from the left of the paragraph, and is used for all but the first line in a paragraph. A positive value will cause the first line to appear to the left of the subsequent lines, and a negative value will cause the first line to be indented relative to the subsequent lines.                  


      :param `leftIndent`: 
      :type `leftIndent`: int
      :param `leftSubIndent`: 
      :type `leftSubIndent`: int




      :rtype: `bool`








   .. method:: BeginLineSpacing(self, lineSpacing)

      Begins line spacing using the specified value.                  

      `spacing`  is a multiple, where 10 means single-spacing, 15 means 1.5 spacing, and 20 means float spacing. 

      The :ref:`wx.TextAttrLineSpacing`  enumeration values are defined for convenience.                  


      :param `lineSpacing`: 
      :type `lineSpacing`: int




      :rtype: `bool`








   .. method:: BeginListStyle(self, listStyle, level=1, number=1)

      Begins named list style.                  

      Optionally, you can also pass a level and a number.                  


      :param `listStyle`: 
      :type `listStyle`: string
      :param `level`: 
      :type `level`: int
      :param `number`: 
      :type `number`: int




      :rtype: `bool`








   .. method:: BeginNumberedBullet(self, bulletNumber, leftIndent, leftSubIndent, bulletStyle=TEXT_ATTR_BULLET_STYLE_ARABIC|TEXT_ATTR_BULLET_STYLE_PERIOD)

      Begins numbered bullet.                  

      This call will be needed for each item in the list, and the application should take care of incrementing the numbering. 

      `bulletNumber`  is a number, usually starting with 1. `leftIndent`  and `leftSubIndent`  are values in tenths of a millimetre. `bulletStyle`  is a bitlist of the following values: 

      :ref:`wx.richtext.RichTextBuffer`  uses indentation to render a bulleted item. The left indent is the distance between the margin and the bullet. The content of the paragraph, including the first line, starts at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the left of the actual paragraph is leftSubIndent.                  


      :param `bulletNumber`: 
      :type `bulletNumber`: int
      :param `leftIndent`: 
      :type `leftIndent`: int
      :param `leftSubIndent`: 
      :type `leftSubIndent`: int
      :param `bulletStyle`: 
      :type `bulletStyle`: int




      :rtype: `bool`








   .. method:: BeginParagraphSpacing(self, before, after)

      Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of a millimetre.                  


      :param `before`: 
      :type `before`: int
      :param `after`: 
      :type `after`: int




      :rtype: `bool`








   .. method:: BeginParagraphStyle(self, paragraphStyle)

      Begins named paragraph style.                  


      :param `paragraphStyle`: 
      :type `paragraphStyle`: string




      :rtype: `bool`








   .. method:: BeginRightIndent(self, rightIndent)

      Begins a right indent, specified in tenths of a millimetre.                  


      :param `rightIndent`: 
      :type `rightIndent`: int




      :rtype: `bool`








   .. method:: BeginStandardBullet(self, bulletName, leftIndent, leftSubIndent, bulletStyle=TEXT_ATTR_BULLET_STYLE_STANDARD)

      Begins applying a standard bullet, using one of the standard bullet names (currently  ``standard/circle``   or   ``standard/square`` .                   

      See :meth:`BeginNumberedBullet`   for an explanation of how indentation is used to render the bulleted paragraph.                  


      :param `bulletName`: 
      :type `bulletName`: string
      :param `leftIndent`: 
      :type `leftIndent`: int
      :param `leftSubIndent`: 
      :type `leftSubIndent`: int
      :param `bulletStyle`: 
      :type `bulletStyle`: int




      :rtype: `bool`








   .. method:: BeginStyle(self, style)

      Begin using a style.                  


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




      :rtype: `bool`








   .. method:: BeginSuppressUndo(self)

      Begin suppressing undo/redo commands.                  

      The way undo is suppressed may be implemented differently by each command. If not dealt with by a command implementation, then it will be implemented automatically by not storing the command in the undo history when the action is submitted to the command processor.                  

      :rtype: `bool`








   .. method:: BeginSymbolBullet(self, symbol, leftIndent, leftSubIndent, bulletStyle=TEXT_ATTR_BULLET_STYLE_SYMBOL)

      Begins applying a symbol bullet, using a character from the current font.                  

      See :meth:`BeginNumberedBullet`   for an explanation of how indentation is used to render the bulleted paragraph.                  


      :param `symbol`: 
      :type `symbol`: string
      :param `leftIndent`: 
      :type `leftIndent`: int
      :param `leftSubIndent`: 
      :type `leftSubIndent`: int
      :param `bulletStyle`: 
      :type `bulletStyle`: int




      :rtype: `bool`








   .. method:: BeginTextColour(self, colour)

      Begins using this colour.                  


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




      :rtype: `bool`








   .. method:: BeginURL(self, url, characterStyle=EmptyString)

      Begins applying ``wx.TEXT_ATTR_URL`` to the content.                  

      Pass a URL and optionally, a character style to apply, since it is common to mark a URL with a familiar style such as blue text with underlining.                  


      :param `url`: 
      :type `url`: string
      :param `characterStyle`: 
      :type `characterStyle`: string




      :rtype: `bool`








   .. method:: BeginUnderline(self)

      Begins using underline.                  

      :rtype: `bool`








   .. method:: CanPasteFromClipboard(self)

      Returns ``True`` if we can paste from the clipboard.                  

      :rtype: `bool`








   .. staticmethod:: CleanUpDrawingHandlers()

      Clean up drawing handlers.                   





   .. staticmethod:: CleanUpFieldTypes()

      Cleans up field types.                   





   .. staticmethod:: CleanUpHandlers()

      Clean up file handlers.                   





   .. method:: ClearEventHandlers(self)

      Clear event handlers.                   





   .. method:: ClearStyleStack(self)

      Clears the style stack.                   





   .. method:: Clone(self)

      Clones the buffer.                  

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








   .. method:: Copy(self, obj)

      Copies the buffer.                  


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







   .. method:: CopyToClipboard(self, range)

      Copy the range to the clipboard.                  


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




      :rtype: `bool`








   .. method:: DeleteRangeWithUndo(self, range, ctrl)

      Submits a command to delete this range.                  


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




      :rtype: `bool`








   .. method:: EndAlignment(self)

      Ends alignment.                  

      :rtype: `bool`








   .. method:: EndAllStyles(self)

      End all styles.                  

      :rtype: `bool`








   .. method:: EndBatchUndo(self)

      End collapsing undo/redo commands.                  

      :rtype: `bool`








   .. method:: EndBold(self)

      Ends using bold.                  

      :rtype: `bool`








   .. method:: EndCharacterStyle(self)

      Ends named character style.                  

      :rtype: `bool`








   .. method:: EndFont(self)

      Ends using a font.                  

      :rtype: `bool`








   .. method:: EndFontSize(self)

      Ends using point size.                  

      :rtype: `bool`








   .. method:: EndItalic(self)

      Ends using italic.                  

      :rtype: `bool`








   .. method:: EndLeftIndent(self)

      Ends left indent.                  

      :rtype: `bool`








   .. method:: EndLineSpacing(self)

      Ends line spacing.                  

      :rtype: `bool`








   .. method:: EndListStyle(self)

      Ends named character style.                  

      :rtype: `bool`








   .. method:: EndNumberedBullet(self)

      Ends numbered bullet.                  

      :rtype: `bool`








   .. method:: EndParagraphSpacing(self)

      Ends paragraph spacing.                  

      :rtype: `bool`








   .. method:: EndParagraphStyle(self)

      Ends named character style.                  

      :rtype: `bool`








   .. method:: EndRightIndent(self)

      Ends right indent.                  

      :rtype: `bool`








   .. method:: EndStandardBullet(self)

      Ends standard bullet.                  

      :rtype: `bool`








   .. method:: EndStyle(self)

      End the style.                  

      :rtype: `bool`








   .. method:: EndSuppressUndo(self)

      End suppressing undo/redo commands.                  

      :rtype: `bool`








   .. method:: EndSymbolBullet(self)

      Ends symbol bullet.                  

      :rtype: `bool`








   .. method:: EndTextColour(self)

      Ends using a colour.                  

      :rtype: `bool`








   .. method:: EndURL(self)

      Ends URL.                  

      :rtype: `bool`








   .. method:: EndUnderline(self)

      Ends using underline.                  

      :rtype: `bool`








   .. staticmethod:: FindDrawingHandler(name)

      Finds a drawing handler by name.                  


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




      :rtype: :ref:`wx.richtext.RichTextDrawingHandler`








   .. staticmethod:: FindFieldType(name)

      Finds a field type by name.                  

                


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




      :rtype: :ref:`wx.richtext.RichTextFieldType`







      .. seealso:: :meth:`RemoveFieldType` , :meth:`AddFieldType` , :ref:`wx.richtext.RichTextField`, :ref:`wx.richtext.RichTextFieldType`, :ref:`wx.richtext.RichTextFieldTypeStandard`    








   .. staticmethod:: FindHandlerByType(imageType)

      Finds a handler by type.                  


      :param `imageType`: 
      :type `imageType`: wx.richtext.RichTextFileType




      :rtype: :ref:`wx.richtext.RichTextFileHandler`








   .. staticmethod:: FindHandlerByExtension(extension, imageType)

      Finds a file handler by extension and type.                  


      :param `extension`: 
      :type `extension`: string
      :param `imageType`: 
      :type `imageType`: wx.richtext.RichTextFileType




      :rtype: :ref:`wx.richtext.RichTextFileHandler`








   .. staticmethod:: FindHandlerByName(name)

      Finds a file handler by name.                  


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




      :rtype: :ref:`wx.richtext.RichTextFileHandler`








   .. staticmethod:: FindHandlerByFilename(filename, imageType)

      Finds a handler by filename or, if supplied, type.                  


      :param `filename`: 
      :type `filename`: string
      :param `imageType`: 
      :type `imageType`: wx.richtext.RichTextFileType




      :rtype: :ref:`wx.richtext.RichTextFileHandler`








   .. method:: GetBatchedCommand(self)

      Returns the collapsed command.                  

      :rtype: :ref:`wx.richtext.RichTextCommand`








   .. staticmethod:: GetBulletProportion()

      Returns the factor to multiply by character height to get a reasonable bullet size.                  

      :rtype: `float`








   .. staticmethod:: GetBulletRightMargin()

      Returns the minimum margin between bullet and paragraph in 10ths of a mm.                  

      :rtype: `int`








   .. method:: GetCommandProcessor(self)

      Returns the command processor.                  

      A text buffer always creates its own command processor when it is initialized.                  

      :rtype: :ref:`CommandProcessor`








   .. method:: GetDimensionScale(self)

      Returns the scale factor for displaying certain dimensions such as indentation and inter-paragraph spacing.                  

      :rtype: `float`








   .. staticmethod:: GetDrawingHandlers()

      Returns the drawing handlers.                  

      :rtype: :ref:`RichTextDrawingHandlerList`








   .. staticmethod:: GetExtWildcard(combine=False, save=False)

                              Gets a wildcard string for the file dialog based on all the currently
                              loaded richtext file handlers, and a list that can be used to map
                              those filter types to the file handler type. 

      :rtype: :ref:`PyObject`








   .. staticmethod:: GetFloatingLayoutMode()

      Returns the floating layout mode.                  

      The default is ``True``, where objects are laid out according to their floating status.                  

      :rtype: `bool`








   .. method:: GetFontScale(self)

      Returns the scale factor for displaying fonts, for example for more comfortable editing.                  

      :rtype: `float`








   .. method:: GetFontTable(self)

      Returns the table storing fonts, for quick access and font reuse.                  

      :rtype: :ref:`wx.richtext.RichTextFontTable`








   .. method:: GetHandlerFlags(self)

      Gets the handler flags, controlling loading and saving.                  

      :rtype: `int`








   .. staticmethod:: GetHandlers()

      Returns the file handlers.                  

      :rtype: :ref:`RichTextFileHandlerList`








   .. staticmethod:: GetRenderer()

      Returns the renderer object.                  

      :rtype: :ref:`wx.richtext.RichTextRenderer`








   .. method:: GetScale(self)

      Returns the scale factor for calculating dimensions.                  

      :rtype: `float`








   .. method:: GetStyleSheet(self)

      Returns the style sheet.                  

      :rtype: :ref:`wx.richtext.RichTextStyleSheet`








   .. method:: GetStyleStackSize(self)

      Returns the size of the style stack, for example to check correct nesting.                  

      :rtype: `int`








   .. 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:: Init(self)

      Initialisation.                   





   .. staticmethod:: InitStandardHandlers()

      Initialise the standard file handlers.                  

      Currently, only the plain text loading/saving handler is initialised by default.                   





   .. staticmethod:: InsertDrawingHandler(handler)

      Inserts a drawing handler at the front.                  


      :param `handler`: 
      :type `handler`: wx.richtext.RichTextDrawingHandler







   .. staticmethod:: InsertHandler(handler)

      Inserts a file handler at the front.                  


      :param `handler`: 
      :type `handler`: wx.richtext.RichTextFileHandler







   .. method:: InsertImageWithUndo(self, pos, imageBlock, ctrl, flags=0, textAttr=RichTextAttr())

      Submits a command to insert the given image.                  


      :param `pos`: 
      :type `pos`: long
      :param `imageBlock`: 
      :type `imageBlock`: wx.richtext.RichTextImageBlock
      :param `ctrl`: 
      :type `ctrl`: wx.richtext.RichTextCtrl
      :param `flags`: 
      :type `flags`: int
      :param `textAttr`: 
      :type `textAttr`: wx.richtext.RichTextAttr




      :rtype: `bool`








   .. method:: InsertNewlineWithUndo(self, pos, ctrl, flags=0)

      Submits a command to insert a newline.                  


      :param `pos`: 
      :type `pos`: long
      :param `ctrl`: 
      :type `ctrl`: wx.richtext.RichTextCtrl
      :param `flags`: 
      :type `flags`: int




      :rtype: `bool`








   .. method:: InsertObjectWithUndo(self, pos, object, ctrl, flags)

      Submits a command to insert an object.                  


      :param `pos`: 
      :type `pos`: long
      :param `object`: 
      :type `object`: wx.richtext.RichTextObject
      :param `ctrl`: 
      :type `ctrl`: wx.richtext.RichTextCtrl
      :param `flags`: 
      :type `flags`: int




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








   .. method:: InsertParagraphsWithUndo(self, pos, paragraphs, ctrl, flags=0)

      Submits a command to insert paragraphs.                  


      :param `pos`: 
      :type `pos`: long
      :param `paragraphs`: 
      :type `paragraphs`: wx.richtext.RichTextParagraphLayoutBox
      :param `ctrl`: 
      :type `ctrl`: wx.richtext.RichTextCtrl
      :param `flags`: 
      :type `flags`: int




      :rtype: `bool`








   .. method:: InsertTextWithUndo(self, pos, text, ctrl, flags=0)

      Submits a command to insert the given text.                  


      :param `pos`: 
      :type `pos`: long
      :param `text`: 
      :type `text`: string
      :param `ctrl`: 
      :type `ctrl`: wx.richtext.RichTextCtrl
      :param `flags`: 
      :type `flags`: int




      :rtype: `bool`








   .. method:: IsModified(self)

      Returns ``True`` if the buffer was modified.                  

      :rtype: `bool`








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

      Loads content from a stream or file.                  

      Not all handlers will implement file loading.                   


      |overload| Overloaded Implementations:

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

      
      **LoadFile** `(self, filename, type=RICHTEXT_TYPE_ANY)`
      
      
      
      
      :param `filename`: 
      :type `filename`: string
      :param `type`: 
      :type `type`: wx.richtext.RichTextFileType
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **LoadFile** `(self, stream, type=RICHTEXT_TYPE_ANY)`
      
      
      
      
      :param `stream`: 
      :type `stream`: wx.InputStream
      :param `type`: 
      :type `type`: wx.richtext.RichTextFileType
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: Modify(self, modify=True)

      Mark modified.                  


      :param `modify`: 
      :type `modify`: bool







   .. method:: PasteFromClipboard(self, position)

      Paste the clipboard content to the buffer.                  


      :param `position`: 
      :type `position`: long




      :rtype: `bool`








   .. method:: PopStyleSheet(self)

      Pops the style sheet from the top of the style sheet stack.                  

      :rtype: :ref:`wx.richtext.RichTextStyleSheet`








   .. method:: PushStyleSheet(self, styleSheet)

      Pushes the style sheet to the top of the style sheet stack.                  


      :param `styleSheet`: 
      :type `styleSheet`: wx.richtext.RichTextStyleSheet




      :rtype: `bool`








   .. staticmethod:: RemoveDrawingHandler(name)

      Removes a drawing handler.                  


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




      :rtype: `bool`








   .. method:: RemoveEventHandler(self, handler, deleteHandler=False)

      Removes an event handler from the buffer's list of handlers, deleting the object if `deleteHandler`  is ``True``.                  


      :param `handler`: 
      :type `handler`: wx.EvtHandler
      :param `deleteHandler`: 
      :type `deleteHandler`: bool




      :rtype: `bool`








   .. staticmethod:: RemoveFieldType(name)

      Removes a field type by name.                  

                


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




      :rtype: `bool`







      .. seealso:: :meth:`AddFieldType` , :meth:`FindFieldType` , :ref:`wx.richtext.RichTextField`, :ref:`wx.richtext.RichTextFieldType`, :ref:`wx.richtext.RichTextFieldTypeStandard`    








   .. staticmethod:: RemoveHandler(name)

      Removes a file handler.                  


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




      :rtype: `bool`








   .. method:: ResetAndClearCommands(self)

      Clears the buffer, adds an empty paragraph, and clears the command processor.                   





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

      Saves content to a stream or file.                  

      Not all handlers will implement file saving.                   


      |overload| Overloaded Implementations:

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

      
      **SaveFile** `(self, filename, type=RICHTEXT_TYPE_ANY)`
      
      
      
      
      :param `filename`: 
      :type `filename`: string
      :param `type`: 
      :type `type`: wx.richtext.RichTextFileType
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **SaveFile** `(self, stream, type=RICHTEXT_TYPE_ANY)`
      
      
      
      
      :param `stream`: 
      :type `stream`: wx.OutputStream
      :param `type`: 
      :type `type`: wx.richtext.RichTextFileType
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: SendEvent(self, event, sendToAll=True)

      Send event to event handlers.                  

      If sendToAll is ``True``, will send to all event handlers, otherwise will stop at the first successful one.                  


      :param `event`: 
      :type `event`: wx.Event
      :param `sendToAll`: 
      :type `sendToAll`: bool




      :rtype: `bool`








   .. staticmethod:: SetBulletProportion(prop)

      Sets the factor to multiply by character height to get a reasonable bullet size.                  


      :param `prop`: 
      :type `prop`: float







   .. staticmethod:: SetBulletRightMargin(margin)

      Sets the minimum margin between bullet and paragraph in 10ths of a mm.                  


      :param `margin`: 
      :type `margin`: int







   .. method:: SetDimensionScale(self, dimScale)

      Sets the scale factor for displaying certain dimensions such as indentation and inter-paragraph spacing.                  

      This can be useful when editing in a small control where you still want legible text, but a minimum of wasted white space.                  


      :param `dimScale`: 
      :type `dimScale`: float







   .. staticmethod:: SetFloatingLayoutMode(mode)

      Sets the floating layout mode.                  

      Pass ``False`` to speed up editing by not performing floating layout. This setting affects all buffers.                  


      :param `mode`: 
      :type `mode`: bool







   .. method:: SetFontScale(self, fontScale)

      Sets the scale factor for displaying fonts, for example for more comfortable editing.                  


      :param `fontScale`: 
      :type `fontScale`: float







   .. method:: SetFontTable(self, table)

      Sets table storing fonts, for quick access and font reuse.                  


      :param `table`: 
      :type `table`: wx.richtext.RichTextFontTable







   .. method:: SetHandlerFlags(self, flags)

      Sets the handler flags, controlling loading and saving.                  


      :param `flags`: 
      :type `flags`: int







   .. staticmethod:: SetRenderer(renderer)

      Sets `renderer`  as the object to be used to render certain aspects of the content, such as bullets.                  

      You can override default rendering by deriving a new class from :ref:`wx.richtext.RichTextRenderer`  or :ref:`wx.richtext.RichTextStdRenderer`, overriding one or more virtual functions, and setting an instance of the class using this function.                  


      :param `renderer`: 
      :type `renderer`: wx.richtext.RichTextRenderer







   .. method:: SetScale(self, scale)

      Sets the scale factor for calculating dimensions.                  


      :param `scale`: 
      :type `scale`: float







   .. method:: SetStyleSheet(self, styleSheet)

      Sets style sheet, if any.                  

      This will allow the application to use named character and paragraph styles found in the style sheet. 

      Neither the buffer nor the control owns the style sheet so must be deleted by the application.                  


      :param `styleSheet`: 
      :type `styleSheet`: wx.richtext.RichTextStyleSheet







   .. method:: SetStyleSheetAndNotify(self, sheet)

      Sets the style sheet and sends a notification of the change.                  


      :param `sheet`: 
      :type `sheet`: wx.richtext.RichTextStyleSheet




      :rtype: `bool`








   .. method:: SubmitAction(self, action)

      Submit the action immediately, or delay according to whether collapsing is on.                  


      :param `action`: 
      :type `action`: wx.richtext.RichTextAction




      :rtype: `bool`








   .. method:: SuppressingUndo(self)

      Are we suppressing undo??                  

      :rtype: `bool`








   .. attribute:: BatchedCommand

      See :meth:`~wx.richtext.RichTextBuffer.GetBatchedCommand`


   .. attribute:: CommandProcessor

      See :meth:`~wx.richtext.RichTextBuffer.GetCommandProcessor`


   .. attribute:: DimensionScale

      See :meth:`~wx.richtext.RichTextBuffer.GetDimensionScale` and :meth:`~wx.richtext.RichTextBuffer.SetDimensionScale`


   .. attribute:: FontScale

      See :meth:`~wx.richtext.RichTextBuffer.GetFontScale` and :meth:`~wx.richtext.RichTextBuffer.SetFontScale`


   .. attribute:: FontTable

      See :meth:`~wx.richtext.RichTextBuffer.GetFontTable` and :meth:`~wx.richtext.RichTextBuffer.SetFontTable`


   .. attribute:: HandlerFlags

      See :meth:`~wx.richtext.RichTextBuffer.GetHandlerFlags` and :meth:`~wx.richtext.RichTextBuffer.SetHandlerFlags`


   .. attribute:: Scale

      See :meth:`~wx.richtext.RichTextBuffer.GetScale` and :meth:`~wx.richtext.RichTextBuffer.SetScale`


   .. attribute:: StyleSheet

      See :meth:`~wx.richtext.RichTextBuffer.GetStyleSheet` and :meth:`~wx.richtext.RichTextBuffer.SetStyleSheet`


   .. attribute:: StyleStackSize

      See :meth:`~wx.richtext.RichTextBuffer.GetStyleStackSize`

