aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCameron Cawley2019-09-19 22:44:49 +0100
committerFilippos Karapetis2019-09-21 22:16:01 +0300
commitec4c846e8cde5ba578bd5385698efaf6d530a716 (patch)
treedb020436a8d102a0b1359ef7cdc9e7c9efd50e0d
parent014bef9eab9fb409cfb3ec66830e033e4aaa29a9 (diff)
downloadscummvm-rg350-ec4c846e8cde5ba578bd5385698efaf6d530a716.tar.gz
scummvm-rg350-ec4c846e8cde5ba578bd5385698efaf6d530a716.tar.bz2
scummvm-rg350-ec4c846e8cde5ba578bd5385698efaf6d530a716.zip
WAGE: Implement global clipboard support
-rw-r--r--engines/wage/gui.cpp18
-rw-r--r--engines/wage/gui.h1
2 files changed, 12 insertions, 7 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index 6075ee1b05..51c140fdb6 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -115,6 +115,10 @@ Gui::Gui(WageEngine *engine) {
_menu->calcDimensions();
+ if (g_system->hasTextInClipboard()) {
+ _menu->enableCommand(kMenuEdit, kMenuActionPaste, true);
+ }
+
_sceneWindow = _wm.addWindow(false, false, false);
_sceneWindow->setCallback(sceneWindowCallback, this);
@@ -347,22 +351,24 @@ void Gui::clearOutput() {
}
void Gui::actionCopy() {
- _clipboard = _consoleWindow->getSelection();
+ g_system->setTextInClipboard(_consoleWindow->getSelection());
_menu->enableCommand(kMenuEdit, kMenuActionPaste, true);
}
void Gui::actionPaste() {
- _undobuffer = _engine->_inputText;
+ if (g_system->hasTextInClipboard()) {
+ _undobuffer = _engine->_inputText;
- _consoleWindow->appendInput(_clipboard);
+ _consoleWindow->appendInput(g_system->getTextFromClipboard());
- _menu->enableCommand(kMenuEdit, kMenuActionUndo, true);
+ _menu->enableCommand(kMenuEdit, kMenuActionUndo, true);
+ }
}
void Gui::actionUndo() {
_consoleWindow->clearInput();
- _consoleWindow->appendInput(_clipboard);
+ _consoleWindow->appendInput(_undobuffer);
_menu->enableCommand(kMenuEdit, kMenuActionUndo, false);
}
@@ -386,7 +392,7 @@ void Gui::actionCut() {
Common::String input = _consoleWindow->getInput();
- _clipboard = _consoleWindow->cutSelection();
+ g_system->setTextInClipboard(_consoleWindow->cutSelection());
_undobuffer = input;
diff --git a/engines/wage/gui.h b/engines/wage/gui.h
index 446cb9d0a0..cb57392d03 100644
--- a/engines/wage/gui.h
+++ b/engines/wage/gui.h
@@ -168,7 +168,6 @@ private:
Graphics::MacMenu *_menu;
bool _sceneDirty;
- Common::String _clipboard;
Common::String _undobuffer;
int _commandsMenuId;