SECEditCommand Class

class SECEditCommand: public MvcCommand, public SECEditLineColPair

The SECEditCommand class represents the command signalling an either an insert or a delete to the text in the text buffer.

This class derives from SECEditLineColPair and so has a starting and an ending Line/Col. When creating an Insert command, specify the starting line/column indices and the text. When the command executes, it will populate the ending line/column indices (needed to do a delete) When creating a delete command, specify the starting and ending indices. When the command executes, it will store the text to restore.

Note that you can directly call the SECEdit functions Insert and ClearTextBlock and a command will be created automatically and put on the undo stack.

Defined in: SECEditCommand.h

See Also

SECEdit

Class Members

Construction

 SECEditCommand(SECEdit* pEdit, BOOL bAddCmd = TRUE)

Constructor.

Attributes

SECEditLineColPair  GetCmdTextRange() const

Casts this object to its SECEditLineColPair base class.

virtual unsigned int  GetTypeID() const

Queries the id of the command.

BOOL  IsAddCmd()

Queries whether the command is an insert or delete command.

BOOL  IsAdding()

Queries whether the command is executing.

virtual BOOL  IsUndoable() const

Queries whether the command can be undone.

Operations

virtual BOOL  Execute()

Executes the command.

BOOL  Unexecute()

Unexecutes the command.

virtual void  Sprint(CString& strCmd)

Formats descriptive information about this command to a CString.

Implementation

virtual BOOL  DoDelete()

Performs a deletion of text using the data from the command.

virtual BOOL  DoInsert()

Performs an insertion of text using the data from the command.

Public data members

CString  m_strText

The text for this command.

Protected data members

SECEdit*  m_pEdit

Points to the SECEdit model on which to execute the command.

BOOL  m_bAddCmd

Indicates whether this is an insert or delete command.

BOOL  m_bIsAdding

Holds the current state of the command when it is executing.

BOOL  m_bUndoable

Indicates whether the command can be undone.