/*************************************************************************** * Copyright (C) 2004 by Christoph Freundl * * Christoph.Freundl@informatik.uni-erlangen.de * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef SDLWIDGETS_TEXTAREA_H #define SDLWIDGETS_TEXTAREA_H #include #include #include #include #include "widget.h" namespace SDLwidgets { class TextArea : public WidgetLeaf { private: TTF_Font* _font; std::vector _line; public: TextArea( int width, int height ); virtual ~TextArea(); void setFont( std::string fontName, int fontSize ); virtual int getWidth() const { return _width; } virtual int getHeight() const { return _height; } virtual void draw( SDL_Surface* surface ); void appendLine( std::string line ) { _line.push_back( line ); } void appendText( std::string text ); void clear() { _line.clear(); } }; } #endif // SDLWIDGETS_TEXTAREA_H