WAGE: Implement Undo action
This commit is contained in:
parent
3570e417c9
commit
1d5220ef3f
3 changed files with 15 additions and 1 deletions
|
@ -832,8 +832,18 @@ void Gui::actionCopy() {
|
|||
}
|
||||
|
||||
void Gui::actionPaste() {
|
||||
_engine->_inputText = _clipboard;
|
||||
_undobuffer = _engine->_inputText;
|
||||
_engine->_inputText += _clipboard;
|
||||
drawInput();
|
||||
|
||||
_menu->enableCommand(kMenuEdit, kMenuActionUndo, true);
|
||||
}
|
||||
|
||||
void Gui::actionUndo() {
|
||||
_engine->_inputText = _undobuffer;
|
||||
drawInput();
|
||||
|
||||
_menu->enableCommand(kMenuEdit, kMenuActionUndo, false);
|
||||
}
|
||||
|
||||
} // End of namespace Wage
|
||||
|
|
|
@ -106,6 +106,7 @@ public:
|
|||
|
||||
void actionCopy();
|
||||
void actionPaste();
|
||||
void actionUndo();
|
||||
|
||||
private:
|
||||
void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType);
|
||||
|
@ -160,6 +161,7 @@ private:
|
|||
int _selectionEndY;
|
||||
|
||||
Common::String _clipboard;
|
||||
Common::String _undobuffer;
|
||||
};
|
||||
|
||||
} // End of namespace Wage
|
||||
|
|
|
@ -516,6 +516,8 @@ void Menu::executeCommand(MenuSubItem *subitem) {
|
|||
case kMenuActionQuit:
|
||||
|
||||
case kMenuActionUndo:
|
||||
_gui->actionUndo();
|
||||
break;
|
||||
case kMenuActionCut:
|
||||
warning("STUB: Unhandled shortcut");
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue