wx.richtext.RichTextAction¶
Implements a part of a command.
See also
Class Hierarchy¶
Methods Summary¶
Constructor. |
|
Replaces the buffer paragraphs with the given fragment. |
|
Calculate arrays for refresh optimization. |
|
Performs the action. |
|
Returns the attributes, for single-object commands. |
|
Returns the container that this action refers to, using the container address and top-level buffer. |
|
Returns the address (nested position) of the container within the buffer being manipulated. |
|
Returns |
|
Returns the action name. |
|
Returns the new fragments. |
|
Returns the object to replace the one at the position defined by the container address and the action’s range start position. |
|
Returns the old fragments. |
|
Returns the position used for e.g. |
|
Returns the range for e.g. |
|
Makes an address from the given object. |
|
Sets the address (nested position) of the container within the buffer being manipulated. |
|
Instructs the first |
|
Sets the object to replace the one at the position defined by the container address and the action’s range start position. |
|
Sets the existing and new objects, for use with |
|
Sets the position used for e.g. |
|
Sets the range for e.g. |
|
Stores the object to replace the one at the position defined by the container address without making an address for it. |
|
Undoes the action. |
|
Updates the control appearance, optimizing if possible given information from the call to Layout. |
Properties Summary¶
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
Class API¶
- class wx.richtext.RichTextAction(Object)¶
Possible constructors:
RichTextAction(cmd, name, id, buffer, container, ctrl, ignoreFirstTime=False) -> None
Implements a part of a command.
Methods¶
- __init__(self, cmd, name, id, buffer, container, ctrl, ignoreFirstTime=False)¶
Constructor.
buffer is the top-level buffer, while container is the object within which the action is taking place. In the simplest case, they are the same.
- Parameters:
name (string)
id (RichTextCommandId)
buffer (wx.richtext.RichTextBuffer)
container (wx.richtext.RichTextParagraphLayoutBox)
ctrl (wx.richtext.RichTextCtrl)
ignoreFirstTime (bool)
- Return type:
None
- ApplyParagraphs(self, fragment)¶
Replaces the buffer paragraphs with the given fragment.
- Parameters:
fragment (wx.richtext.RichTextParagraphLayoutBox)
- Return type:
None
- CalculateRefreshOptimizations(self, optimizationLineCharPositions, optimizationLineYPositions, oldFloatRect)¶
Calculate arrays for refresh optimization.
- Parameters:
optimizationLineCharPositions (list of integers)
optimizationLineYPositions (list of integers)
oldFloatRect (wx.Rect)
- Return type:
None
- Do(self)¶
Performs the action.
- Return type:
bool
- GetAttributes(self)¶
Returns the attributes, for single-object commands.
- Return type:
- GetContainer(self)¶
Returns the container that this action refers to, using the container address and top-level buffer.
- Return type:
- GetContainerAddress(self)¶
Returns the address (nested position) of the container within the buffer being manipulated.
- Return type:
- GetIgnoreFirstTime(self)¶
Returns
True
if the firstDo
command should be skipped as it’s already been applied.- Return type:
bool
- GetName(self)¶
Returns the action name.
- Return type:
str
- GetNewParagraphs(self)¶
Returns the new fragments.
- Return type:
- GetObject(self)¶
Returns the object to replace the one at the position defined by the container address and the action’s range start position.
- Return type:
- GetOldParagraphs(self)¶
Returns the old fragments.
- Return type:
- GetPosition(self)¶
Returns the position used for e.g.
insertion.
- Return type:
int
- GetRange(self)¶
Returns the range for e.g.
deletion.
- Return type:
- MakeObject(self, obj)¶
Makes an address from the given object.
- Parameters:
- Return type:
None
- SetContainerAddress(self, *args, **kw)¶
Sets the address (nested position) of the container within the buffer being manipulated.
SetContainerAddress (self, address)
- Parameters:
address (wx.richtext.RichTextObjectAddress)
- Return type:
None
SetContainerAddress (self, container, obj)
- Parameters:
container (wx.richtext.RichTextParagraphLayoutBox)
- Return type:
None
- SetIgnoreFirstTime(self, b)¶
Instructs the first
Do
command should be skipped as it’s already been applied.- Parameters:
b (bool)
- Return type:
None
- SetObject(self, obj)¶
Sets the object to replace the one at the position defined by the container address and the action’s range start position.
- Parameters:
- Return type:
None
- SetOldAndNewObjects(self, oldObj, newObj)¶
Sets the existing and new objects, for use with
wx.richtext.RICHTEXT_CHANGE_OBJECT
.- Parameters:
oldObj (wx.richtext.RichTextObject)
newObj (wx.richtext.RichTextObject)
- Return type:
None
- SetPosition(self, pos)¶
Sets the position used for e.g.
insertion.
- Parameters:
pos (long)
- Return type:
None
- SetRange(self, range)¶
Sets the range for e.g.
deletion.
- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
None
- StoreObject(self, obj)¶
Stores the object to replace the one at the position defined by the container address without making an address for it.
- Parameters:
- Return type:
None
See also
SetObject
,MakeObject
).
- Undo(self)¶
Undoes the action.
- Return type:
bool
- UpdateAppearance(self, caretPosition, sendUpdateEvent=False, oldFloatRect=Rect(), optimizationLineCharPositions=None, optimizationLineYPositions=None, isDoCmd=True)¶
Updates the control appearance, optimizing if possible given information from the call to Layout.
- Parameters:
caretPosition (long)
sendUpdateEvent (bool)
oldFloatRect (wx.Rect)
optimizationLineCharPositions (list of integers)
optimizationLineYPositions (list of integers)
isDoCmd (bool)
- Return type:
None
Properties¶
- Attributes¶
See
GetAttributes
- Container¶
See
GetContainer
- ContainerAddress¶
- IgnoreFirstTime¶
See
GetIgnoreFirstTime
andSetIgnoreFirstTime
- NewParagraphs¶
See
GetNewParagraphs
- OldParagraphs¶
See
GetOldParagraphs
- Position¶
See
GetPosition
andSetPosition