| Version: 3.3.1

Public Member Functions | Protected Attributes | List of all members
wxRichTextAction Class Reference
Class List by Category » Rich Text

`#include <wx/richtext/richtextbuffer.h>`

Inheritance diagram for wxRichTextAction:
[legend]

## Detailed Description

Implements a part of a command.

##

Library: wxRichText
Category: Rich Text

See also
  wxRichTextCommand

## Public Member Functions
| wxRichTextAction (wxRichTextCommand *cmd, const wxString &name, wxRichTextCommandId id, wxRichTextBuffer *buffer, wxRichTextParagraphLayoutBox *container, wxRichTextCtrl *ctrl, bool ignoreFirstTime=false)
| Constructor. More...
virtual | ~wxRichTextAction ()
bool | Do ()
| Performs the action. More...
bool | Undo ()
| Undoes the action. More...
void | UpdateAppearance (long caretPosition, bool sendUpdateEvent=false, const wxRect &oldFloatRect=wxRect(), wxArrayInt *optimizationLineCharPositions=nullptr, wxArrayInt *optimizationLineYPositions=nullptr, bool isDoCmd=true)
| Updates the control appearance, optimizing if possible given information from the call to Layout. More...
void | ApplyParagraphs (const wxRichTextParagraphLayoutBox &fragment)
| Replaces the buffer paragraphs with the given fragment. More...
wxRichTextParagraphLayoutBox & | GetNewParagraphs ()
| Returns the new fragments. More...
wxRichTextParagraphLayoutBox & | GetOldParagraphs ()
| Returns the old fragments. More...
wxRichTextAttr & | GetAttributes ()
| Returns the attributes, for single-object commands. More...
wxRichTextObject * | GetObject () const
| Returns the object to replace the one at the position defined by the container address and the action's range start position. More...
void | StoreObject (wxRichTextObject *obj)
| Stores the object to replace the one at the position defined by the container address without making an address for it. More...
void | SetObject (wxRichTextObject *obj)
| Sets the object to replace the one at the position defined by the container address and the action's range start position. More...
void | MakeObject (wxRichTextObject *obj)
| Makes an address from the given object. More...
void | SetOldAndNewObjects (wxRichTextObject *oldObj, wxRichTextObject *newObj)
| Sets the existing and new objects, for use with wxRICHTEXT_CHANGE_OBJECT. More...
void | CalculateRefreshOptimizations (wxArrayInt &optimizationLineCharPositions, wxArrayInt &optimizationLineYPositions, wxRect &oldFloatRect)
| Calculate arrays for refresh optimization. More...
void | SetPosition (long pos)
| Sets the position used for e.g. More...
long | GetPosition () const
| Returns the position used for e.g. More...
void | SetRange (const wxRichTextRange &range)
| Sets the range for e.g. More...
const wxRichTextRange & | GetRange () const
| Returns the range for e.g. More...
wxRichTextObjectAddress & | GetContainerAddress ()
| Returns the address (nested position) of the container within the buffer being manipulated. More...
const wxRichTextObjectAddress & | GetContainerAddress () const
| Returns the address (nested position) of the container within the buffer being manipulated. More...
void | SetContainerAddress (const wxRichTextObjectAddress &address)
| Sets the address (nested position) of the container within the buffer being manipulated. More...
void | SetContainerAddress (wxRichTextParagraphLayoutBox *container, wxRichTextObject *obj)
| Sets the address (nested position) of the container within the buffer being manipulated. More...
wxRichTextParagraphLayoutBox * | GetContainer () const
| Returns the container that this action refers to, using the container address and top-level buffer. More...
const wxString & | GetName () const
| Returns the action name. More...
void | SetIgnoreFirstTime (bool b)
| Instructs the first Do() command should be skipped as it's already been applied. More...
bool | GetIgnoreFirstTime () const
| Returns true if the first Do() command should be skipped as it's already been applied. More...
Public Member Functions inherited from wxObject
| wxObject ()
| Default ctor; initializes to nullptr the internal reference data. More...
| wxObject (const wxObject &other)
| Copy ctor. More...
virtual | ~wxObject ()
| Destructor. More...
virtual wxClassInfo * | GetClassInfo () const
| This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar). More...
wxObjectRefData * | GetRefData () const
| Returns the wxObject::m_refData pointer, i.e. the data referenced by this object. More...
bool | IsKindOf (const wxClassInfo *info) const
| Determines whether this class is a subclass of (or the same class as) the given class. More...
bool | IsSameAs (const wxObject &obj) const
| Returns true if this object has the same data pointer as obj. More...
void | Ref (const wxObject &clone)
| Makes this object refer to the data in clone. More...
void | SetRefData (wxObjectRefData *data)
| Sets the wxObject::m_refData pointer. More...
void | UnRef ()
| Decrements the reference count in the associated data, and if it is zero, deletes the data. More...
void | UnShare ()
| This is the same of AllocExclusive() but this method is public. More...
void | operator delete (void *buf)
| The delete operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...
void * | operator new (size_t size, const wxString &filename=nullptr, int lineNum=0)
| The new operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...

## Protected Attributes
wxString | m_name
wxRichTextBuffer * | m_buffer
wxRichTextObjectAddress | m_containerAddress
wxRichTextCtrl * | m_ctrl
wxRichTextParagraphLayoutBox | m_newParagraphs
wxRichTextParagraphLayoutBox | m_oldParagraphs
wxRichTextObject * | m_object
wxRichTextAttr | m_attributes
wxRichTextObjectAddress | m_objectAddress
wxRichTextRange | m_range
long | m_position
bool | m_ignoreThis
wxRichTextCommandId | m_cmdId
Protected Attributes inherited from wxObject
wxObjectRefData * | m_refData
| Pointer to an object which is the object's reference-counted data. More...

## Additional Inherited Members
Protected Member Functions inherited from wxObject
void | AllocExclusive ()
| Ensure that this object's data is not shared with any other object. More...
virtual wxObjectRefData * | CreateRefData () const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it. More...
virtual wxObjectRefData * | CloneRefData (const wxObjectRefData *data) const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying data. More...

## Constructor & Destructor Documentation

## ◆ wxRichTextAction()

wxRichTextAction::wxRichTextAction | ( | wxRichTextCommand * | cmd,
|  | const wxString & | name,
|  | wxRichTextCommandId | id,
|  | wxRichTextBuffer * | buffer,
|  | wxRichTextParagraphLayoutBox * | container,
|  | wxRichTextCtrl * | ctrl,
|  | bool | 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.

## ◆ ~wxRichTextAction()

virtual wxRichTextAction::~wxRichTextAction | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ ApplyParagraphs()

void wxRichTextAction::ApplyParagraphs | ( | const wxRichTextParagraphLayoutBox & | fragment | ) |

Replaces the buffer paragraphs with the given fragment.

## ◆ CalculateRefreshOptimizations()

void wxRichTextAction::CalculateRefreshOptimizations | ( | wxArrayInt & | optimizationLineCharPositions,
|  | wxArrayInt & | optimizationLineYPositions,
|  | wxRect & | oldFloatRect
| ) |  |

Calculate arrays for refresh optimization.

## ◆ Do()

bool wxRichTextAction::Do | ( |  | ) |

Performs the action.

## ◆ GetAttributes()

wxRichTextAttr& wxRichTextAction::GetAttributes | ( |  | ) |
| inline

Returns the attributes, for single-object commands.

## ◆ GetContainer()

wxRichTextParagraphLayoutBox* wxRichTextAction::GetContainer | ( |  | ) | const

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

## ◆ GetContainerAddress() [1/2]

wxRichTextObjectAddress& wxRichTextAction::GetContainerAddress | ( |  | ) |
| inline

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

## ◆ GetContainerAddress() [2/2]

const wxRichTextObjectAddress& wxRichTextAction::GetContainerAddress | ( |  | ) | const
| inline

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

## ◆ GetIgnoreFirstTime()

bool wxRichTextAction::GetIgnoreFirstTime | ( |  | ) | const

Returns true if the first Do() command should be skipped as it's already been applied.

## ◆ GetName()

const wxString& wxRichTextAction::GetName | ( |  | ) | const
| inline

Returns the action name.

## ◆ GetNewParagraphs()

wxRichTextParagraphLayoutBox& wxRichTextAction::GetNewParagraphs | ( |  | ) |
| inline

Returns the new fragments.

## ◆ GetObject()

wxRichTextObject* wxRichTextAction::GetObject | ( |  | ) | const
| inline

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

## ◆ GetOldParagraphs()

wxRichTextParagraphLayoutBox& wxRichTextAction::GetOldParagraphs | ( |  | ) |
| inline

Returns the old fragments.

## ◆ GetPosition()

long wxRichTextAction::GetPosition | ( |  | ) | const
| inline

Returns the position used for e.g.

insertion.

## ◆ GetRange()

const wxRichTextRange& wxRichTextAction::GetRange | ( |  | ) | const
| inline

Returns the range for e.g.

deletion.

## ◆ MakeObject()

void wxRichTextAction::MakeObject | ( | wxRichTextObject * | obj | ) |
| inline

Makes an address from the given object.

## ◆ SetContainerAddress() [1/2]

void wxRichTextAction::SetContainerAddress | ( | const wxRichTextObjectAddress & | address | ) |
| inline

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

## ◆ SetContainerAddress() [2/2]

void wxRichTextAction::SetContainerAddress | ( | wxRichTextParagraphLayoutBox * | container,
|  | wxRichTextObject * | obj
| ) |  |
| inline

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

## ◆ SetIgnoreFirstTime()

void wxRichTextAction::SetIgnoreFirstTime | ( | bool | b | ) |

Instructs the first Do() command should be skipped as it's already been applied.

## ◆ SetObject()

void wxRichTextAction::SetObject | ( | wxRichTextObject * | obj | ) |
| inline

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

## ◆ SetOldAndNewObjects()

void wxRichTextAction::SetOldAndNewObjects | ( | wxRichTextObject * | oldObj,
|  | wxRichTextObject * | newObj
| ) |  |

Sets the existing and new objects, for use with wxRICHTEXT_CHANGE_OBJECT.

## ◆ SetPosition()

void wxRichTextAction::SetPosition | ( | long | pos | ) |
| inline

Sets the position used for e.g.

insertion.

## ◆ SetRange()

void wxRichTextAction::SetRange | ( | const wxRichTextRange & | range | ) |
| inline

Sets the range for e.g.

deletion.

## ◆ StoreObject()

void wxRichTextAction::StoreObject | ( | wxRichTextObject * | obj | ) |
| inline

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

See also
  SetObject(), MakeObject()).

## ◆ Undo()

bool wxRichTextAction::Undo | ( |  | ) |

Undoes the action.

## ◆ UpdateAppearance()

void wxRichTextAction::UpdateAppearance | ( | long | caretPosition,
|  | bool | sendUpdateEvent = `false`,
|  | const wxRect & | oldFloatRect = `wxRect()`,
|  | wxArrayInt * | optimizationLineCharPositions = `nullptr`,
|  | wxArrayInt * | optimizationLineYPositions = `nullptr`,
|  | bool | isDoCmd = `true`
| ) |  |

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

## Member Data Documentation

## ◆ m_attributes

wxRichTextAttr wxRichTextAction::m_attributes
| protected

## ◆ m_buffer

wxRichTextBuffer* wxRichTextAction::m_buffer
| protected

## ◆ m_cmdId

wxRichTextCommandId wxRichTextAction::m_cmdId
| protected

## ◆ m_containerAddress

wxRichTextObjectAddress wxRichTextAction::m_containerAddress
| protected

## ◆ m_ctrl

wxRichTextCtrl* wxRichTextAction::m_ctrl
| protected

## ◆ m_ignoreThis

bool wxRichTextAction::m_ignoreThis
| protected

## ◆ m_name

wxString wxRichTextAction::m_name
| protected

## ◆ m_newParagraphs

wxRichTextParagraphLayoutBox wxRichTextAction::m_newParagraphs
| protected

## ◆ m_object

wxRichTextObject* wxRichTextAction::m_object
| protected

## ◆ m_objectAddress

wxRichTextObjectAddress wxRichTextAction::m_objectAddress
| protected

## ◆ m_oldParagraphs

wxRichTextParagraphLayoutBox wxRichTextAction::m_oldParagraphs
| protected

## ◆ m_position

long wxRichTextAction::m_position
| protected

## ◆ m_range

wxRichTextRange wxRichTextAction::m_range
| protected