aboutsummaryrefslogtreecommitdiff
path: root/engines/wage
diff options
context:
space:
mode:
authorEugene Sandulenko2016-02-05 11:14:10 +0100
committerEugene Sandulenko2016-02-14 17:13:02 +0100
commitfe40bb284c7cefbfc82c59fc1fd3a0c081416902 (patch)
tree06d5c423b28a9cd47b8c3d335222193a816ffb4f /engines/wage
parenta2e3d33a2dd9c9500504990630d2e6bb2c0da25c (diff)
downloadscummvm-rg350-fe40bb284c7cefbfc82c59fc1fd3a0c081416902.tar.gz
scummvm-rg350-fe40bb284c7cefbfc82c59fc1fd3a0c081416902.tar.bz2
scummvm-rg350-fe40bb284c7cefbfc82c59fc1fd3a0c081416902.zip
WAGE: Started copy command implementation
Diffstat (limited to 'engines/wage')
-rw-r--r--engines/wage/gui.cpp18
-rw-r--r--engines/wage/gui.h4
-rw-r--r--engines/wage/menu.cpp3
3 files changed, 24 insertions, 1 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index 2564f67af2..99876e028f 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -707,8 +707,9 @@ Designed *Gui::mouseUp(int x, int y) {
(_selectionEndX == _selectionStartX && _selectionEndY == _selectionStartY)) {
_selectionStartY = _selectionEndY = -1;
_consoleFullRedraw = true;
+ _menu->enableCommand(kMenuEdit, kMenuActionCopy, false);
} else {
-
+ _menu->enableCommand(kMenuEdit, kMenuActionCopy, true);
}
}
@@ -794,4 +795,19 @@ void Gui::updateTextSelection(int x, int y) {
_consoleFullRedraw = true;
}
+void Gui::actionCopy() {
+ if (_selectionStartX == -1)
+ return;
+
+ int startX = _selectionStartX;
+ int startY = _selectionStartY;
+ int endX = _selectionEndX;
+ int endY = _selectionEndY;
+
+ if (startY > endY) {
+ SWAP(startX, endX);
+ SWAP(endX, endY);
+ }
+}
+
} // End of namespace Wage
diff --git a/engines/wage/gui.h b/engines/wage/gui.h
index 4f3b0f9aa0..16421276be 100644
--- a/engines/wage/gui.h
+++ b/engines/wage/gui.h
@@ -104,6 +104,8 @@ public:
void pushArrowCursor();
void popCursor();
+ void actionCopy();
+
private:
void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType);
void renderConsole(Graphics::Surface *g, Common::Rect &r);
@@ -155,6 +157,8 @@ private:
int _selectionStartY;
int _selectionEndX;
int _selectionEndY;
+
+ Common::String _clipboard;
};
} // End of namespace Wage
diff --git a/engines/wage/menu.cpp b/engines/wage/menu.cpp
index a140254ecc..cb28ca17c3 100644
--- a/engines/wage/menu.cpp
+++ b/engines/wage/menu.cpp
@@ -517,7 +517,10 @@ void Menu::executeCommand(MenuSubItem *subitem) {
case kMenuActionUndo:
case kMenuActionCut:
+ break;
case kMenuActionCopy:
+ _gui->actionCopy();
+ break;
case kMenuActionPaste:
case kMenuActionClear:
break;