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 : RichTextCommand, name : str, id :
RichTextCommandId, buffer : RichTextBuffer, container :
RichTextParagraphLayoutBox, ctrl : RichTextCtrl, ignoreFirstTime:
bool=False) -> None
Implements a part of a command.
__init__
(self, cmd : RichTextCommand, name : str, id : RichTextCommandId, buffer : RichTextBuffer, container : RichTextParagraphLayoutBox, ctrl : RichTextCtrl, ignoreFirstTime: bool=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) –
None
ApplyParagraphs
(self, fragment : RichTextParagraphLayoutBox)¶Replaces the buffer paragraphs with the given fragment.
fragment (wx.richtext.RichTextParagraphLayoutBox) –
None
CalculateRefreshOptimizations
(self, optimizationLineCharPositions : List[int], optimizationLineYPositions : List[int], oldFloatRect : Rect)¶Calculate arrays for refresh optimization.
optimizationLineCharPositions (list of integers) –
optimizationLineYPositions (list of integers) –
oldFloatRect (wx.Rect) –
None
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.
str
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.
int
GetRange
(self)¶Returns the range for e.g.
deletion.
MakeObject
(self, obj : RichTextObject)¶Makes an address from the given object.
obj (wx.richtext.RichTextObject) –
None
SetContainerAddress
(self, *args, **kw)¶Sets the address (nested position) of the container within the buffer being manipulated.
SetContainerAddress (self, address : RichTextObjectAddress)
address (wx.richtext.RichTextObjectAddress) –
None
SetContainerAddress (self, container : RichTextParagraphLayoutBox, obj : RichTextObject)
container (wx.richtext.RichTextParagraphLayoutBox) –
obj (wx.richtext.RichTextObject) –
None
SetIgnoreFirstTime
(self, b : bool)¶Instructs the first Do
command should be skipped as it’s already been applied.
b (bool) –
None
SetObject
(self, obj : RichTextObject)¶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) –
None
SetOldAndNewObjects
(self, oldObj : RichTextObject, newObj : RichTextObject)¶Sets the existing and new objects, for use with wx.richtext.RICHTEXT_CHANGE_OBJECT
.
oldObj (wx.richtext.RichTextObject) –
newObj (wx.richtext.RichTextObject) –
None
SetPosition
(self, pos : int)¶Sets the position used for e.g.
insertion.
pos (long) –
None
SetRange
(self, range : RichTextRange)¶Sets the range for e.g.
deletion.
range (wx.richtext.RichTextRange) –
None
StoreObject
(self, obj : RichTextObject)¶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) –
None
See also
SetObject
, MakeObject
).
Undo
(self)¶Undoes the action.
bool
UpdateAppearance
(self, caretPosition : int, sendUpdateEvent: bool=False, oldFloatRect: Rect=Rect(), optimizationLineCharPositions: Optional[List[int]]=None, optimizationLineYPositions: Optional[List[int]]=None, isDoCmd: bool=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) –
None
Attributes
¶See GetAttributes
Container
¶See GetContainer
ContainerAddress
¶IgnoreFirstTime
¶See GetIgnoreFirstTime
and SetIgnoreFirstTime
NewParagraphs
¶See GetNewParagraphs
OldParagraphs
¶See GetOldParagraphs
Position
¶See GetPosition
and SetPosition