Phoenix Logo

phoenix_title wx.richtext.RichTextPlainText

This object represents a single piece of text.


class_hierarchy Class Hierarchy

Inheritance diagram for class RichTextPlainText:


method_summary Methods Summary

__init__ Constructor.
CalculateRange Calculates the range of the object.
CanMerge Returns True if this object can merge itself with the given one.
CanSplit Returns True if this object can potentially be split, by virtue of having different virtual attributes for individual sub-objects.
Clone Clones the object.
Copy  
DeleteRange Deletes the given range.
DoSplit Do a split from pos, returning an object containing the second part, and setting the first part in ‘this’.
Draw Draw the item, within the given range.
GetFirstLineBreakPosition Get the first position from pos that has a line break character.
GetRangeSize Returns the object size for the given range.
GetText Returns the text.
GetTextForRange Returns any text in this object for the given range.
GetXMLNodeName Returns the XML node name of this object.
ImportFromXML Imports this object from XML.
IsEmpty Returns True if the object is empty.
Layout Lay the item out at the specified position with the given size constraint.
Merge Returns True if this object merged itself with the given one.
SetText Sets the text.
Split Returns the final object in the split objects if this object was split due to differences between sub-object virtual attributes.
UsesParagraphAttributes Does this object take note of paragraph attributes? Text and image objects don’t.

property_summary Properties Summary

Text See GetText and SetText
XMLNodeName See GetXMLNodeName

api Class API



class wx.richtext.RichTextPlainText(RichTextObject)

Possible constructors:

RichTextPlainText(text="", parent=None, style=None)

RichTextPlainText(obj)

This object represents a single piece of text.


Methods



__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self, text=””, parent=None, style=None)

Constructor.

Parameters:



__init__ (self, obj)

Copy constructor.

Parameters:obj (wx.richtext.RichTextPlainText) –





CalculateRange(self, start)

Calculates the range of the object.

By default, guess that the object is 1 unit long.

Parameters:start (long) –
Return type:end


CanMerge(self, object, context)

Returns True if this object can merge itself with the given one.

Parameters:
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: wx.richtext.RichTextObject


Copy(self, obj)
Parameters:obj (wx.richtext.RichTextPlainText) –


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: wx.richtext.RichTextObject


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:
Return type:

bool



GetFirstLineBreakPosition(self, pos)

Get the first position from pos that has a line break character.

Parameters:pos (long) –
Return type: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.

Parameters:
Return type:

bool



GetText(self)

Returns the text.

Return type:string


GetTextForRange(self, range)

Returns any text in this object for the given range.

Parameters:range (wx.richtext.RichTextRange) –
Return type:string


GetXMLNodeName(self)

Returns the XML node name of this object.

This must be overridden for XmlNode-base XML export to work.

Return type:string


ImportFromXML(self, buffer, node, handler, recurse)

Imports this object from XML.

Parameters:
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:
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:
Return type:

bool



SetText(self, text)

Sets the text.

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

Parameters:context (wx.richtext.RichTextDrawingContext) –
Return type: wx.richtext.RichTextObject


UsesParagraphAttributes(self)

Does this object take note of paragraph attributes? Text and image objects don’t.

Return type:bool

Properties



Text

See GetText and SetText



XMLNodeName

See GetXMLNodeName