diff options
-rw-r--r-- | graphics/macgui/mactextwindow.cpp | 18 | ||||
-rw-r--r-- | graphics/macgui/mactextwindow.h | 12 |
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 |