wx.richtext.RichTextPlainText¶
This object represents a single piece of text.
Class Hierarchy¶
Methods Summary¶
Constructor. |
|
Calculates the range of the object. |
|
Returns |
|
Returns |
|
Clones the object. |
|
Deletes the given range. |
|
Do a split from pos, returning an object containing the second part, and setting the first part in ‘this’. |
|
Draw the item, within the given range. |
|
Get the first position from pos that has a line break character. |
|
Returns the object size for the given range. |
|
Returns the text. |
|
Returns any text in this object for the given range. |
|
Returns the |
|
Imports this object from |
|
Returns |
|
Lay the item out at the specified position with the given size constraint. |
|
Returns |
|
Sets the text. |
|
Returns the final object in the split objects if this object was split due to differences between sub-object virtual attributes. |
|
Does this object take note of paragraph attributes? Text and image objects don’t. |
Properties Summary¶
See |
Class API¶
- class wx.richtext.RichTextPlainText(RichTextObject)¶
Possible constructors:
RichTextPlainText(text='', parent=None, style=None) -> None RichTextPlainText(obj) -> None
This object represents a single piece of text.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self, text=’’, parent=None, style=None)
Constructor.
- Parameters:
text (string)
parent (wx.richtext.RichTextObject)
style (wx.richtext.RichTextAttr)
- Return type:
None
__init__ (self, obj)
Copy constructor.
- Parameters:
- Return type:
None
- CalculateRange(self, start)¶
Calculates the range of the object.
By default, guess that the object is 1 unit long.
- Parameters:
start (long)
- Return type:
int
- CanMerge(self, object, context)¶
Returns
True
if this object can merge itself with the given one.- Parameters:
object (wx.richtext.RichTextObject)
context (wx.richtext.RichTextDrawingContext)
- Return type:
bool
- CanSplit(self, context)¶
Returns
True
if this object can potentially be split, by virtue of having different virtual attributes for individual sub-objects.- Parameters:
context (wx.richtext.RichTextDrawingContext)
- Return type:
bool
- Clone(self)¶
Clones the object.
- Return type:
- Copy(self, obj)¶
- Parameters:
- Return type:
None
- DeleteRange(self, range)¶
Deletes the given range.
- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
bool
- DoSplit(self, pos)¶
Do a split from pos, returning an object containing the second part, and setting the first part in ‘this’.
- Parameters:
pos (long)
- Return type:
- 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
- GetFirstLineBreakPosition(self, pos)¶
Get the first position from pos that has a line break character.
- Parameters:
pos (long)
- Return type:
int
- GetRangeSize(self, 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.- Parameters:
range (wx.richtext.RichTextRange)
size (wx.Size)
descent (int)
dc (wx.DC)
context (wx.richtext.RichTextDrawingContext)
flags (int)
position (wx.Point)
parentSize (wx.Size)
partialExtents (list of integers)
- Return type:
bool
- GetText(self)¶
Returns the text.
- Return type:
str
- GetTextForRange(self, range)¶
Returns any text in this object for the given range.
- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
str
- GetXMLNodeName(self)¶
Returns the
XML
node name of this object.This must be overridden for XmlNode-base
XML
export to work.- Return type:
str
- ImportFromXML(self, buffer, node, handler, recurse)¶
Imports this object from
XML
.- Parameters:
buffer (wx.richtext.RichTextBuffer)
node (wx.xml.XmlNode)
handler (wx.richtext.RichTextXMLHandler)
recurse (bool)
- Return type:
bool
- IsEmpty(self)¶
Returns
True
if the object is empty.- Return type:
bool
- Layout(self, 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).
- Parameters:
dc (wx.DC)
context (wx.richtext.RichTextDrawingContext)
rect (wx.Rect)
parentRect (wx.Rect)
style (int)
- Return type:
bool
- Merge(self, object, context)¶
Returns
True
if this object merged itself with the given one.The calling code will then delete the given object.
- Parameters:
object (wx.richtext.RichTextObject)
context (wx.richtext.RichTextDrawingContext)
- Return type:
bool
- SetText(self, text)¶
Sets the text.
- Parameters:
text (string)
- Return type:
None
- Split(self, context)¶
Returns the final object in the split objects if this object was split due to differences between sub-object virtual attributes.
Returns itself if it was not split.
- Parameters:
context (wx.richtext.RichTextDrawingContext)
- Return type:
- UsesParagraphAttributes(self)¶
Does this object take note of paragraph attributes? Text and image objects don’t.
- Return type:
bool
Properties¶
- XMLNodeName¶
See
GetXMLNodeName