Version: 2.9.4
Public Member Functions | Protected Attributes
wxRichTextAction Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/richtext/richtextbuffer.h>

Inheritance diagram for wxRichTextAction:

Detailed Description

Implements a part of a command.

Library:  wxRichText
Category:  Rich Text
参照:
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.
wxRichTextParagraphLayoutBoxGetNewParagraphs ()
 Returns the new fragments.
wxRichTextParagraphLayoutBoxGetOldParagraphs ()
 Returns the old fragments.
wxRichTextAttrGetAttributes ()
 Returns the attributes, for single-object commands.
wxRichTextObjectGetObject () 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 wxRichTextRangeGetRange () const
 Returns the range for e.g.
wxRichTextObjectAddressGetContainerAddress ()
 Returns the address (nested position) of the container within the buffer being manipulated.
const wxRichTextObjectAddressGetContainerAddress () 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.
wxRichTextParagraphLayoutBoxGetContainer () const
 Returns the container that this action refers to, using the container address and top-level buffer.
const wxStringGetName () const
 Returns the action name.

Protected Attributes

wxString m_name
wxRichTextBufferm_buffer
wxRichTextObjectAddress m_containerAddress
wxRichTextCtrlm_ctrl
wxRichTextParagraphLayoutBox m_newParagraphs
wxRichTextParagraphLayoutBox m_oldParagraphs
wxRichTextObjectm_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.

wxRichTextObjectAddress& wxRichTextAction::GetContainerAddress ( ) [inline]

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

const wxRichTextObjectAddress& wxRichTextAction::GetContainerAddress ( ) const [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 ( const wxRichTextObjectAddress address) [inline]

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

void wxRichTextAction::SetContainerAddress ( wxRichTextParagraphLayoutBox container,
wxRichTextObject obj 
) [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

long wxRichTextAction::m_position [protected]
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines