phoenix_title wx.richtext.RichTextAction

Implements a part of a command.

See also

wx.richtext.RichTextCommand


class_hierarchy Class Hierarchy

Inheritance diagram for class RichTextAction:

method_summary Methods Summary

__init__

Constructor.

ApplyParagraphs

Replaces the buffer paragraphs with the given fragment.

CalculateRefreshOptimizations

Calculate arrays for refresh optimization.

Do

Performs the action.

GetAttributes

Returns the attributes, for single-object commands.

GetContainer

Returns the container that this action refers to, using the container address and top-level buffer.

GetContainerAddress

Returns the address (nested position) of the container within the buffer being manipulated.

GetIgnoreFirstTime

Returns True if the first Do command should be skipped as it’s already been applied.

GetName

Returns the action name.

GetNewParagraphs

Returns the new fragments.

GetObject

Returns the object to replace the one at the position defined by the container address and the action’s range start position.

GetOldParagraphs

Returns the old fragments.

GetPosition

Returns the position used for e.g.

GetRange

Returns the range for e.g.

MakeObject

Makes an address from the given object.

SetContainerAddress

Sets the address (nested position) of the container within the buffer being manipulated.

SetIgnoreFirstTime

Instructs the first Do command should be skipped as it’s already been applied.

SetObject

Sets the object to replace the one at the position defined by the container address and the action’s range start position.

SetOldAndNewObjects

Sets the existing and new objects, for use with wx.richtext.RICHTEXT_CHANGE_OBJECT.

SetPosition

Sets the position used for e.g.

SetRange

Sets the range for e.g.

StoreObject

Stores the object to replace the one at the position defined by the container address without making an address for it.

Undo

Undoes the action.

UpdateAppearance

Updates the control appearance, optimizing if possible given information from the call to Layout.


property_summary Properties Summary

Attributes

See GetAttributes

Container

See GetContainer

ContainerAddress

See GetContainerAddress and SetContainerAddress

IgnoreFirstTime

See GetIgnoreFirstTime and SetIgnoreFirstTime

Name

See GetName

NewParagraphs

See GetNewParagraphs

Object

See GetObject and SetObject

OldParagraphs

See GetOldParagraphs

Position

See GetPosition and SetPosition

Range

See GetRange and SetRange


api Class API

class wx.richtext.RichTextAction(Object)

Possible constructors:

RichTextAction(cmd, name, id, buffer, container, ctrl,
               ignoreFirstTime=False)

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:


ApplyParagraphs(self, fragment)

Replaces the buffer paragraphs with the given fragment.

Parameters:

fragment (wx.richtext.RichTextParagraphLayoutBox) –



CalculateRefreshOptimizations(self, optimizationLineCharPositions, optimizationLineYPositions, oldFloatRect)

Calculate arrays for refresh optimization.

Parameters:
  • optimizationLineCharPositions (list of integers) –

  • optimizationLineYPositions (list of integers) –

  • oldFloatRect (wx.Rect) –



Do(self)

Performs the action.

Return type:

bool



GetAttributes(self)

Returns the attributes, for single-object commands.

Return type:

wx.richtext.RichTextAttr



GetContainer(self)

Returns the container that this action refers to, using the container address and top-level buffer.

Return type:

wx.richtext.RichTextParagraphLayoutBox



GetContainerAddress(self)

Returns the address (nested position) of the container within the buffer being manipulated.

Return type:

wx.richtext.RichTextObjectAddress



GetIgnoreFirstTime(self)

Returns True if the first Do command should be skipped as it’s already been applied.

Return type:

bool



GetName(self)

Returns the action name.

Return type:

string



GetNewParagraphs(self)

Returns the new fragments.

Return type:

wx.richtext.RichTextParagraphLayoutBox



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:

wx.richtext.RichTextObject



GetOldParagraphs(self)

Returns the old fragments.

Return type:

wx.richtext.RichTextParagraphLayoutBox



GetPosition(self)

Returns the position used for e.g.

insertion.

Return type:

long



GetRange(self)

Returns the range for e.g.

deletion.

Return type:

wx.richtext.RichTextRange



MakeObject(self, obj)

Makes an address from the given object.

Parameters:

obj (wx.richtext.RichTextObject) –



SetContainerAddress(self, *args, **kw)

Sets the address (nested position) of the container within the buffer being manipulated.

overload Overloaded Implementations:



SetContainerAddress (self, address)

Parameters:

address (wx.richtext.RichTextObjectAddress) –



SetContainerAddress (self, container, obj)

Parameters:





SetIgnoreFirstTime(self, b)

Instructs the first Do command should be skipped as it’s already been applied.

Parameters:

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.

Parameters:

obj (wx.richtext.RichTextObject) –



SetOldAndNewObjects(self, oldObj, newObj)

Sets the existing and new objects, for use with wx.richtext.RICHTEXT_CHANGE_OBJECT.

Parameters:


SetPosition(self, pos)

Sets the position used for e.g.

insertion.

Parameters:

pos (long) –



SetRange(self, range)

Sets the range for e.g.

deletion.

Parameters:

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.

Parameters:

obj (wx.richtext.RichTextObject) –

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) –


Properties

Attributes

See GetAttributes



Container

See GetContainer



ContainerAddress

See GetContainerAddress and SetContainerAddress



IgnoreFirstTime

See GetIgnoreFirstTime and SetIgnoreFirstTime



Name

See GetName



NewParagraphs

See GetNewParagraphs



Object

See GetObject and SetObject



OldParagraphs

See GetOldParagraphs



Position

See GetPosition and SetPosition



Range

See GetRange and SetRange