diff options
author | VelocityRa | 2017-04-09 00:05:56 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2017-07-17 23:45:22 +0200 |
commit | 3a2ce122888cad6656f6b67aa4dc637a8e262d5e (patch) | |
tree | d1bd0895fae996c9659cf7a5b6dca48352f27d97 /graphics/macgui/mactextwindow.h | |
parent | a169c7efb3c80dafc9cfc2dccf2c31fcffe5be11 (diff) | |
download | scummvm-rg350-3a2ce122888cad6656f6b67aa4dc637a8e262d5e.tar.gz scummvm-rg350-3a2ce122888cad6656f6b67aa4dc637a8e262d5e.tar.bz2 scummvm-rg350-3a2ce122888cad6656f6b67aa4dc637a8e262d5e.zip |
WAGE: Fix resizing and text selection bug
Revise/Simplify old optional text rendering
Set things up a bit for selected text rendering
Add MacTextWindow::clearText and MacTextWindow::setSelection
Add MacTextWindow::appendText variant that accepts a MacFont
Diffstat (limited to 'graphics/macgui/mactextwindow.h')
-rw-r--r-- | graphics/macgui/mactextwindow.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/graphics/macgui/mactextwindow.h b/graphics/macgui/mactextwindow.h index 3ef928eab9..f302f3724d 100644 --- a/graphics/macgui/mactextwindow.h +++ b/graphics/macgui/mactextwindow.h @@ -28,20 +28,35 @@ namespace Graphics { +struct SelectedText { + int startX = 0, startY = 0; + int endX = 0, endY = 0; + + bool needsRender() { + return startX != endX || startY != endY; + } +}; + class MacTextWindow : public MacWindow { public: - MacTextWindow(MacWindowManager *wm, const Font *font, int fgcolor, + MacTextWindow(MacWindowManager *wm, const MacFont *font, int fgcolor, int bgcolor, int maxWidth, TextAlign textAlignment); ~MacTextWindow(); - const Font *getTextWindowFont(); + const MacFont *getTextWindowFont(); void drawText(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff); void appendText(Common::String str, int fontId = kMacFontChicago, int fontSize = 12, int fontSlant = kMacFontRegular); + void appendText(Common::String str, const MacFont *macFont); + void clearText(); + + void setSelection(int selStartX, int selStartY, int selEndX, int selEndY); private: MacText *_mactext; - const Font *_font; + const MacFont *_font; + + SelectedText _selectedText; }; } // End of namespace Graphics |