wx.richtext.RichTextCompositeObject¶
Objects of this class can contain other objects.
Class Hierarchy¶
Known Subclasses¶
wx.richtext.RichTextParagraph, wx.richtext.RichTextParagraphLayoutBox
Methods Summary¶
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. |
Properties Summary¶
See |
|
See |
Class API¶
- class wx.richtext.RichTextCompositeObject(RichTextObject)¶
Possible constructors:
RichTextCompositeObject(parent=None) -> None
Objects of this class can contain other objects.
Methods¶
- __init__(self, parent=None)¶
- Parameters:
parent (wx.richtext.RichTextObject)
- Return type:
None
- 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:
int
- Copy(self, obj)¶
- Parameters:
- Return type:
None
- Defragment(self, context, range=RICHTEXT_ALL)¶
Recursively merges all pieces that can be merged.
- Parameters:
context (wx.richtext.RichTextDrawingContext)
range (wx.richtext.RichTextRange)
- 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:
dc (wx.DC)
context (wx.richtext.RichTextDrawingContext)
index (long)
forceLineStart (bool)
- Return type:
le[bool, wx.Point, int]
- GetChild(self, n)¶
Returns the nth child.
- Parameters:
n (int)
- Return type:
- GetChildAtPosition(self, pos)¶
Returns the child object at the given character position.
- Parameters:
pos (long)
- Return type:
- 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
Falseif 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
- GetTextForRange(self, range)¶
Returns any text in this object for the given range.
- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
str
- 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:
dc (wx.DC)
context (wx.richtext.RichTextDrawingContext)
pt (wx.Point)
flags (int)
- Return type:
Tuple[int, int, RichTextObject, RichTextObject]
- Returns:
One of the wx.richtext.RichTextHitTestFlags values.
- InsertChild(self, child, inFrontOf)¶
Inserts the child in front of the given object, or at the beginning.
- Parameters:
child (wx.richtext.RichTextObject)
inFrontOf (wx.richtext.RichTextObject)
- 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)
- Return type:
None
- IsAtomic(self)¶
Returns
Trueif no user editing can be done inside the object.This returns
Truefor simple objects,Falsefor most composite objects, butTruefor fields, which if composite, should not be user-edited.- Return type:
bool
- IsComposite(self)¶
Returns
Trueif this object is composite.- Return type:
bool
- IsEmpty(self)¶
Returns
Trueif 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)
- Return type:
None
- RemoveChild(self, child, deleteChild=False)¶
Removes and optionally deletes the specified child.
- Parameters:
child (wx.richtext.RichTextObject)
deleteChild (bool)
- Return type:
bool
Properties¶
- ChildCount¶
See
GetChildCount
- Children¶
See
GetChildren