wx.richtext.RichTextCell¶
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 wx.richtext.RichTextTable.
A cell’s appearance can be changed via its associated 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 SetColSpan
and SetRowSpan
methods. Attempts to set too large a span are silently truncated to the table edge.
Class Hierarchy¶
Methods Summary¶
Default constructor; optionally pass the parent object. |
|
Returns |
|
Clones the object. |
|
Draw the item, within the given range. |
|
Edits the object’s properties via a GUI. |
|
Returns the number of columns spanned by the cell. |
|
Returns the label to be used for the properties context menu item. |
|
Returns the number of rows spanned by the cell. |
|
Returns the |
|
Hit-testing: returns a flag indicating hit test details, plus information about position. |
|
Set the number of columns spanned by the cell. |
|
Set the number of rows spanned by the cell. |
Properties Summary¶
See |
|
See |
|
See |
Class API¶
- class wx.richtext.RichTextCell(RichTextBox)¶
Possible constructors:
RichTextCell(parent=None) -> None RichTextCell(obj) -> None
RichTextCell is the cell in a table, in which the user can type.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self, parent=None)
Default constructor; optionally pass the parent object.
- Parameters:
parent (wx.richtext.RichTextObject)
- Return type:
None
__init__ (self, obj)
Copy constructor.
- Parameters:
obj (wx.richtext.RichTextCell)
- Return type:
None
- CanEditProperties(self)¶
Returns
True
if we can edit the object’s properties via a GUI.- Return type:
bool
- Clone(self)¶
Clones the object.
- Return type:
- Copy(self, obj)¶
- Parameters:
obj (wx.richtext.RichTextCell)
- Return type:
None
- Draw(self, dc, context, range, selection, rect, descent, style)¶
Draw the item, within the given range.
Some objects may ignore the range (for example paragraphs) while others must obey it (lines, to implement wrapping)
- Parameters:
dc (wx.DC)
context (wx.richtext.RichTextDrawingContext)
range (wx.richtext.RichTextRange)
selection (wx.richtext.RichTextSelection)
rect (wx.Rect)
descent (int)
style (int)
- Return type:
bool
- EditProperties(self, parent, buffer)¶
Edits the object’s properties via a GUI.
- Parameters:
parent (wx.Window)
buffer (wx.richtext.RichTextBuffer)
- Return type:
bool
- 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.
- Return type:
int
Added in version 2.9.5.
See also
- GetPropertiesMenuLabel(self)¶
Returns the label to be used for the properties context menu item.
- Return type:
str
- 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.
- Return type:
int
Added in version 2.9.5.
See also
- GetXMLNodeName(self)¶
Returns the
XML
node name of this object.This must be overridden for XmlNode-base
XML
export to work.- Return type:
str
- 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).
- Parameters:
dc (wx.DC)
context (wx.richtext.RichTextDrawingContext)
pt (wx.Point)
flags (int)
- Return type:
Tuple[int, int, RichTextObject, RichTextObject]
- Returns:
One of the wx.richtext.RichTextHitTestFlags values.
- SetColSpan(self, span)¶
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.
- Parameters:
span (long)
- Return type:
None
Added in version 2.9.5.
See also
- SetRowSpan(self, span)¶
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.
- Parameters:
span (long)
- Return type:
None
Added in version 2.9.5.
See also
Properties¶
- ColSpan¶
See
GetColSpan
andSetColSpan
- PropertiesMenuLabel¶
- RowSpan¶
See
GetRowSpan
andSetRowSpan
- XMLNodeName¶
See
GetXMLNodeName