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

==========================================================================================================================================
|phoenix_title|  **wx.richtext.RichTextFieldTypeStandard**
==========================================================================================================================================

A field type that can handle fields with text or bitmap labels, with a small range of styles for implementing rectangular fields and fields that can be used for start and end tags.          

The border, text and background colours can be customised; the default is white text on a black background. 

The following display styles can be used. 





.. _RichTextFieldTypeStandard-styles:

|styles| Window Styles
================================

This class supports the following styles: 

  

- ``RICHTEXT_FIELD_STYLE_COMPOSITE``: Creates a composite field; you will probably need to derive a new class to implement UpdateField.  
- ``RICHTEXT_FIELD_STYLE_RECTANGLE``: Shows a rounded rectangle background.  
- ``RICHTEXT_FIELD_STYLE_NO_BORDER``: Suppresses the background and border; mostly used with a bitmap label.  
- ``RICHTEXT_FIELD_STYLE_START_TAG``: Shows a start tag background, with the pointy end facing right.  
- ``RICHTEXT_FIELD_STYLE_END_TAG``: Shows an end tag background, with the pointy end facing left.  








         



.. seealso:: :ref:`wx.richtext.RichTextFieldType`, :ref:`wx.richtext.RichTextField`, :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>RichTextFieldTypeStandard</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.RichTextFieldTypeStandard_inheritance.png" alt="Inheritance diagram of RichTextFieldTypeStandard" 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.RichTextFieldTypeStandard.html" title="wx.richtext.RichTextFieldTypeStandard" alt="" coords="5,160,277,189"/> <area shape="rect" id="node2" href="wx.richtext.RichTextFieldType.html" title="wx.richtext.RichTextFieldType" alt="" coords="34,83,249,112"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="98,5,185,35"/> </map> 
   </p>
   </div>

|


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

================================================================================ ================================================================================
:meth:`~wx.richtext.RichTextFieldTypeStandard.__init__`                          Constructor, creating a field type definition with a text label.
:meth:`~wx.richtext.RichTextFieldTypeStandard.Copy`                              Copies the object.
:meth:`~wx.richtext.RichTextFieldTypeStandard.Draw`                              Draw the item, within the given range.
:meth:`~wx.richtext.RichTextFieldTypeStandard.GetBackgroundColour`               Gets the colour used for drawing the field background.
:meth:`~wx.richtext.RichTextFieldTypeStandard.GetBitmap`                         Gets the bitmap label for fields of this type.
:meth:`~wx.richtext.RichTextFieldTypeStandard.GetBorderColour`                   Gets the colour used for drawing the field border.
:meth:`~wx.richtext.RichTextFieldTypeStandard.GetDisplayStyle`                   Gets the display style for fields of this type.
:meth:`~wx.richtext.RichTextFieldTypeStandard.GetFont`                           Gets the font used for drawing the text label.
:meth:`~wx.richtext.RichTextFieldTypeStandard.GetHorizontalMargin`               Gets the horizontal margin surrounding the field object.
:meth:`~wx.richtext.RichTextFieldTypeStandard.GetHorizontalPadding`              Sets the horizontal padding (the distance between the border and the text).
:meth:`~wx.richtext.RichTextFieldTypeStandard.GetLabel`                          Returns the text label for fields of this type.
:meth:`~wx.richtext.RichTextFieldTypeStandard.GetRangeSize`                      Returns the object size for the given range.
:meth:`~wx.richtext.RichTextFieldTypeStandard.GetSize`                           Get the size of the field, given the label, font size, and so on.
:meth:`~wx.richtext.RichTextFieldTypeStandard.GetTextColour`                     Gets the colour used for drawing the text label.
:meth:`~wx.richtext.RichTextFieldTypeStandard.GetVerticalMargin`                 Gets the vertical margin surrounding the field object.
:meth:`~wx.richtext.RichTextFieldTypeStandard.GetVerticalPadding`                Gets the vertical padding (the distance between the border and the text).
:meth:`~wx.richtext.RichTextFieldTypeStandard.Init`                              Initialises the object.
:meth:`~wx.richtext.RichTextFieldTypeStandard.IsTopLevel`                        Returns ``True`` if the display type is ``RICHTEXT_FIELD_STYLE_COMPOSITE``, ``False`` otherwise.
:meth:`~wx.richtext.RichTextFieldTypeStandard.Layout`                            Lay the item out at the specified position with the given size constraint.
:meth:`~wx.richtext.RichTextFieldTypeStandard.SetBackgroundColour`               Sets the colour used for drawing the field background.
:meth:`~wx.richtext.RichTextFieldTypeStandard.SetBitmap`                         Sets the bitmap label for fields of this type.
:meth:`~wx.richtext.RichTextFieldTypeStandard.SetBorderColour`                   Sets the colour used for drawing the field border.
:meth:`~wx.richtext.RichTextFieldTypeStandard.SetDisplayStyle`                   Sets the display style for fields of this type.
:meth:`~wx.richtext.RichTextFieldTypeStandard.SetFont`                           Sets the font used for drawing the text label.
:meth:`~wx.richtext.RichTextFieldTypeStandard.SetHorizontalMargin`               Sets the horizontal margin surrounding the field object.
:meth:`~wx.richtext.RichTextFieldTypeStandard.SetHorizontalPadding`              Sets the horizontal padding (the distance between the border and the text).
:meth:`~wx.richtext.RichTextFieldTypeStandard.SetLabel`                          Sets the text label for fields of this type.
:meth:`~wx.richtext.RichTextFieldTypeStandard.SetTextColour`                     Sets the colour used for drawing the text label.
:meth:`~wx.richtext.RichTextFieldTypeStandard.SetVerticalMargin`                 Sets the vertical margin surrounding the field object.
:meth:`~wx.richtext.RichTextFieldTypeStandard.SetVerticalPadding`                Sets the vertical padding (the distance between the border and the text).
================================================================================ ================================================================================


|


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

================================================================================ ================================================================================
:attr:`~wx.richtext.RichTextFieldTypeStandard.BackgroundColour`                  See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetBackgroundColour` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetBackgroundColour`
:attr:`~wx.richtext.RichTextFieldTypeStandard.Bitmap`                            See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetBitmap` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetBitmap`
:attr:`~wx.richtext.RichTextFieldTypeStandard.BorderColour`                      See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetBorderColour` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetBorderColour`
:attr:`~wx.richtext.RichTextFieldTypeStandard.DisplayStyle`                      See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetDisplayStyle` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetDisplayStyle`
:attr:`~wx.richtext.RichTextFieldTypeStandard.Font`                              See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetFont` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetFont`
:attr:`~wx.richtext.RichTextFieldTypeStandard.HorizontalMargin`                  See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetHorizontalMargin` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetHorizontalMargin`
:attr:`~wx.richtext.RichTextFieldTypeStandard.HorizontalPadding`                 See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetHorizontalPadding` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetHorizontalPadding`
:attr:`~wx.richtext.RichTextFieldTypeStandard.Label`                             See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetLabel` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetLabel`
:attr:`~wx.richtext.RichTextFieldTypeStandard.TextColour`                        See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetTextColour` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetTextColour`
:attr:`~wx.richtext.RichTextFieldTypeStandard.VerticalMargin`                    See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetVerticalMargin` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetVerticalMargin`
:attr:`~wx.richtext.RichTextFieldTypeStandard.VerticalPadding`                   See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetVerticalPadding` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetVerticalPadding`
================================================================================ ================================================================================


|


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


.. class:: wx.richtext.RichTextFieldTypeStandard(RichTextFieldType)

   **Possible constructors**::

       RichTextFieldTypeStandard(name, label,
                                 displayStyle=RICHTEXT_FIELD_STYLE_RECTANGLE)
       
       RichTextFieldTypeStandard(name, bitmap,
                                 displayStyle=RICHTEXT_FIELD_STYLE_NO_BORDER)
       
       RichTextFieldTypeStandard()
       
       RichTextFieldTypeStandard(field)
       
   
   A field type that can handle fields with text or bitmap labels, with a
   small range of styles for implementing rectangular fields and fields
   that can be used for start and end tags.



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



      |overload| Overloaded Implementations:

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

      
      **__init__** `(self, name, label, displayStyle=RICHTEXT_FIELD_STYLE_RECTANGLE)`
      
      Constructor, creating a field type definition with a text label.                  
      
      
      
      
      :param `name`: The name of the type definition. This must be unique, and is the type name used when adding a field to a control.   
      :type `name`: string
      :param `label`: The text label to be shown on the field.   
      :type `label`: string
      :param `displayStyle`: The display style: one of ``RICHTEXT_FIELD_STYLE_RECTANGLE``, ``RICHTEXT_FIELD_STYLE_NO_BORDER``, ``RICHTEXT_FIELD_STYLE_START_TAG``, ``RICHTEXT_FIELD_STYLE_END_TAG``.   
      :type `displayStyle`: int
      
      
      
      
      
      
      
      
                        
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, name, bitmap, displayStyle=RICHTEXT_FIELD_STYLE_NO_BORDER)`
      
      Constructor, creating a field type definition with a bitmap label.                  
      
      
      
      
      :param `name`: The name of the type definition. This must be unique, and is the type name used when adding a field to a control.   
      :type `name`: string
      :param `bitmap`: The bitmap label to be shown on the field.   
      :type `bitmap`: wx.Bitmap
      :param `displayStyle`: The display style: one of ``RICHTEXT_FIELD_STYLE_RECTANGLE``, ``RICHTEXT_FIELD_STYLE_NO_BORDER``, ``RICHTEXT_FIELD_STYLE_START_TAG``, ``RICHTEXT_FIELD_STYLE_END_TAG``.   
      :type `displayStyle`: int
      
      
      
      
      
      
      
      
                        
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

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

      
      **__init__** `(self, field)`
      
      The copy constructor.                  
      
      
      :param `field`: 
      :type `field`: wx.richtext.RichTextFieldTypeStandard
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: Copy(self, field)

      Copies the object.                  


      :param `field`: 
      :type `field`: wx.richtext.RichTextFieldTypeStandard







   .. method:: Draw(self, obj, 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 `obj`: 
      :type `obj`: wx.richtext.RichTextField
      :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`








   .. method:: GetBackgroundColour(self)

      Gets the colour used for drawing the field background.                  

      :rtype: :ref:`Colour`








   .. method:: GetBitmap(self)

      Gets the bitmap label for fields of this type.                  

      :rtype: :ref:`Bitmap`








   .. method:: GetBorderColour(self)

      Gets the colour used for drawing the field border.                  

      :rtype: :ref:`Colour`








   .. method:: GetDisplayStyle(self)

      Gets the display style for fields of this type.                  

      :rtype: `int`








   .. method:: GetFont(self)

      Gets the font used for drawing the text label.                  

      :rtype: :ref:`Font`








   .. method:: GetHorizontalMargin(self)

      Gets the horizontal margin surrounding the field object.                  

      :rtype: `int`








   .. method:: GetHorizontalPadding(self)

      Sets the horizontal padding (the distance between the border and the text).                  

      :rtype: `int`








   .. method:: GetLabel(self)

      Returns the text label for fields of this type.                  

      :rtype: `string`








   .. method:: GetRangeSize(self, obj, 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 `obj`: 
      :type `obj`: wx.richtext.RichTextField
      :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:: GetSize(self, obj, dc, context, style)

      Get the size of the field, given the label, font size, and so on.                  


      :param `obj`: 
      :type `obj`: wx.richtext.RichTextField
      :param `dc`: 
      :type `dc`: wx.DC
      :param `context`: 
      :type `context`: wx.richtext.RichTextDrawingContext
      :param `style`: 
      :type `style`: int




      :rtype: :ref:`Size`








   .. method:: GetTextColour(self)

      Gets the colour used for drawing the text label.                  

      :rtype: :ref:`Colour`








   .. method:: GetVerticalMargin(self)

      Gets the vertical margin surrounding the field object.                  

      :rtype: `int`








   .. method:: GetVerticalPadding(self)

      Gets the vertical padding (the distance between the border and the text).                  

      :rtype: `int`








   .. method:: Init(self)

      Initialises the object.                   





   .. method:: IsTopLevel(self, obj)

      Returns ``True`` if the display type is ``RICHTEXT_FIELD_STYLE_COMPOSITE``, ``False`` otherwise.                  


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




      :rtype: `bool`








   .. method:: Layout(self, obj, 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 `obj`: 
      :type `obj`: wx.richtext.RichTextField
      :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:: SetBackgroundColour(self, colour)

      Sets the colour used for drawing the field background.                  


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







   .. method:: SetBitmap(self, bitmap)

      Sets the bitmap label for fields of this type.                  


      :param `bitmap`: 
      :type `bitmap`: wx.Bitmap







   .. method:: SetBorderColour(self, colour)

      Sets the colour used for drawing the field border.                  


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







   .. method:: SetDisplayStyle(self, displayStyle)

      Sets the display style for fields of this type.                  


      :param `displayStyle`: 
      :type `displayStyle`: int







   .. method:: SetFont(self, font)

      Sets the font used for drawing the text label.                  


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







   .. method:: SetHorizontalMargin(self, margin)

      Sets the horizontal margin surrounding the field object.                  


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







   .. method:: SetHorizontalPadding(self, padding)

      Sets the horizontal padding (the distance between the border and the text).                  


      :param `padding`: 
      :type `padding`: int







   .. method:: SetLabel(self, label)

      Sets the text label for fields of this type.                  


      :param `label`: 
      :type `label`: string







   .. method:: SetTextColour(self, colour)

      Sets the colour used for drawing the text label.                  


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







   .. method:: SetVerticalMargin(self, margin)

      Sets the vertical margin surrounding the field object.                  


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







   .. method:: SetVerticalPadding(self, padding)

      Sets the vertical padding (the distance between the border and the text).                  


      :param `padding`: 
      :type `padding`: int







   .. attribute:: BackgroundColour

      See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetBackgroundColour` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetBackgroundColour`


   .. attribute:: Bitmap

      See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetBitmap` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetBitmap`


   .. attribute:: BorderColour

      See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetBorderColour` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetBorderColour`


   .. attribute:: DisplayStyle

      See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetDisplayStyle` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetDisplayStyle`


   .. attribute:: Font

      See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetFont` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetFont`


   .. attribute:: HorizontalMargin

      See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetHorizontalMargin` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetHorizontalMargin`


   .. attribute:: HorizontalPadding

      See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetHorizontalPadding` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetHorizontalPadding`


   .. attribute:: Label

      See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetLabel` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetLabel`


   .. attribute:: TextColour

      See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetTextColour` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetTextColour`


   .. attribute:: VerticalMargin

      See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetVerticalMargin` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetVerticalMargin`


   .. attribute:: VerticalPadding

      See :meth:`~wx.richtext.RichTextFieldTypeStandard.GetVerticalPadding` and :meth:`~wx.richtext.RichTextFieldTypeStandard.SetVerticalPadding`

