aboutsummaryrefslogtreecommitdiff
path: root/graphics/macgui/mactextwindow.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2017-08-03 19:45:04 +0200
committerEugene Sandulenko2017-08-04 21:54:20 +0200
commitafb664df290c54febd48b25efe6eeb5fccc0cfcc (patch)
treef39427938716e8fd8e72c05eed4ec4f15e966a43 /graphics/macgui/mactextwindow.cpp
parentaab404864e16f07307e44ed20310037c05e09ceb (diff)
downloadscummvm-rg350-afb664df290c54febd48b25efe6eeb5fccc0cfcc.tar.gz
scummvm-rg350-afb664df290c54febd48b25efe6eeb5fccc0cfcc.tar.bz2
scummvm-rg350-afb664df290c54febd48b25efe6eeb5fccc0cfcc.zip
GRAPHICS: MACGUI: Made selection affecting the MacMenu
Diffstat (limited to 'graphics/macgui/mactextwindow.cpp')
-rw-r--r--graphics/macgui/mactextwindow.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/graphics/macgui/mactextwindow.cpp b/graphics/macgui/mactextwindow.cpp
index 506cd364f6..ce84a5b8f0 100644
--- a/graphics/macgui/mactextwindow.cpp
+++ b/graphics/macgui/mactextwindow.cpp
@@ -26,6 +26,7 @@
#include "graphics/macgui/macwindowmanager.h"
#include "graphics/macgui/macfontmanager.h"
#include "graphics/macgui/mactextwindow.h"
+#include "graphics/macgui/macmenu.h"
namespace Graphics {
@@ -42,10 +43,11 @@ enum {
static void cursorTimerHandler(void *refCon);
-MacTextWindow::MacTextWindow(MacWindowManager *wm, const MacFont *font, int fgcolor, int bgcolor, int maxWidth, TextAlign textAlignment) :
+MacTextWindow::MacTextWindow(MacWindowManager *wm, const MacFont *font, int fgcolor, int bgcolor, int maxWidth, TextAlign textAlignment, MacMenu *menu) :
MacWindow(wm->getLastId(), true, true, true, wm) {
_font = font;
+ _menu = menu;
_mactext = new MacText("", _wm, font, fgcolor, bgcolor, maxWidth, textAlignment);
_fontRef = wm->_fontMan->getFont(*font);
@@ -294,17 +296,17 @@ bool MacTextWindow::processEvent(Common::Event &event) {
(_selectedText.endX == _selectedText.startX && _selectedText.endY == _selectedText.startY)) {
_selectedText.startY = _selectedText.endY = -1;
_contentIsDirty = true;
- //_menu->enableCommand(kMenuEdit, kMenuActionCopy, false);
+ _menu->enableCommand("Edit", "Copy", false);
} else {
- //_menu->enableCommand(kMenuEdit, kMenuActionCopy, true);
+ _menu->enableCommand("Edit", "Copy", true);
bool cutAllowed = false;
if (_selectedText.startY == _selectedText.endY && _selectedText.startY == _mactext->getLineCount() - 1)
cutAllowed = true;
- //_menu->enableCommand(kMenuEdit, kMenuActionCut, cutAllowed);
- //_menu->enableCommand(kMenuEdit, kMenuActionClear, cutAllowed);
+ _menu->enableCommand("Edit", "Cut", cutAllowed);
+ _menu->enableCommand("Edit", "Clear", cutAllowed);
}
}