Implements a part of a command.
See also
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. |
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
wx.richtext.
RichTextAction
(Object)¶Possible constructors:
RichTextAction(cmd, name, id, buffer, container, ctrl,
ignoreFirstTime=False)
Implements a part of a command.
__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.
cmd (wx.richtext.RichTextCommand) –
name (string) –
id (RichTextCommandId) –
buffer (wx.richtext.RichTextBuffer) –
container (wx.richtext.RichTextParagraphLayoutBox) –
ctrl (wx.richtext.RichTextCtrl) –
ignoreFirstTime (bool) –
ApplyParagraphs
(self, fragment)¶Replaces the buffer paragraphs with the given fragment.
fragment (wx.richtext.RichTextParagraphLayoutBox) –
CalculateRefreshOptimizations
(self, optimizationLineCharPositions, optimizationLineYPositions, oldFloatRect)¶Calculate arrays for refresh optimization.
optimizationLineCharPositions (list of integers) –
optimizationLineYPositions (list of integers) –
oldFloatRect (wx.Rect) –
Do
(self)¶Performs the action.
bool
GetAttributes
(self)¶Returns the attributes, for single-object commands.
GetContainer
(self)¶Returns the container that this action refers to, using the container address and top-level buffer.
GetContainerAddress
(self)¶Returns the address (nested position) of the container within the buffer being manipulated.
GetIgnoreFirstTime
(self)¶Returns True
if the first Do
command should be skipped as it’s already been applied.
bool
GetName
(self)¶Returns the action name.
string
GetNewParagraphs
(self)¶Returns the new fragments.
GetObject
(self)¶Returns the object to replace the one at the position defined by the container address and the action’s range start position.
GetOldParagraphs
(self)¶Returns the old fragments.
GetPosition
(self)¶Returns the position used for e.g.
insertion.
long
GetRange
(self)¶Returns the range for e.g.
deletion.
MakeObject
(self, obj)¶Makes an address from the given object.
obj (wx.richtext.RichTextObject) –
SetContainerAddress
(self, *args, **kw)¶Sets the address (nested position) of the container within the buffer being manipulated.
SetContainerAddress (self, address)
address (wx.richtext.RichTextObjectAddress) –
SetContainerAddress (self, container, obj)
container (wx.richtext.RichTextParagraphLayoutBox) –
obj (wx.richtext.RichTextObject) –
SetIgnoreFirstTime
(self, b)¶Instructs the first Do
command should be skipped as it’s already been applied.
b (bool) –
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.
obj (wx.richtext.RichTextObject) –
SetOldAndNewObjects
(self, oldObj, newObj)¶Sets the existing and new objects, for use with wx.richtext.RICHTEXT_CHANGE_OBJECT
.
oldObj (wx.richtext.RichTextObject) –
newObj (wx.richtext.RichTextObject) –
SetPosition
(self, pos)¶Sets the position used for e.g.
insertion.
pos (long) –
SetRange
(self, range)¶Sets the range for e.g.
deletion.
range (wx.richtext.RichTextRange) –
StoreObject
(self, obj)¶Stores the object to replace the one at the position defined by the container address without making an address for it.
obj (wx.richtext.RichTextObject) –
See also
SetObject
, MakeObject
).
Undo
(self)¶Undoes the action.
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.
caretPosition (long) –
sendUpdateEvent (bool) –
oldFloatRect (wx.Rect) –
optimizationLineCharPositions (list of integers) –
optimizationLineYPositions (list of integers) –
isDoCmd (bool) –
Attributes
¶See GetAttributes
Container
¶See GetContainer
ContainerAddress
¶IgnoreFirstTime
¶See GetIgnoreFirstTime
and SetIgnoreFirstTime
NewParagraphs
¶See GetNewParagraphs
OldParagraphs
¶See GetOldParagraphs
Position
¶See GetPosition
and SetPosition