.. 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.RichTextCell:
==========================================================================================================================================
|phoenix_title| **wx.richtext.RichTextCell**
==========================================================================================================================================
:ref:`wx.richtext.RichTextCell` is the cell in a table, in which the user can type.
As well as text, it can also contain objects e.g. an image, or even another :ref:`wx.richtext.RichTextTable`.
A cell's appearance can be changed via its associated :ref:`wx.richtext.RichTextAttr`; for example its size altered or its background colour set. It also has the properties of column- and row-span. By default these are 1, meaning that the cell only spans itself, but can be increased using the :meth:`~wx.richtext.RichTextCell.SetColSpan` and :meth:`~wx.richtext.RichTextCell.SetRowSpan` methods. Attempts to set too large a span are silently truncated to the table edge.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
RichTextCell:
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.richtext.RichTextCell.__init__` Default constructor; optionally pass the parent object.
:meth:`~wx.richtext.RichTextCell.CanEditProperties` Returns ``True`` if we can edit the object's properties via a GUI.
:meth:`~wx.richtext.RichTextCell.Clone` Clones the object.
:meth:`~wx.richtext.RichTextCell.Copy`
:meth:`~wx.richtext.RichTextCell.Draw` Draw the item, within the given range.
:meth:`~wx.richtext.RichTextCell.EditProperties` Edits the object's properties via a GUI.
:meth:`~wx.richtext.RichTextCell.GetColSpan` Returns the number of columns spanned by the cell.
:meth:`~wx.richtext.RichTextCell.GetPropertiesMenuLabel` Returns the label to be used for the properties context menu item.
:meth:`~wx.richtext.RichTextCell.GetRowSpan` Returns the number of rows spanned by the cell.
:meth:`~wx.richtext.RichTextCell.GetXMLNodeName` Returns the ``XML`` node name of this object.
:meth:`~wx.richtext.RichTextCell.HitTest` Hit-testing: returns a flag indicating hit test details, plus information about position.
:meth:`~wx.richtext.RichTextCell.SetColSpan` Set the number of columns spanned by the cell.
:meth:`~wx.richtext.RichTextCell.SetRowSpan` Set the number of rows spanned by the cell.
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.richtext.RichTextCell.ColSpan` See :meth:`~wx.richtext.RichTextCell.GetColSpan` and :meth:`~wx.richtext.RichTextCell.SetColSpan`
:attr:`~wx.richtext.RichTextCell.PropertiesMenuLabel` See :meth:`~wx.richtext.RichTextCell.GetPropertiesMenuLabel`
:attr:`~wx.richtext.RichTextCell.RowSpan` See :meth:`~wx.richtext.RichTextCell.GetRowSpan` and :meth:`~wx.richtext.RichTextCell.SetRowSpan`
:attr:`~wx.richtext.RichTextCell.XMLNodeName` See :meth:`~wx.richtext.RichTextCell.GetXMLNodeName`
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.richtext.RichTextCell(RichTextBox)
**Possible constructors**::
RichTextCell(parent: Optional[RichTextObject]=None) -> None
RichTextCell(obj : RichTextCell) -> None
RichTextCell is the cell in a table, in which the user can type.
.. method:: __init__(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**__init__** `(self, parent: Optional[RichTextObject]=None)`
Default constructor; optionally pass the parent object.
:param `parent`:
:type `parent`: wx.richtext.RichTextObject
:rtype: `None`
:html:`
`
**__init__** `(self, obj : RichTextCell)`
Copy constructor.
:param `obj`:
:type `obj`: wx.richtext.RichTextCell
:rtype: `None`
:html:`
`
.. method:: CanEditProperties(self)
Returns ``True`` if we can edit the object's properties via a GUI.
:rtype: `bool`
.. method:: Clone(self)
Clones the object.
:rtype: :ref:`wx.richtext.RichTextObject`
.. method:: Copy(self, obj : RichTextCell)
:param `obj`:
:type `obj`: wx.richtext.RichTextCell
:rtype: `None`
.. method:: Draw(self, 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 `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:: EditProperties(self, parent : Window, buffer : RichTextBuffer)
Edits the object's properties via a GUI.
:param `parent`:
:type `parent`: wx.Window
:param `buffer`:
:type `buffer`: wx.richtext.RichTextBuffer
:rtype: `bool`
.. method:: GetColSpan(self)
Returns the number of columns spanned by the cell.
By default a cell doesn't span extra columns, so this function returns 1.
:rtype: `int`
.. versionadded:: 2.9.5
.. seealso:: :meth:`SetColSpan` , :meth:`GetRowSpan`
.. method:: GetPropertiesMenuLabel(self)
Returns the label to be used for the properties context menu item.
:rtype: `str`
.. method:: GetRowSpan(self)
Returns the number of rows spanned by the cell.
By default a cell doesn't span extra rows, so this function returns 1.
:rtype: `int`
.. versionadded:: 2.9.5
.. seealso:: :meth:`SetRowSpan` , :meth:`GetColSpan`
.. method:: GetXMLNodeName(self)
Returns the ``XML`` node name of this object.
This must be overridden for XmlNode-base ``XML`` export to work.
:rtype: `str`
.. method:: HitTest(self, dc : DC, context : RichTextDrawingContext, pt : Point, flags: int=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: :ref:`Tuple[int, int, RichTextObject, RichTextObject]`
:returns:
One of the :ref:`wx.richtext.RichTextHitTestFlags` values.
.. method:: SetColSpan(self, span : int)
Set the number of columns spanned by the cell.
By default colspan is 1 i.e. a cell doesn't span extra columns. Pass a value >1 to change this. Attempting to set a colspan <1 will assert and be ignored.
:param `span`:
:type `span`: long
:rtype: `None`
.. versionadded:: 2.9.5
.. seealso:: :meth:`GetColSpan` , :meth:`SetRowSpan`
.. method:: SetRowSpan(self, span : int)
Set the number of rows spanned by the cell.
By default colspan is 1 i.e. a cell doesn't span extra rows. Pass a value >1 to change this. Attempting to set a rowspan <1 will assert and be ignored.
:param `span`:
:type `span`: long
:rtype: `None`
.. versionadded:: 2.9.5
.. seealso:: :meth:`GetRowSpan` , :meth:`SetColSpan`
.. attribute:: ColSpan
See :meth:`~wx.richtext.RichTextCell.GetColSpan` and :meth:`~wx.richtext.RichTextCell.SetColSpan`
.. attribute:: PropertiesMenuLabel
See :meth:`~wx.richtext.RichTextCell.GetPropertiesMenuLabel`
.. attribute:: RowSpan
See :meth:`~wx.richtext.RichTextCell.GetRowSpan` and :meth:`~wx.richtext.RichTextCell.SetRowSpan`
.. attribute:: XMLNodeName
See :meth:`~wx.richtext.RichTextCell.GetXMLNodeName`