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

Inheritance diagram for class
RichTextFieldTypeStandard:
|
|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 : str, label : str, displayStyle:
int=RICHTEXT_FIELD_STYLE_RECTANGLE) -> None
RichTextFieldTypeStandard(name : str, bitmap : Bitmap, displayStyle:
int=RICHTEXT_FIELD_STYLE_NO_BORDER) -> None
RichTextFieldTypeStandard() -> None
RichTextFieldTypeStandard(field : RichTextFieldTypeStandard) -> None
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:`
`
**__init__** `(self, name : str, label : str, displayStyle: int=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
:rtype: `None`
:html:`
`
**__init__** `(self, name : str, bitmap : Bitmap, displayStyle: int=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
:rtype: `None`
:html:`
`
**__init__** `(self)`
The default constructor.
:rtype: `None`
:html:`
`
**__init__** `(self, field : RichTextFieldTypeStandard)`
The copy constructor.
:param `field`:
:type `field`: wx.richtext.RichTextFieldTypeStandard
:rtype: `None`
:html:`
`
.. method:: Copy(self, field : RichTextFieldTypeStandard)
Copies the object.
:param `field`:
:type `field`: wx.richtext.RichTextFieldTypeStandard
:rtype: `None`
.. method:: Draw(self, obj : RichTextField, dc : DC, context : RichTextDrawingContext, range : RichTextRange, selection : RichTextSelection, rect : Rect, descent : int, style : int)
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: `Colour`
.. method:: GetBitmap(self)
Gets the bitmap label for fields of this type.
:rtype: `Bitmap`
.. method:: GetBorderColour(self)
Gets the colour used for drawing the field border.
:rtype: `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: `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: `str`
.. method:: GetRangeSize(self, obj : RichTextField, range : RichTextRange, size : Size, descent : int, dc : DC, context : RichTextDrawingContext, flags : int, position: Point=Point(0,0), parentSize: Size=DefaultSize, partialExtents: Optional[List[int]]=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 : RichTextField, dc : DC, context : RichTextDrawingContext, style : int)
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: `Size`
.. method:: GetTextColour(self)
Gets the colour used for drawing the text label.
:rtype: `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.
:rtype: `None`
.. method:: IsTopLevel(self, obj : RichTextField)
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 : RichTextField, dc : DC, context : RichTextDrawingContext, rect : Rect, parentRect : Rect, style : int)
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 : Colour)
Sets the colour used for drawing the field background.
:param `colour`:
:type `colour`: wx.Colour
:rtype: `None`
.. method:: SetBitmap(self, bitmap : Bitmap)
Sets the bitmap label for fields of this type.
:param `bitmap`:
:type `bitmap`: wx.Bitmap
:rtype: `None`
.. method:: SetBorderColour(self, colour : Colour)
Sets the colour used for drawing the field border.
:param `colour`:
:type `colour`: wx.Colour
:rtype: `None`
.. method:: SetDisplayStyle(self, displayStyle : int)
Sets the display style for fields of this type.
:param `displayStyle`:
:type `displayStyle`: int
:rtype: `None`
.. method:: SetFont(self, font : Font)
Sets the font used for drawing the text label.
:param `font`:
:type `font`: wx.Font
:rtype: `None`
.. method:: SetHorizontalMargin(self, margin : int)
Sets the horizontal margin surrounding the field object.
:param `margin`:
:type `margin`: int
:rtype: `None`
.. method:: SetHorizontalPadding(self, padding : int)
Sets the horizontal padding (the distance between the border and the text).
:param `padding`:
:type `padding`: int
:rtype: `None`
.. method:: SetLabel(self, label : str)
Sets the text label for fields of this type.
:param `label`:
:type `label`: string
:rtype: `None`
.. method:: SetTextColour(self, colour : Colour)
Sets the colour used for drawing the text label.
:param `colour`:
:type `colour`: wx.Colour
:rtype: `None`
.. method:: SetVerticalMargin(self, margin : int)
Sets the vertical margin surrounding the field object.
:param `margin`:
:type `margin`: int
:rtype: `None`
.. method:: SetVerticalPadding(self, padding : int)
Sets the vertical padding (the distance between the border and the text).
:param `padding`:
:type `padding`: int
:rtype: `None`
.. 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`