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

EDIT_API SECEditCommand(SECEdit* pEdit, BOOL bAddCmd = TRUE)

Constructor.

Attributes

EDIT_API SECEditLineColPair GetCmdTextRange() const

Casts this object to its SECEditLineColPair base class.

EDIT_API virtual unsigned int GetTypeID() const

Queries the id of the command.

EDIT_API BOOL IsAddCmd()

Queries whether the command is an insert or delete command.

EDIT_API BOOL IsAdding()

Queries whether the command is executing.

EDIT_API virtual BOOL IsUndoable() const

Queries whether the command can be undone.

Operations

EDIT_API virtual BOOL Execute()

Executes the command.

EDIT_API BOOL Unexecute()

Unexecutes the command.

EDIT_API virtual void Sprint(CString& strCmd)

Formats descriptive information about this command to a CString.

Implementation

EDIT_API virtual BOOL DoDelete()

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

EDIT_API 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.