This object represents a single piece of text.
See also
wx.richtext.RichTextBuffer, wx.richtext.RichTextCtrl
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. |
See |
wx.richtext.
RichTextPlainText
(RichTextObject)¶Possible constructors:
RichTextPlainText(text="", parent=None, style=None)
RichTextPlainText(obj)
This object represents a single piece of text.
__init__
(self, *args, **kw)¶__init__ (self, text=””, parent=None, style=None)
Constructor.
text (string) –
parent (wx.richtext.RichTextObject) –
style (wx.richtext.RichTextAttr) –
__init__ (self, obj)
Copy constructor.
obj (wx.richtext.RichTextPlainText) –
CalculateRange
(self, start)¶Calculates the range of the object.
By default, guess that the object is 1 unit long.
start (long) –
end
CanMerge
(self, object, context)¶Returns True
if this object can merge itself with the given one.
object (wx.richtext.RichTextObject) –
context (wx.richtext.RichTextDrawingContext) –
bool
CanSplit
(self, context)¶Returns True
if this object can potentially be split, by virtue of having different virtual attributes for individual sub-objects.
context (wx.richtext.RichTextDrawingContext) –
bool
Clone
(self)¶Clones the object.
Copy
(self, obj)¶obj (wx.richtext.RichTextPlainText) –
DeleteRange
(self, range)¶Deletes the given range.
range (wx.richtext.RichTextRange) –
bool
DoSplit
(self, pos)¶Do a split from pos, returning an object containing the second part, and setting the first part in ‘this’.
pos (long) –
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)
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
range (wx.richtext.RichTextRange) –
selection (wx.richtext.RichTextSelection) –
rect (wx.Rect) –
descent (int) –
style (int) –
bool
GetFirstLineBreakPosition
(self, pos)¶Get the first position from pos that has a line break character.
pos (long) –
long
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.
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) –
bool
GetText
(self)¶Returns the text.
string
GetTextForRange
(self, range)¶Returns any text in this object for the given range.
range (wx.richtext.RichTextRange) –
string
GetXMLNodeName
(self)¶Returns the XML
node name of this object.
This must be overridden for XmlNode-base XML
export to work.
string
ImportFromXML
(self, buffer, node, handler, recurse)¶Imports this object from XML
.
buffer (wx.richtext.RichTextBuffer) –
node (wx.xml.XmlNode) –
handler (wx.richtext.RichTextXMLHandler) –
recurse (bool) –
bool
IsEmpty
(self)¶Returns True
if the object is empty.
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).
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
rect (wx.Rect) –
parentRect (wx.Rect) –
style (int) –
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.
object (wx.richtext.RichTextObject) –
context (wx.richtext.RichTextDrawingContext) –
bool
SetText
(self, text)¶Sets the text.
text (string) –
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.
context (wx.richtext.RichTextDrawingContext) –
UsesParagraphAttributes
(self)¶Does this object take note of paragraph attributes? Text and image objects don’t.
bool
XMLNodeName
¶See GetXMLNodeName