Implement insert and overwrite editing modes

This commit is contained in:
G.K.MacGregor
2021-02-14 17:35:11 +00:00
parent 917f4fa7d6
commit 27ad6701b4
6 changed files with 111 additions and 53 deletions

View File

@@ -24,12 +24,12 @@
#include "document.h"
class OverwriteCharacterCommand : public QUndoCommand
class TypeCharacterCommand : public QUndoCommand
{
public:
enum { Id = 101 };
OverwriteCharacterCommand(TeletextDocument *, unsigned char, QUndoCommand *parent = 0);
TypeCharacterCommand(TeletextDocument *, unsigned char, bool, QUndoCommand *parent = 0);
void redo() override;
void undo() override;
@@ -40,7 +40,7 @@ private:
TeletextDocument *m_teletextDocument;
unsigned char m_newCharacter, m_oldRowContents[40], m_newRowContents[40];
int m_subPageIndex, m_row, m_columnStart, m_columnEnd;
bool m_firstDo;
bool m_firstDo, m_insertMode;
};
class ToggleMosaicBitCommand : public QUndoCommand
@@ -61,12 +61,12 @@ private:
int m_subPageIndex, m_row, m_column;
};
class BackspaceCommand : public QUndoCommand
class BackspaceKeyCommand : public QUndoCommand
{
public:
enum { Id = 103 };
BackspaceCommand(TeletextDocument *, QUndoCommand *parent = 0);
BackspaceKeyCommand(TeletextDocument *, bool insertMode, QUndoCommand *parent = 0);
void redo() override;
void undo() override;
@@ -77,7 +77,7 @@ private:
TeletextDocument *m_teletextDocument;
unsigned char m_oldRowContents[40], m_newRowContents[40];
int m_subPageIndex, m_row, m_columnStart, m_columnEnd;
bool m_firstDo;
bool m_firstDo, m_insertMode;
};
class DeleteKeyCommand : public QUndoCommand