# wxRichTextAction Class Reference
[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.
virtual | ~wxRichTextAction ()
bool | Do ()
| Performs the action.
bool | Undo ()
| Undoes the action.
void | UpdateAppearance (long caretPosition, bool sendUpdateEvent=false, wxArrayInt *optimizationLineCharPositions=NULL, wxArrayInt *optimizationLineYPositions=NULL, bool isDoCmd=true)
| Updates the control appearance, optimizing if possible given information from the call to Layout.
void | ApplyParagraphs (const wxRichTextParagraphLayoutBox &fragment)
| Replaces the buffer paragraphs with the given fragment.
wxRichTextParagraphLayoutBox & | GetNewParagraphs ()
| Returns the new fragments.
wxRichTextParagraphLayoutBox & | GetOldParagraphs ()
| Returns the old fragments.
wxRichTextAttr & | GetAttributes ()
| Returns the attributes, for single-object commands.
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.
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.
void | MakeObject (wxRichTextObject *obj)
| Makes an address from the given object.
void | CalculateRefreshOptimizations (wxArrayInt &optimizationLineCharPositions, wxArrayInt &optimizationLineYPositions)
| Calculate arrays for refresh optimization.
void | SetPosition (long pos)
| Sets the position used for e.g.
long | GetPosition () const
| Returns the position used for e.g.
void | SetRange (const wxRichTextRange &range)
| Sets the range for e.g.
const wxRichTextRange & | GetRange () const
| Returns the range for e.g.
wxRichTextObjectAddress & | GetContainerAddress ()
| Returns the address (nested position) of the container within the buffer being manipulated.
const wxRichTextObjectAddress & | GetContainerAddress () const
| Returns the address (nested position) of the container within the buffer being manipulated.
void | SetContainerAddress (const wxRichTextObjectAddress &address)
| Sets the address (nested position) of the container within the buffer being manipulated.
void | SetContainerAddress (wxRichTextParagraphLayoutBox *container, wxRichTextObject *obj)
| Sets the address (nested position) of the container within the buffer being manipulated.
wxRichTextParagraphLayoutBox * | GetContainer () const
| Returns the container that this action refers to, using the container address and top-level buffer.
const wxString & | GetName () const
| Returns the action name.
## 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

List of all members.

## Constructor & Destructor Documentation

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.

virtual wxRichTextAction::~wxRichTextAction | ( |  | ) | `[virtual]`

## Member Function Documentation

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

Replaces the buffer paragraphs with the given fragment.

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

Calculate arrays for refresh optimization.

bool wxRichTextAction::Do | ( |  | ) |

Performs the action.

wxRichTextAttr& wxRichTextAction::GetAttributes | ( |  | ) | `[inline]`

Returns the attributes, for single-object commands.

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

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

const wxRichTextObjectAddress& wxRichTextAction::GetContainerAddress | ( |  | ) | const`[inline]`

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

wxRichTextObjectAddress& wxRichTextAction::GetContainerAddress | ( |  | ) | `[inline]`

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

const wxString& wxRichTextAction::GetName | ( |  | ) | const`[inline]`

Returns the action name.

wxRichTextParagraphLayoutBox& wxRichTextAction::GetNewParagraphs | ( |  | ) | `[inline]`

Returns the new fragments.

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.

wxRichTextParagraphLayoutBox& wxRichTextAction::GetOldParagraphs | ( |  | ) | `[inline]`

Returns the old fragments.

long wxRichTextAction::GetPosition | ( |  | ) | const`[inline]`

Returns the position used for e.g.

insertion.

const wxRichTextRange& wxRichTextAction::GetRange | ( |  | ) | const`[inline]`

Returns the range for e.g.

deletion.

void wxRichTextAction::MakeObject | ( | wxRichTextObject * | obj | ) | `[inline]`

Makes an address from the given object.

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

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

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

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

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.

void wxRichTextAction::SetPosition | ( | long | pos | ) | `[inline]`

Sets the position used for e.g.

insertion.

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

Sets the range for e.g.

deletion.

bool wxRichTextAction::Undo | ( |  | ) |

Undoes the action.

void wxRichTextAction::UpdateAppearance | ( | long | caretPosition,
|  | bool | sendUpdateEvent = `false`,
|  | wxArrayInt * | optimizationLineCharPositions = `NULL`,
|  | wxArrayInt * | optimizationLineYPositions = `NULL`,
|  | bool | isDoCmd = `true` |
| ) |  |  |

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

## Member Data Documentation

wxRichTextAttr wxRichTextAction::m_attributes`[protected]`

wxRichTextBuffer* wxRichTextAction::m_buffer`[protected]`

wxRichTextCommandId wxRichTextAction::m_cmdId`[protected]`

wxRichTextObjectAddress wxRichTextAction::m_containerAddress`[protected]`

wxRichTextCtrl* wxRichTextAction::m_ctrl`[protected]`

bool wxRichTextAction::m_ignoreThis`[protected]`

wxString wxRichTextAction::m_name`[protected]`

wxRichTextParagraphLayoutBox wxRichTextAction::m_newParagraphs`[protected]`

wxRichTextObject* wxRichTextAction::m_object`[protected]`

wxRichTextObjectAddress wxRichTextAction::m_objectAddress`[protected]`

wxRichTextParagraphLayoutBox wxRichTextAction::m_oldParagraphs`[protected]`

long wxRichTextAction::m_position`[protected]`

wxRichTextRange wxRichTextAction::m_range`[protected]`

|  | [ top ]