aboutsummaryrefslogtreecommitdiff
path: root/graphics/macgui
diff options
context:
space:
mode:
authorVelocityRa2017-04-03 04:44:53 +0300
committerEugene Sandulenko2017-07-17 23:45:22 +0200
commitfe63eb764452affbc2a1f5884b1bb5d95ede7ee7 (patch)
tree9042c40468ff84900e3c3949fccf0498524464c4 /graphics/macgui
parentb127beb03c68a2b8161bb20930093c29b951b091 (diff)
downloadscummvm-rg350-fe63eb764452affbc2a1f5884b1bb5d95ede7ee7.tar.gz
scummvm-rg350-fe63eb764452affbc2a1f5884b1bb5d95ede7ee7.tar.bz2
scummvm-rg350-fe63eb764452affbc2a1f5884b1bb5d95ede7ee7.zip
GRAPHICS: Introduce drawText, appendText and font in MacTextWindow
Diffstat (limited to 'graphics/macgui')
-rw-r--r--graphics/macgui/mactextwindow.cpp18
-rw-r--r--graphics/macgui/mactextwindow.h12
2 files changed, 26 insertions, 4 deletions
diff --git a/graphics/macgui/mactextwindow.cpp b/graphics/macgui/mactextwindow.cpp
index a96aa5a0a4..ba2b9fa0ca 100644
--- a/graphics/macgui/mactextwindow.cpp
+++ b/graphics/macgui/mactextwindow.cpp
@@ -27,17 +27,29 @@
namespace Graphics {
-MacTextWindow::MacTextWindow(MacWindowManager *wm) :
+MacTextWindow::MacTextWindow(MacWindowManager *wm, const Font *font, int fgcolor,
+ int bgcolor, int maxWidth, TextAlign textAlignment) :
MacWindow(wm->getNextId(), true, true, true, wm) {
+
wm->addWindowInitialized(this);
+
+ _font = font;
+ _mactext = new MacText("", _wm, font, fgcolor, bgcolor, maxWidth, textAlignment);
+}
+
+void MacTextWindow::drawText(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff) {
+ _mactext->draw(g, x, y, w, h, xoff, yoff);
+}
+
+void MacTextWindow::appendText(Common::String str) {
+ _mactext->appendText(str);
}
MacTextWindow::~MacTextWindow() {
}
const Font *MacTextWindow::getTextWindowFont() {
- // TODO: make this have an actual effect
- return _wm->_fontMan->getFont(Graphics::MacFont(kMacFontChicago, 8));
+ return _font;
}
} // End of namespace Graphics
diff --git a/graphics/macgui/mactextwindow.h b/graphics/macgui/mactextwindow.h
index b63f135e02..6ca6e9a9af 100644
--- a/graphics/macgui/mactextwindow.h
+++ b/graphics/macgui/mactextwindow.h
@@ -23,14 +23,24 @@
#ifndef GRAPHICS_MACGUI_MACTEXTWINDOW_H
#define GRAPHICS_MACGUI_MACTEXTWINDOW_H
+#include "graphics/macgui/mactext.h"
+
namespace Graphics {
class MacTextWindow : public MacWindow {
public:
- MacTextWindow(MacWindowManager *wm);
+ MacTextWindow(MacWindowManager *wm, const Font *font, int fgcolor,
+ int bgcolor, int maxWidth, TextAlign textAlignment);
~MacTextWindow();
const Font *getTextWindowFont();
+
+ void drawText(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff);
+ void appendText(Common::String str);
+
+private:
+ MacText *_mactext;
+ const Font *_font;
};
} // End of namespace Graphics