Objects of this class can contain other objects.
See also
wx.richtext.RichTextObject, wx.richtext.RichTextBuffer, wx.richtext.RichTextCtrl
wx.richtext.RichTextParagraph, wx.richtext.RichTextParagraphLayoutBox
Appends a child, returning the position. |
|
Calculates the range of the object. |
|
Recursively merges all pieces that can be merged. |
|
Deletes all the children. |
|
Deletes the given range. |
|
Finds the absolute position and row height for the given character position. |
|
Returns the nth child. |
|
Returns the child object at the given character position. |
|
Returns the number of children. |
|
Returns the children. |
|
Returns the object size for the given range. |
|
Returns any text in this object for the given range. |
|
Hit-testing: returns a flag indicating hit test details, plus information about position. |
|
Inserts the child in front of the given object, or at the beginning. |
|
Invalidates the object at the given range. |
|
Returns |
|
Returns |
|
Returns |
|
Moves the object recursively, by adding the offset from old to new. |
|
Removes and optionally deletes the specified child. |
See |
|
See |
wx.richtext.
RichTextCompositeObject
(RichTextObject)¶Possible constructors:
RichTextCompositeObject(parent=None)
Objects of this class can contain other objects.
__init__
(self, parent=None)¶parent (wx.richtext.RichTextObject) –
AppendChild
(self, child)¶Appends a child, returning the position.
child (wx.richtext.RichTextObject) –
int
CalculateRange
(self, start)¶Calculates the range of the object.
By default, guess that the object is 1 unit long.
start (long) –
end
Copy
(self, obj)¶Defragment
(self, context, range=RICHTEXT_ALL)¶Recursively merges all pieces that can be merged.
context (wx.richtext.RichTextDrawingContext) –
range (wx.richtext.RichTextRange) –
bool
DeleteChildren
(self)¶Deletes all the children.
bool
DeleteRange
(self, range)¶Deletes the given range.
range (wx.richtext.RichTextRange) –
bool
FindPosition
(self, dc, context, index, forceLineStart)¶Finds the absolute position and row height for the given character position.
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
index (long) –
forceLineStart (bool) –
tuple
( bool, pt, height )
GetChild
(self, n)¶Returns the nth child.
n (int) –
GetChildAtPosition
(self, pos)¶Returns the child object at the given character position.
pos (long) –
GetChildCount
(self)¶Returns the number of children.
int
GetChildren
(self)¶Returns the children.
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.
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
GetTextForRange
(self, range)¶Returns any text in this object for the given range.
range (wx.richtext.RichTextRange) –
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).
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
pt (wx.Point) –
flags (int) –
tuple
( int, textPosition, obj, contextObj )
InsertChild
(self, child, inFrontOf)¶Inserts the child in front of the given object, or at the beginning.
child (wx.richtext.RichTextObject) –
inFrontOf (wx.richtext.RichTextObject) –
bool
Invalidate
(self, invalidRange=RICHTEXT_ALL)¶Invalidates the object at the given range.
With no argument, invalidates the whole object.
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.
bool
IsComposite
(self)¶Returns True
if this object is composite.
bool
IsEmpty
(self)¶Returns True
if the buffer is empty.
bool
Move
(self, pt)¶Moves the object recursively, by adding the offset from old to new.
pt (wx.Point) –
RemoveChild
(self, child, deleteChild=False)¶Removes and optionally deletes the specified child.
child (wx.richtext.RichTextObject) –
deleteChild (bool) –
bool
ChildCount
¶See GetChildCount
Children
¶See GetChildren