phoenix_title wx.richtext.RichTextCompositeObject

Objects of this class can contain other objects.


class_hierarchy Class Hierarchy

Inheritance diagram for class RichTextCompositeObject:

method_summary Methods Summary

__init__

AppendChild

Appends a child, returning the position.

CalculateRange

Calculates the range of the object.

Copy

Defragment

Recursively merges all pieces that can be merged.

DeleteChildren

Deletes all the children.

DeleteRange

Deletes the given range.

FindPosition

Finds the absolute position and row height for the given character position.

GetChild

Returns the nth child.

GetChildAtPosition

Returns the child object at the given character position.

GetChildCount

Returns the number of children.

GetChildren

Returns the children.

GetRangeSize

Returns the object size for the given range.

GetTextForRange

Returns any text in this object for the given range.

HitTest

Hit-testing: returns a flag indicating hit test details, plus information about position.

InsertChild

Inserts the child in front of the given object, or at the beginning.

Invalidate

Invalidates the object at the given range.

IsAtomic

Returns True if no user editing can be done inside the object.

IsComposite

Returns True if this object is composite.

IsEmpty

Returns True if the buffer is empty.

Move

Moves the object recursively, by adding the offset from old to new.

RemoveChild

Removes and optionally deletes the specified child.


property_summary Properties Summary

ChildCount

See GetChildCount

Children

See GetChildren


api Class API

class wx.richtext.RichTextCompositeObject(RichTextObject)

Possible constructors:

RichTextCompositeObject(parent=None)

Objects of this class can contain other objects.


Methods

__init__(self, parent=None)
Parameters

parent (wx.richtext.RichTextObject) –



AppendChild(self, child)

Appends a child, returning the position.

Parameters

child (wx.richtext.RichTextObject) –

Return type

int



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



Copy(self, obj)
Parameters

obj (wx.richtext.RichTextCompositeObject) –



Defragment(self, context, range=RICHTEXT_ALL)

Recursively merges all pieces that can be merged.

Parameters
Return type

bool



DeleteChildren(self)

Deletes all the children.

Return type

bool



DeleteRange(self, range)

Deletes the given range.

Parameters

range (wx.richtext.RichTextRange) –

Return type

bool



FindPosition(self, dc, context, index, forceLineStart)

Finds the absolute position and row height for the given character position.

Parameters
Return type

tuple

Returns

( bool, pt, height )



GetChild(self, n)

Returns the nth child.

Parameters

n (int) –

Return type

wx.richtext.RichTextObject



GetChildAtPosition(self, pos)

Returns the child object at the given character position.

Parameters

pos (long) –

Return type

wx.richtext.RichTextObject



GetChildCount(self)

Returns the number of children.

Return type

int



GetChildren(self)

Returns the children.

Return type

RichTextObjectList



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



GetTextForRange(self, range)

Returns any text in this object for the given range.

Parameters

range (wx.richtext.RichTextRange) –

Return type

string



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

tuple

Returns

( int, textPosition, obj, contextObj )



InsertChild(self, child, inFrontOf)

Inserts the child in front of the given object, or at the beginning.

Parameters
Return type

bool



Invalidate(self, invalidRange=RICHTEXT_ALL)

Invalidates the object at the given range.

With no argument, invalidates the whole object.

Parameters

invalidRange (wx.richtext.RichTextRange) –



IsAtomic(self)

Returns True if no user editing can be done inside the object.

This returns True for simple objects, False for most composite objects, but True for fields, which if composite, should not be user-edited.

Return type

bool



IsComposite(self)

Returns True if this object is composite.

Return type

bool



IsEmpty(self)

Returns True if the buffer is empty.

Return type

bool



Move(self, pt)

Moves the object recursively, by adding the offset from old to new.

Parameters

pt (wx.Point) –



RemoveChild(self, child, deleteChild=False)

Removes and optionally deletes the specified child.

Parameters
Return type

bool


Properties

ChildCount

See GetChildCount



Children

See GetChildren